feat(session-picker): add full message preview with formatter rendering#398
Open
jensenojs wants to merge 5 commits into
Open
feat(session-picker): add full message preview with formatter rendering#398jensenojs wants to merge 5 commits into
jensenojs wants to merge 5 commits into
Conversation
…for child sessions - Add child_readonly config (default: true) to opt into messaging child sessions - Infer child session agent type from first assistant message on switch (session.agent may be polluted by prior incorrect agent params) - Lock agent type in child sessions, reject user-initiated mode switches - Child sessions scan messages forward (first is reliable), parent sessions scan backward (most recent is current choice) - Include subagents in agent validation list - Send inferred agent type when messaging child sessions to override polluted session.agent on backend
- Replace cursor+zc fold creation with :{from},{to}fold Ex commands
— avoids cursor-triggered screen redraws (~90ms/fold in large buffers)
- Switch to foldmethod=manual and stay there — prevents foldexpr
recalculation on every buffer line (~4.6s on 87K lines)
- Lazy-render only viewport-sized message count on initial load
- Load more messages on scroll-to-top via WinScrolled autocmd
- Fix lazy_render_count being cleared by M.reset() — read before reset,
persist back to ctx after determining limit
- Debounce WinScrolled load_more callback (150ms) to prevent rapid
re-renders during fast scrolling
- Remove debug vim.notify logging from render paths
Performance: ~36s → ~10ms render time on a 2786-msg/87K-line session.
Closes sudo-tee#392
- 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.
cbbb455 to
67c3130
Compare
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