4.3 KiB
4.3 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-add-file-tree-action | Add file-tree context action | done | 2 |
|
plan.md | ../../specs/ui/requirements/file-tree-chat-context.md |
Task 02: Add File-Tree Context Action
Intent
Connect file-tree nodes to the session-scoped context store through the desktop context menu and a touch-reachable row action without disturbing existing tree interactions.
Acceptance
- A single file or directory context menu invokes one session-bound add handler, confirms success, and omits the action during bulk selection.
- Phone and coarse-pointer rows expose a visible 44px overflow action that calls the same handler without opening/expanding/selecting the row.
- New menu, trigger, and feedback copy is localized in English and pseudo catalogs; existing editor, rename, download, delete, keyboard, drag/drop, and selection behavior remains intact.
TDD sequence
- Add failing file/directory/bulk context-menu cases and a row-action propagation/breakpoint case.
- Implement the session-bound handler, prop wiring, desktop action, responsive touch menu, stable selectors, and localized copy.
- Rerun the focused tests, i18n checks, targeted lint, and typecheck; inspect the rendered mobile row/menu before handing off to E2E.
Files likely touched
apps/web/components/task/file-browser.tsxapps/web/components/task/file-browser-parts.tsxapps/web/components/task/file-context-menu.tsxapps/web/components/task/file-context-menu.test.tsxapps/web/components/task/file-browser-context-action.test.tsxapps/web/src/locales/en/chat.jsonapps/web/src/locales/pseudo/chat.json
Dependencies
Task 01.
Parallelism
sequential — the action writes the directory-aware model established by Task 01, and its desktop/touch entry points share the same file-tree components.
Verification
cd apps && pnpm install --frozen-lockfilecd apps && pnpm --filter @kandev/web test -- --run components/task/file-context-menu.test.tsx components/task/file-browser-context-action.test.tsxcd apps/web && pnpm run typecheckcd apps/web && pnpm run i18n:pseudo && pnpm run i18n:check && pnpm run i18n:ratchetcd apps/web && pnpm exec eslint components/task/file-browser.tsx components/task/file-browser-parts.tsx components/task/file-context-menu.tsx components/task/file-context-menu.test.tsx components/task/file-browser-context-action.test.tsx
Inputs
- Spec
Whatplus phone/coarse-pointer and bulk-selection scenarios. - Plan
File-tree actionsandMobile design contract. apps/web/components/task/file-browser-toolbar.tsx,apps/web/components/task/mobile/mobile-sessions-section.tsx, andapps/web/app/globals.cssas responsive menu precedents.apps/web/AGENTS.mdi18n, menu, touch, and component rules.
Output contract
Report RED/GREEN evidence, actual files changed, exact commands/test counts, translated keys, rendered desktop/mobile inspection status, blockers/risks, and synchronized task/plan status in this conversation.
Results
- RED: the new menu/row tests initially failed on the missing responsive action; after the implementation, the focused suite is green.
- GREEN:
cd apps && pnpm --filter @kandev/web test -- --run components/task/file-context-menu.test.tsx components/task/file-browser-context-action.test.tsx— 2 files, 8 tests passed. cd apps/web && pnpm run typecheck— passed.cd apps/web && pnpm run i18n:pseudo— regenerated the pseudo chat catalog;pnpm run i18n:checkandpnpm run i18n:ratchetpassed. The Simplified Chinese chat catalog also contains the complete key set required by the currentmaincatalog.- Targeted ESLint exited successfully with no errors or warnings after extracting the file browser header and the focused E2E page object.
- Localized keys added:
chat:addToChatContext,chat:fileTreeActions, andchat:addedToChatContextin English, pseudo, and Simplified Chinese catalogs. - PR review remediation: Files-tab search results now wrap the same
FileContextMenuandFileTreeNodeTouchActionsused by tree rows, with a synthetic file node carrying the searched path/name. The new focused component test was RED before the wiring and GREEN at 2 tests; the shared handler/store path remains unchanged and search-result additions stay idempotent.