Registry Mirror
Skip to content

Conversation

@Pruthvirajcodes

Copy link
Copy Markdown
Contributor

Problem

Typing @ and part of a file name in the composer can list every project on the machine above the file results. Pressing Enter then inserts a project folder link instead of the file.

matchComposerProjectItems (added in #44864) matches the query against each project's whole workspaceRoot. Every project shares its parent folders (/Users/<me>/…, /home/<me>/…, ~/code/…), so queries like @use, @home, @code or @work match all of them. Project rows come before the async file search in useComposerMenuItems, so they take the top of the menu and the default selection.

The user docs (docs/user/composer.md) say "Type @ and part of a project name". #44864's own example (@shared finding /work/Shared code) matches the last folder.

Change

Match the project's title or its own folder name (fileBasename(workspaceRoot) from @t3tools/shared/path), not the whole path. The function is shared, so web and mobile both get the fix.

A project can still be found by its folder name, as in #44864's test. It can no longer be found by a parent folder (@acme for /code/acme/api) unless its title matches.

Scope

Small fix for an obvious bug, so it needs no issue under CONTRIBUTING.md.

Verification

  • I added a test to composerThreadItems.test.ts: "matches a project's folder name, not the parent folders every project shares".
    • use, users, code and /me/ against /Users/me/code/web-app/ and C:\Users\me\code\Build tools match nothing.
    • web-app and build still find their projects.
    • It fails on main (d443b1a): both projects are returned for every parent-folder query. With the fix, all 8 tests in the file pass, including feat(composer): reference other projects as folders #44864's original test.
  • vp run check:changed passes: format, lint, knip, typecheck (7 packages), test.
  • scenarios:prove with the scenario below: the scenario fails on base d443b1a18e and passes on head 7fddcf05d2.
    • Two projects, alpha and beta, live under the scenario's shared …/workspaces/ folder, and alpha has src/workspaceLayout.ts.
    • In an alpha thread, I typed @workspace.
    • On base, the first suggestion is the alpha project folder. With the fix, the file is the only suggestion, and Enter inserts it.
Before (main) After
@workspace Before: alpha and beta project folders listed above workspaceLayout.ts After: only workspaceLayout.ts
After Enter Inserts the alpha project folder After: workspaceLayout.ts inserted

I blurred my local home path in the "before" screenshot. The shared …/scenarios/workspaces/ part is still visible.

  • A separate review pass checked fileBasename on POSIX roots with and without a trailing slash, Windows drive roots, UNC and \\wsl.localhost\… roots, and /. None gives an empty folder name.
  • Not shown: mobile was not run. It calls the same function.
Scenario source (scripts/scenarios/composer-mention-skips-shared-parent-folders.e2e.ts)
/// <reference lib="dom" />
import { expect } from "e2e";

import { test, WEB } from "./t3.ts";

test(
  "Typing @ and part of a file name lists the file first, not every project under the same parent folder",
  WEB,
  async ({ t3, app, browser, screen }) => {
    // Every scenario project lives under …/workspaces/, so "workspace" is part of every project path.
    const alpha = await t3.project("alpha", { "src/workspaceLayout.ts": "export {};\n" });
    await t3.project("beta");
    const thread = await t3.thread({ project: alpha, title: "Mentions", messages: ["hello"] });
    await t3.open(thread);

    await screen.getByRole("textbox").tap();
    await browser.keyboard.type("@workspace");
    const options = () =>
      browser.evaluate(() =>
        [...document.querySelectorAll('[data-composer-command-drawer] [role="option"]')].map(
          (option) => option.textContent ?? "",
        ),
      );
    await expect
      .poll(async () => (await options()).some((text) => text.includes("workspaceLayout.ts")))
      .toBe(true);
    await app.screenshot("mention-suggestions");
    expect((await options())[0]).toContain("workspaceLayout.ts");

    await browser.keyboard.press("Enter");
    await expect(screen.getByRole("textbox")).toContainText("workspaceLayout.ts");
    await app.screenshot("after-enter");
  },
);

Written by Claude Opus 5.5 in Claude Code (running in T3 Code), with Claude Fable 5.2 subagents for finding the bug and code review.

🤖 Generated with Claude Code

…le path

Matching the whole workspace root meant any part of a parent folder every
project shares (/Users/..., /home/...) listed every project above the file
results, and Enter inserted a project folder instead of the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 4, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 7fddcf0

Macroscope's review found this PR approvable — Project-reference suggestions now match project titles and folder names rather than parent-directory paths. Existing eligibility filters and the full paths used by selected references remain unchanged, keeping the impact limited to suggestion relevance.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Project matching now checks the project title or the basename of its workspace path. Tests cover POSIX and Windows paths, including matches against folder names and rejected matches against parent-path components.

Changes: Project folder matching

Layer / File(s) Summary
Match project folder names
packages/client-runtime/src/composerThreadItems.ts, packages/client-runtime/src/composerThreadItems.test.ts
The matcher checks project titles and workspace folder basenames instead of full workspace paths. Tests cover POSIX and Windows paths, verify folder-name matches, and reject parent-path matches.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: maria-rcks, saphid

Merge Risk: Minimal · up to 57b15

Merge Risk: ⚪ Minimal · up to 57b15

Project suggestions in the composer now match the project title or folder name, not shared parent folders, so file results are no longer crowded out. The change is small and tested, with little merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the changed behavior: composer @ project references now match by folder name instead of the whole path. It follows the conventional commit form and matches the raw summary, which says …
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem is stated with reproduction context, the change names fileBasename and the shared function, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the changed behavior: composer @ project references now match by folder name instead of the whole path. It follows the conventional commit form and matches the raw summary, which says matchComposerProjectItems now searches the folder basename instead of the full workspace path.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The problem is stated with reproduction context, the change names fileBasename and the shared function, scope explains why no issue is needed, and verification lists the new test, check results, and a before/after scenario with screenshots. Mobile was not run, and the author says so. The template's agent-model line is present. Minor gap: the Scope section cites CONTRIBUTING.md but does not link an issue, which the template allows for small obvious fixes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 915054b and 7fddcf0.

Files selected for processing: 2

  • packages/client-runtime/src/composerThreadItems.test.ts
  • packages/client-runtime/src/composerThreadItems.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 4, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: real web app in Chromium, 1280×900, light theme, fresh isolated database on each commit; synthetic projects and Replay (dev) thread seeded through the server API/CLI.

On each commit, seed fresh alpha and beta git projects beneath a workspaces parent. Alpha contains src/workspaceLayout.ts and src/index.ts; beta contains src/index.ts. Seed and open an alpha Replay (dev) thread, type @workspace, wait for workspaceLayout.ts, capture the menu, press Enter, and capture the inserted chip.

Scenario: Parent folder matches do not displace the intended file mention

Proven: the scenario fails on base 915054b0a2 and passes on head 57b15c0a86.

Base 915054b0a2 Head 57b15c0a86
Result ❌ failed
ASSERTION_FAILED: expect.toContainText failed
locator: getByRole("textbox")
expected: text containing "workspaceLayout.ts"
observed: text "alpha" (match count 1)
✅ passed
workspace suggestions Base 915054b0a2: workspace suggestions Head 57b15c0a86: workspace suggestions
enter selection Base 915054b0a2: enter selection Head 57b15c0a86: enter selection
failure Base 915054b0a2: failure

Before recording · After recording

Scenario source

Observed: base lists alpha and beta above the file and Enter inserts alpha; head lists only workspaceLayout.ts and Enter inserts that file.

Not shown:

  • Project-title and final-folder-name control searches (such as @Alpha) were not exercised; this scenario targets parent-path false matches and default Enter selection.
  • The scenario uses a seeded existing alpha thread rather than creating a new draft through the sidebar. Desktop and mobile were not exercised.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 4, 2026
@juliusmarminge
juliusmarminge merged commit 616ed6a into pingdotgg:main Dec 4, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 4, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Dec 5, 2026
**v0.1.14-nightly.20261204.5734** · 67 changes from 16 contributors

- **Choose a pull request CLI.** Ask agents to use your preferred CLI when opening a pull request.
- **Composer file search.** Find files with @ without unrelated projects crowding the suggestions.
- **Archived thread files.** Deleting a thread no longer offers to remove a checkout still used by an archived thread.
- **Preserved staging.** Rejected commits preserve partially staged changes and files staged in the terminal while hooks run.

### Plus 62 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(web): a timed-out sheet switch keeps the original sheet's selection by @StiensWout in pingdotgg/t3code#48892
* fix(web): Ctrl+C cancels a long paste waiting at a terminal startup prompt by @StiensWout in pingdotgg/t3code#48865
* fix(antigravity): revived native subagents show as running after a restart or send_message by @juliusmarminge in pingdotgg/t3code#48923
* fix(server): deleting a thread no longer offers to remove a worktree an archived thread uses by @juliusmarminge in pingdotgg/t3code#48932
* fix(server): deleting a thread while its provider connects stops the provider by @StiensWout in pingdotgg/t3code#48914
* fix(web,mobile): workflow step times use the app language's decimal separator by @tiliakoos in pingdotgg/t3code#48924
* fix(server): finish submodule checkout when retrying a failed hook by @UtkarshUsername in pingdotgg/t3code#48928
* fix(web): show tooltip on stacked pull request Merge quick action by @only21mil in pingdotgg/t3code#48889
* fix(server): storage cleanup skips a task folder whose checkout is already gone by @juliusmarminge in pingdotgg/t3code#48938
* perf(server): bound run reads when waiting for a known turn by @UtkarshUsername in pingdotgg/t3code#48925
* fix(web): show "Scroll to end" after jumping to an earlier cited response by @only21mil in pingdotgg/t3code#48940
* fix(web): Markdown details that move under a resting pointer open on the first click by @only21mil in pingdotgg/t3code#48945
* fix(mobile): Usage costs and session counts follow the app language by @tiliakoos in pingdotgg/t3code#48949
* fix(web): sidebar threads in a checkout without an icon show their project's icon by @smirea in pingdotgg/t3code#48931
* perf(server): reuse unchanged workflow progress on refresh by @UtkarshUsername in pingdotgg/t3code#48943
* fix(work-log): highlight ruby -e scripts after encoding and feature options by @Pruthvirajcodes in pingdotgg/t3code#48953
* fix(antigravity): show a running native subagent's model once its transcript names it by @juliusmarminge in pingdotgg/t3code#48952
* fix(web): project content search no longer scrolls the results when the pointer lands on a partly hidden row by @only21mil in pingdotgg/t3code#48957
* fix(server): a settle script queued at restart still runs by @StiensWout in pingdotgg/t3code#48910
* fix(server): a rejected selected-file commit keeps what was staged by @juliusmarminge in pingdotgg/t3code#48959
* fix(server): Send now on a queued Claude skill message says it will run next by @juliusmarminge in pingdotgg/t3code#48965
* fix(server): portable handoffs keep conversation turns ahead of command output by @juliusmarminge in pingdotgg/t3code#48951
* fix(web): say when a remote server cannot save a provider setting by @juliusmarminge in pingdotgg/t3code#48964
* fix(web): one Arrow Up loads at most one earlier page of composer history by @juliusmarminge in pingdotgg/t3code#48962
* fix(web): switching a project draft to another machine clears stale file upload references by @only21mil in pingdotgg/t3code#48958
* fix(work-log): highlight duckdb -s scripts by @Pruthvirajcodes in pingdotgg/t3code#48954
* fix(server): a workflow file that defines a version twice is not loaded by @reed-yang in pingdotgg/t3code#48961
* fix(antigravity): shell commands that exit non-zero are recorded as failed by @0xBreadguy in pingdotgg/t3code#48973
* perf(server): one busy terminal no longer fills the trace history in an hour by @AksharP5 in pingdotgg/t3code#48971
* fix(web): simple theme editor rejects invalid colors instead of silently saving defaults by @only21mil in pingdotgg/t3code#48977
* fix(mobile): keep an offline follow-up when another client archives its thread by @juliusmarminge in pingdotgg/t3code#48980
* fix(web): clicking Next slide near the end of a PowerPoint preview no longer skips a slide by @only21mil in pingdotgg/t3code#48984
* fix(server): count named workflow steps in run progress by @KiritoXDone in pingdotgg/t3code#48989
* fix(shared): keep leading terminal marks during redraws by @shivamhwp in pingdotgg/t3code#48775
* fix(web): settings search no longer scrolls the results when the pointer lands on a partly hidden row by @peakoshi in pingdotgg/t3code#49000
* fix(work-log): highlight zsh scripts after --emulate by @Pruthvirajcodes in pingdotgg/t3code#48994
* fix(web): popovers hide when their trigger scrolls out of view by @Sandesh-Solabannavar in pingdotgg/t3code#48913
* fix(shared): ignore footnote markers inside Markdown autolinks by @peakoshi in pingdotgg/t3code#48996
* fix(work-log): name the program after env -a or --argv0 by @Pruthvirajcodes in pingdotgg/t3code#48995
* fix(server): handoff history no longer runs quoted slash commands in Antigravity by @juliusmarminge in pingdotgg/t3code#49005
* fix(web): Escape on a retention rule's switch discards its unsaved age instead of saving it by @only21mil in pingdotgg/t3code#49010
* perf(server): limit history reads when stopping a thread by @UtkarshUsername in pingdotgg/t3code#48987
* fix(server): a rejected commit-all keeps what a terminal staged while hooks ran by @juliusmarminge in pingdotgg/t3code#49028
* fix(shared): ignore phantom file links inside image labels and across headings by @shivamhwp in pingdotgg/t3code#49027
* fix(desktop): AppImage deep links open from no_new_privs processes by @juliusmarminge in pingdotgg/t3code#49023
* fix(server): agents use a forge CLI when the user asks instead of refusing by @juliusmarminge in pingdotgg/t3code#49008
* fix(web): ignore modified navigation keys in table and large text previews by @only21mil in pingdotgg/t3code#49042
* fix(web): Workflows list scrolls smoothly and numbers pick a choice from any button by @juliusmarminge in pingdotgg/t3code#49051
* fix(web,mobile): thread headers and draft hero show a renamed project's name on later checkouts by @smirea in pingdotgg/t3code#49026
* fix(shared): long Markdown previews keep reference links defined after a fence in a list by @StiensWout in pingdotgg/t3code#49044
* fix(shared): saved notebook redraws keep a leading combining mark by @StiensWout in pingdotgg/t3code#49040
* fix(shared): long Markdown previews link footnotes indented with a tab in list items by @StiensWout in pingdotgg/t3code#49046
* fix(composer): match @ project references by folder name, not the whole path by @Pruthvirajcodes in pingdotgg/t3code#49055
* fix(shared): Windows launchers with parentheses resolve in case-sensitive directories by @StiensWout in pingdotgg/t3code#49037
* fix(antigravity): order mid-reply steers after the first answer by @electrum in pingdotgg/t3code#49057
* fix(server): a failed multi-repository restore names the checkout it could not recreate by @StiensWout in pingdotgg/t3code#49060
* fix(web): composer review-comment details keep tags and line breaks by @Pruthvirajcodes in pingdotgg/t3code#49058
* fix(web): Word previews show JPEGs with large metadata headers by @StiensWout in pingdotgg/t3code#49063
* fix(web): notebook previews show JPEG outputs with large metadata headers by @StiensWout in pingdotgg/t3code#49062
* fix(server): stopping a worktree recovery hook finishes its submodules on the next send by @StiensWout in pingdotgg/t3code#49065
* fix(server): a restart while a settled thread's terminals close still runs its settle action by @StiensWout in pingdotgg/t3code#49061
* fix(web): disk image preview skips a volume whose catalog cannot be read by @StiensWout in pingdotgg/t3code#49064
* perf(server): bound the workflows list sent to clients by @juliusmarminge in pingdotgg/t3code#49050
* fix(contracts): managed policy Codex launch arguments keep a trailing escaped space by @saphid in pingdotgg/t3code#49076
* fix(server): link notice says to delegate remote tasks, not move the thread by @juliusmarminge in pingdotgg/t3code#49075
* fix(web): composer suggestion menu no longer scrolls when the pointer lands on a partly hidden row by @peakoshi in pingdotgg/t3code#49079
* fix(web): links to a merged cell with a hidden first cell select its visible part by @StiensWout in pingdotgg/t3code#49068

## New Contributors
* @0xBreadguy made their first contribution in pingdotgg/t3code#48973
* @Sandesh-Solabannavar made their first contribution in pingdotgg/t3code#48913
* @electrum made their first contribution in pingdotgg/t3code#49057

**Full Changelog**: pingdotgg/t3code@v0.1.14-nightly.20261204.5719...v0.1.14-nightly.20261204.5734

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.14-nightly.20261204.5734
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants