Skip to content

feat(web): add composer file-reference picker#85

Merged
wolfiesch merged 5 commits into
LycaonLLC:mainfrom
dylantirandaz:feat/composer-file-refs
Jul 20, 2026
Merged

feat(web): add composer file-reference picker#85
wolfiesch merged 5 commits into
LycaonLLC:mainfrom
dylantirandaz:feat/composer-file-refs

Conversation

@dylantirandaz

@dylantirandaz dylantirandaz commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

What this changes

  • Adds an @ file-reference picker to the composer. Type @ to open a ranked list of the session's files.
  • Accept a directory to list its children. Accept a file to insert its path into the draft.
  • Accepted references show as chips above the composer. The draft text is the only state: each chip is a view of the text, and removal edits the text.
  • The picker reads the session's file index and loads directories on demand. It closes when the composer is disabled, under the same rules as the slash menu.
  • Moves the query-ranking functions from slash.ts into match.ts, so the slash menu and the picker share one ranker.

Implements the file/path-references row of FEATURE_MATRIX §4 (text insertion plus chips; reorder is not included).

Verification

  • pnpm check passes: release contract, provenance, lint, typecheck. The provenance record for the extracted scorer now covers slash.ts and match.ts.
  • pnpm --filter @t4-code/web test passes: 74 files, 1099 tests. The 20 new tests cover the trigger rules, listing flattening, ranking order, insert spans, and chip tokens.
  • Drove the picker in a browser on fixture data: @ opens the menu; ranking puts basename matches first; a directory accept loads its children and keeps the menu open; typed paths load directories on demand; a file accept inserts the path and shows a chip; chip removal edits the draft; Escape closes the menu.

Checklist

  • pnpm check passes (release contract, provenance, lint, typecheck)
  • pnpm test passes; new behavior has a test that fails without this change (ran the @t4-code/web suite; the known packages/client transcript-retention failure on main is unrelated)
  • Any pasted logs or screenshots are redacted: no secrets, tokens, pairing codes, or private paths
  • Ported code (T3 Code / OMP) follows the provenance rules in THIRD_PARTY_NOTICES.md

dylantirandaz and others added 4 commits July 19, 2026 18:51
Move the tiered scoring functions into composer/match.ts so the slash
palette and future pickers share one ranker. No behavior change; the
provenance record now covers both files.
Type @ in the composer to open a ranked list of session files. Accept a
directory to see its children; accept a file to insert its path into the
draft. Accepted references render as chips derived from the draft text, so
the text stays the only state and removal edits the text directly. The
picker reads the session file index, loads directories on demand through a
new requestDir action, and closes under the same disabled rules as the
slash menu.
# Conflicts:
#	apps/web/src/features/transcript/SessionMain.tsx
@wolfiesch

wolfiesch commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Made a few more quick changes:

  • Blocked absolute and parent-directory file queries before they reach the host file-list command.
  • Added CJK and emoji filename support.
  • Kept email-like text from rendering as a file chip.
  • Avoided adding a second space when inserting a reference before existing whitespace.
  • Merged current main while preserving transcript export, then reran pnpm check and the full test suite.

@wolfiesch
wolfiesch merged commit 948453d into LycaonLLC:main Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants