Skip to content

Conversation

@nothankyouzzz
Copy link
Contributor

@nothankyouzzz nothankyouzzz commented Sep 19, 2025

Description

  • Adds a richer fzf-lua preview experience and moves picker prompts into window titles.
  • Introduces shared ActionItem types and annotates action providers for clarity and consistency.
  • Fixes title handling to set winopts.title (slash commands).

Related Discussion

Discussion 2150

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've added test coverage for this fix/feature
  • I've run make all to ensure docs are generated, tests pass and my formatting is applied
  • (optional) I've updated CodeCompanion.has in the init.lua file for my new feature
  • (optional) I've updated the README and/or relevant docs pages

@olimorris olimorris added the P4 Negligible impact and urgency label Sep 19, 2025
@nothankyouzzz
Copy link
Contributor Author

@olimorris I polished fzf-lua's appearence to let it to be consistent with telescope.nvim, hopes you like it:

Telescope:

image

Fzf-lua (before):

image

Fzf-lua (after):

image

@nothankyouzzz nothankyouzzz force-pushed the feat/fzf-lua-chat-preview branch 2 times, most recently from 0198b59 to 9f765cf Compare September 22, 2025 06:27

local ActionPreviewer = require("fzf-lua.previewer.builtin").base:extend()

function ActionPreviewer:new(o, opts)
Copy link
Owner

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

Copy link
Contributor Author

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. :)

Copy link
Owner

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

Copy link
Contributor Author

@nothankyouzzz nothankyouzzz Sep 22, 2025

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.

Copy link
Contributor Author

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.

@nothankyouzzz nothankyouzzz force-pushed the feat/fzf-lua-chat-preview branch from 9f765cf to cd230ba Compare September 22, 2025 07:38
@nothankyouzzz
Copy link
Contributor Author

wait, there are some mistakes in commits messages (generated by ai).

@nothankyouzzz nothankyouzzz force-pushed the feat/fzf-lua-chat-preview branch from cd230ba to d43feb1 Compare September 22, 2025 07:58
@nothankyouzzz
Copy link
Contributor Author

@olimorris everything’s done and all tests have passed. 😄

@olimorris
Copy link
Owner

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

@nothankyouzzz nothankyouzzz force-pushed the feat/fzf-lua-chat-preview branch from d43feb1 to 7c624cd Compare September 22, 2025 08:51
@nothankyouzzz
Copy link
Contributor Author

nothankyouzzz commented Sep 22, 2025

@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 types.lua to fzf files, or keep it in place.

- 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
@nothankyouzzz nothankyouzzz force-pushed the feat/fzf-lua-chat-preview branch from 7c624cd to 11251c7 Compare September 22, 2025 12:35
@github-actions
Copy link
Contributor

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P4 Negligible impact and urgency Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants