-
-
Notifications
You must be signed in to change notification settings - Fork 354
feat(fzf_lua): add custom ActionPreviewer for improved action preview #2151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(fzf_lua): add custom ActionPreviewer for improved action preview #2151
Conversation
|
@olimorris I polished Telescope:
Fzf-lua (before):
Fzf-lua (after):
|
0198b59 to
9f765cf
Compare
|
|
||
| local ActionPreviewer = require("fzf-lua.previewer.builtin").base:extend() | ||
|
|
||
| function ActionPreviewer:new(o, opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add annotations and types to the function names like I do throughout CodeCompanion? Otherwise this looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait a sec, I'm adding tests. I'll handle it once that's done. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've obviously confused things. I meant provide type annotations like string or number. Not expecting you to come up with an fzf specific class and types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not entirely sure which parts you’d like me to annotate.
If you’re referring to o and opts in the ActionPreviewer constructor, their content and usage are internal to fzf-lua. Specifically, o corresponds to the previewer table in fzf_exec, and opts is fzf’s internal config table.
Since these annotations were generated by GPT, it might be better to either remove them or replace them with a link to the relevant file in the fzf-lua repo.
The ActionPreviewer class in the diff is a chat previewer that customizes the behavior of fzf_exec, similar to the action_previewer in actions/telescope.lua. Since I haven’t modified any internal API interfaces (new, picker, or select), and as you mentioned there’s no need to cover fzf-specific classes, I believe the existing annotations should be sufficient.
If any part of the PR remains unclear, I’d be happy to provide a more detailed explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve force-pushed the modified annotations — hopefully this clears up any doubts.
9f765cf to
cd230ba
Compare
|
wait, there are some mistakes in commits messages (generated by ai). |
cd230ba to
d43feb1
Compare
|
@olimorris everything’s done and all tests have passed. 😄 |
|
You just needed to add luals annotations to the fzf file. Please revert the changes for the other files, it's unnecessary for the scope of this PR and we don't need tests for this |
d43feb1 to
7c624cd
Compare
|
@olimorris redundant type annotations and tests have removed as your requirements, and I've updated PR title & description for clarity. Should I move the type annotations in |
- Introduce class to provide enhanced preview functionality for actions in the FZF picker. - Replace simple preview function with a dedicated previewer supporting buffer attachment, markdown rendering, and improved window options. - Refactor picker to use and streamline item name mapping. - Improve selection handling and preview window configuration. (cherry picked from commit 609d96d)
Updates the fzf-lua action picker to use `winopts.title` instead of `prompt`. This provides a more consistent appearance with the telescope.nvim picker, which also uses the window title for its prompt. (cherry picked from commit 3d4ae51)
- Introduce CodeCompanion.ActionItem, ActionOptions, ActionPicker
- Move from top-level prompt to window title for better UX - Retain custom Actions previewer and add docs/annotations
- Aligns title handling with actions picker for consistent UI
7c624cd to
11251c7
Compare
|
This PR is stale because it has been open for 30 days with no activity. |



Description
winopts.title(slash commands).Related Discussion
Discussion 2150
Checklist
make allto ensure docs are generated, tests pass and my formatting is appliedCodeCompanion.hasin the init.lua file for my new feature