fix(skills): select files on click, add Edit to the row menu (MUL-5654) - #6313
Merged
Conversation
The row's action-menu trigger widens its hit area with `after:absolute after:-inset-1` but was not itself positioned, so that pseudo-element resolved against the row — the nearest positioned ancestor — and covered it end to end. Being absolutely positioned it painted above the in-flow name button, so every click on a supporting file's name opened the menu instead of selecting the file, and `opacity-0` never opted the overlay out of hit testing. Only SKILL.md, rendered without actions, stayed clickable, which read as "only SKILL.md can be edited". `relative` puts the ::after back inside the trigger. Alongside the fix, so the editor is reachable in one gesture: - the raw segment reads "Edit" for viewers who may edit, and stays "Plain text" for read-only viewers rather than offering an edit the page refuses; - the row menu gains an Edit entry that opens the file, switches the pane to the editor and puts the caret at its top — including for the file that is already open, which mounts nothing and so cannot rely on mount-time focus; - SKILL.md keeps that entry and still withholds rename/delete. Verified in Chromium against the compiled classes: clicking a file name or empty row space now hits the name button, while the glyph and 4px around it still hit the menu. Co-authored-by: multica-agent <github@multica.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes MUL-5654.
The bug
Clicking a supporting file in the skill file rail never selected it — it opened the row's action menu instead. Only
SKILL.mdcould be opened, which is why the issue started life as "只有 SKILL.md 能编辑".The row's
…trigger widens its hit area withafter:absolute after:-inset-1, but the button itself was not positioned. The pseudo-element therefore resolved against the nearest positioned ancestor — the row — and covered it end to end. Absolutely positioned, it painted above the in-flow name button and swallowed every click on the file name;opacity-0does not opt an element out of hit testing, so the row was dead even before hover.SKILL.mdrenders in a rail without actions, so it had no overlay and stayed clickable.Every other widened hit area in the repo (
slider.tsx,switch.tsx,checkbox.tsx,radio-group.tsx) sits on an element that is itselfrelative; this one was the outlier.Changes
relativeon the menu trigger, so the::afteris bounded by the button. Rows select on click again.autoFocus.SKILL.mdkeeps the Edit entry and still withholds rename/delete:reservedPathnow narrows the menu instead of removing it.New i18n keys
detail.files.mode_editandfile_tree.actions.editin all four locales.Verification
pnpm exec vitest runinpackages/views— 3521 passed (300 files), including locale parity.SKILL.mdoffers Edit but neither rename nor delete; a class-pairing guard on the trigger (relative+after:absolute).pnpm typecheck— 6/6 tasks pass.eslint packages/views/skills— clean.elementFromPointover the file name returned the menu trigger and the click landed there; after it, the name button receives clicks on the name and on empty row space, while the glyph and ~4px around it still hit the menu — the widened target the class was there to provide is preserved.jsdom has no layout or hit testing, which is why the original 51-test suite stayed green through this bug; the unit test added here can only hold the class pairing, so the behavioural check is the browser probe above.
Note for review
Giving
SKILL.mda (single-entry) row menu is a small scope addition beyond the literal bug — it comes from the "右键也可以有编辑选项" part of the request. If you would rather the main file keep a bare row, dropping it is a two-line revert.🤖 Generated with Claude Code