feat: yazi-style File Browser with async live preview#20
Draft
rrbe wants to merge 1 commit into
Draft
Conversation
`termdown <dir>` opens a File Browser: a left panel lists Markdown files, the right pane live-previews the highlighted file, and Enter commits it to the full-screen reader. - Live preview is built off-thread (PreviewWorker) so the event loop never blocks on heading-image rasterization; cursor moves stay instant. Builds are debounced (~120ms settle) and coalesced, and a generation counter discards results whose selection has moved on. - While a build is in flight the pane shows a spinner and places no images (no stale art). - Committing pushes onto the existing o/i history stack like a followed link; ephemeral previews never enter history. - Ephemeral preview image data is reclaimed (`d=I`) when the user scrolls past a file, so a long browse session doesn't accumulate orphaned PNGs in the terminal. - CONTEXT.md pins the "File Browser" (filesystem) vs "Contents/ToC" (headings) terminology to avoid the 目录 collision. Known issue (tracked in TODO.md): after Enter, the full-screen reader path has several rendering problems still to be fixed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
这是什么
termdown <dir>进入 File Browser(仿 yazi):左侧列出目录里的 Markdown 文件,右侧实时预览高亮的文件,按 Enter 提交进全屏阅读器。设计决策(grilling 结论)
⟳ 加载中…且不放图片。o/i历史栈,等同跟随链接;划过的预览是临时的,不进历史。d=I释放其缓存图片数据,避免长时间浏览在终端里攒下孤儿 PNG。CONTEXT.md钉死 File Browser(文件系统) vs Contents/ToC(标题大纲),消除「目录」一词歧义。故意留到后续(HALF 2,见 TODO.md)
.gitignore测试
make check全绿(fmt-check + clippy-D warnings+ 全部测试)。browser::is_markdown、kitty::forget_frees_data_and_drops_tracking。🤖 Generated with Claude Code