feat(session-picker): add full message preview with formatter rendering#398
Merged
Merged
Conversation
cbbb455 to
67c3130
Compare
- base_picker: add preview='custom' + preview_fn type, Telescope buffer_previewer implementation for custom content preview - output_window: extract apply_extmarks(bufnr, extmarks, line_offset?) as reusable public function; set_extmarks delegates to it - api_client: list_messages(id, directory, opts?) accepts opts table for query parameters (e.g. limit) - session: get_messages(session, opts?) passes opts through
Session picker now shows a rich preview when selecting a session: - normalize_message_order: handle API descending order - filter_preview_messages: show first user msg + last assistant reply - format_messages: reuse existing formatter for consistent rendering (pcall per-part, no get_child_parts, no previous_message) - render_preview_buffer: direct nvim API with window-local folds - preview_fn: synchronous load via Promise:wait() (~20-30ms) Only Telescope backend supported in this commit.
- Unify custom preview rendering behind a backend-neutral preview target so session previews work consistently with Telescope, fzf-lua, and Snacks. - Normalize picker plugin aliases such as fzf-lua, telescope.nvim, and snacks.nvim to their internal backend names, and add regression coverage for custom preview behavior across the picker integrations.
67c3130 to
5634272
Compare
Contributor
Author
Contributor
Author
|
I still have some minor improvements and optimizations I want to make, but I need to take a break. Not sure when I'll tinker with this plugin next, maybe soon. |
Owner
|
Thank you very much it works really great now :). I think we can merge this and, if there is any other optimization to be done we can add them later. |
Contributor
Author
|
Just shove it somewhere, I don't want this issue to be closed, lol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




base on #393, to close #391
just for try out, @sudo-tee