-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(agent-file-preview): show previews in files overlay #16713
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
Merged
+1,017
−1,049
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2d8cce5
feat(agent-file-preview): show previews in files overlay
AtomsH4 46089c1
fix(agent-file-preview): gate file tree model by pane state
AtomsH4 2685558
fix(agent-file-preview): clear stale overlay selections
AtomsH4 1da9eae
fix(file-tree): allow context menu bubbling
AtomsH4 18565f8
fix(agent-file-preview): focus overlay previews
AtomsH4 41b87d8
Merge remote-tracking branch 'origin/main' into feat/file-preview-ove…
AtomsH4 29ca171
Merge branch 'main' into feat/file-preview-overlay
AtomsH4 97a260a
Merge branch 'main' into feat/file-preview-overlay
AtomsH4 24af41c
fix(agent-file-preview): clear stale standalone overlays
AtomsH4 d693f62
fix(agent-file-preview): gate file tree by active tab
AtomsH4 2e186c3
refactor(artifact-pane): simplify file preview overlay
AtomsH4 287f5f9
Merge remote-tracking branch 'origin/main' into feat/file-preview-ove…
AtomsH4 988773a
docs(file-docs): revert unrelated reference link updates
AtomsH4 81eb5d4
fix(command-menu): stop nested context menu bubbling
AtomsH4 74d64c3
docs(agent-file-preview): update overlay docs
AtomsH4 764a42c
Merge branch 'main' into feat/file-preview-overlay
AtomsH4 633c7f1
chore(file-preview-overlay): merge main
AtomsH4 28d38dc
Merge branch 'main' into feat/file-preview-overlay
AtomsH4 0ff2151
Merge branch 'main' into feat/file-preview-overlay
AtomsH4 5082ce5
Merge branch 'main' into feat/file-preview-overlay
0xfullex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
[B7/B3] Removing the unconditional
onContextMenustopPropagation regresses NotesSidebar's context menuThis deletes
onContextMenu={(e) => e.stopPropagation()}from the sharedFileTreeRowto fix the native-menu case inArtifactPane(which has no outer menu). ButFileTreeRowis also used byNotesSidebar(NotesSidebar.tsx:375), where the wholeFileTreeis wrapped in an outerCommandContextMenu(the non-empty "New note / New folder / Upload…" empty-area menu) while each row also has its ownCommandContextMenu.In the default
cherrypresentation mode,CommandContextMenuuses RadixContextMenuTrigger, whoseonContextMenucallshandleOpen+preventDefaultbut notstopPropagation. The row'sstopPropagationwas what kept a row right-click from also bubbling to the outer empty-area trigger. With it removed, right-clicking a note row now opens both the row menu and the empty-area menu at once (the empty-area one ends up on top), so users can no longer reliably reach the row actions.Native mode is unaffected because
handleNativeContextMenucallsstopPropagationitself — only the default cherry mode regresses. The added test (allows row context-menu events to reach the menu wrapper) only asserts the bubbling that causes this; it doesn't cover the nested-wrapper case.Suggested direction (author's call): fix it upstream so nested cherry-mode menus don't double-open — e.g. have
CommandContextMenu's cherry-mode trigger stop propagation of thecontextmenuevent once it handles it — or reintroduce a scoped stop on the row that still lets the row's own wrapper receive the event.Uh oh!
There was an error while loading. Please reload this page.
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.
Verified current head
74d64c35dc5d1f2dbbde63836deecad0dcfe6e56, this nested cherry-mode context menu issue has been fixed.The fix is in
81eb5d48d5:CommandContextMenu's cherry-mode trigger now callsevent.stopPropagation()after handlingcontextmenu, so the inner row menu won't bubble up to the NotesSidebar outer empty-area menu after handling right-click; native mode still usesstopPropagation()inhandleNativeContextMenu.Also added a regression test
stops cherry context-menu events after an inner menu handles them, covering that the outeronOpenChangedoesn't trigger when the inner menu opens. The latest74d64c35dcis just documentation updates, not affecting this behavior.Original Content
已核对当前 head
74d64c35dc5d1f2dbbde63836deecad0dcfe6e56,这个 nested cherry-mode context menu 问题已经修复。修复在
81eb5d48d5:CommandContextMenu的 cherry-mode trigger 现在在处理contextmenu后调用event.stopPropagation(),所以内层 row menu 处理右键后不会再冒泡到 NotesSidebar 外层 empty-area menu;native mode 仍沿用handleNativeContextMenu里的stopPropagation()。也补了回归测试
stops cherry context-menu events after an inner menu handles them,覆盖内层 menu 打开时外层onOpenChange不触发。最新的74d64c35dc只是文档更新,没有影响这部分行为。