GeezerVison is showing github.com — refactor(web): file browser records the right-click position on its own panel by juliusmarminge · Pull Request #25908 · pingdotgg/t3code
Conversation
Problem
The file browser places its native context menu at the pointer (Pierre's shadow-DOM row rects are unreliable). To get the position it attached a capture contextmenu listener to the whole document from a mount effect, so every right-click anywhere in the app wrote to its ref, though only right-clicks on its own tree rows read it.
Change
The panel root records the position in an onContextMenuCapture handler and the effect is gone. contextmenu is composed, so React's root capture listener sees it (with the shadow host as target) before the tree's shadow-internal row handler opens the menu, the same ordering the document capture listener gave. clientX/clientY/timeStamp come from the native event, so the 1s freshness check is unchanged. Keyboard-opened menus still fall back to the anchor rect.
What this improves
- Sync removed: one mount effect and its document add/remove listener pair. The pointer capture now lives on the element that owns the menu, as ordinary event handling.
- Behavior change (minor): right-clicks outside the file browser panel no longer overwrite the stored pointer. No bug fix claimed.
Effects
apps/web/src/components/files/FileBrowserPanel.tsx: 9 -> 8
Verification
vp run check:changed: format, lint, knip 1/2 and 2/2, typecheck (3 packages), test all pass.
- No browser run (right-click menu placement is a desktop native menu; not exercised here).
Model: Claude Opus 5.5, Claude Code harness.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…wn panel
The file browser placed its native context menu at the pointer by listening
for every contextmenu event on the whole document from a mount effect, even
though only right-clicks on its own tree rows read the position.
The panel root now records the position in an onContextMenuCapture handler.
contextmenu is composed, so React's root capture listener sees it before the
tree's shadow-internal row handler opens the menu, the same ordering the
document capture listener gave. clientX/clientY/timeStamp are the native
values, so the freshness check is unchanged.
Effects: FileBrowserPanel.tsx 9 -> 8 (document listener effect removed).
Behavior change: right-clicks outside the panel no longer overwrite the
stored pointer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Approved at f7c3385
Macroscope's review found this PR approvable — This small, self-contained refactor scopes context-menu pointer tracking to the file browser panel while preserving file-row menu placement behavior. It introduces no schema, deployment, security, billing, default, or static-analysis changes.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 79f6cd3 and f7c3385.
Files selected for processing: 1
-
apps/web/src/components/files/FileBrowserPanel.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Walkthrough
-
The file-browser panel now captures context-menu pointer coordinates and timestamps with a React capture handler. The existing menu-position logic continues to use the captured position or fall back to the row’s bounding rectangle.
Changes: File-browser context-menu capture
| Layer / File(s) |
Summary |
Panel-level context-menu capture apps/web/src/components/files/FileBrowserPanel.tsx |
The panel captures pointer coordinates and timestamps before the tree’s row handler opens the context menu. The document-wide capture listener and its cleanup are removed. |
Priority: Low
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Refactor
Possibly related PRs
- pingdotgg/t3code#23535: Adds file-browser context-menu actions and passes pointer coordinates into the file menu.
- pingdotgg/t3code#24820: Attaches file-browser context-menu capture to the panel root during a
FileBrowserPanel refactor.
Suggested reviewers: maria-rcks
Merge Risk: Minimal · up to f7c33
-
No actionable merge-blocking risk is established for this focused context-menu capture change.
Pre-merge checks: 3 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Description check |
 |
The description follows the template. It has Problem, Change, and Verification sections, and it explains the reason for the change and the event ordering. The Scope and approval section is missing. It… |
Add a Scope and approval section. Link the triaged issue or the maintainer discussion that approved this direction, or explain why a very small, focused change qualifies without prior approval. Also explain why the behavior change (right-cl… |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title follows conventional commit format and names the main change: the file browser now records the right-click pointer position on its own panel. It matches the raw summary, which says the panel… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title follows conventional commit format and names the main change: the file browser now records the right-click pointer position on its own panel. It matches the raw summary, which says the panel's React capture handler replaces the document-wide native contextmenu listener. The title is specific and does not rely on file lists or vague wording.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, and Verification sections, and it explains the reason for the change and the event ordering. The Scope and approval section is missing. It does not link a triaged issue or maintainer approval, and it does not explain why the change qualifies without one. The description also lacks a before/after screenshot. The change is a refactor with a stated behavior change, so the screenshot requirement may not apply, but the author should say so. The verification section lists checks that passed but says no browser run was done, which the template allows as a statement of what was not checked.
Resolution
Add a Scope and approval section. Link the triaged issue or the maintainer discussion that approved this direction, or explain why a very small, focused change qualifies without prior approval. Also explain why the behavior change (right-clicks outside the panel no longer update the stored pointer) stays within the scope of the approved work. State whether a UI screenshot or recording applies. The change affects only the menu position source, and the author should say whether that counts as a visible UI change.
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|