Skip to content

test(web): keep only the original file-chip lookup cases

MacroscopeApp / Macroscope - UI Consistency failed Aug 26, 2026 in 8m 56s

UI Consistency: 1 issue found

apps/web/src/workspaceBasenameLookup.test.ts — The behavior branches this PR introduces are untested after the last two commits removed the cases that covered them: per-thread claim scoping (claimWorkspaceBasenameLookup moved from a process-global counter to a per-scope Map, yet both tests use the same "thread-a" scope), .//backslash normalization in normalizeWorkspaceLookupPath, and the case-folded slashed-suffix match. Reverting the scoping change to a single global counter would still pass the suite. An inline comment with a suggested focused test was posted.

No other findings: environment routing, shared-primitive usage, and Tailwind/CSS ownership are unaffected by this diff.

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/ui-consistency.md
More information about how Check Run Agents work can be found in our Help Center.

Checks performed:

  • Environment routing — ChatMarkdown resolves environmentId = threadRef?.environmentId ?? explicitEnvironmentId ?? null; findWorkspaceBasenameMatch passes that same id to projects.searchEntries, and openFileInPanel early-returns without a threadRef. No silent fallback to the globally active environment was introduced, and capability gating (serverConfig, revealInFileManagerLabel) still reads the same environment the RPC targets.
  • Claim scope vs. panel scope — scopedThreadKey(threadRef) produces "<environmentId>:<threadId>", which is exactly the key rightPanelStore.openFile mutates (byThreadKey), so newest-click-wins is now scoped to the same surface it affects. This part of the change is consistent.
  • Server contract — projects.searchEntries forwards slash-containing queries to the native matcher (only a leading run of @ . / is trimmed) and returns cwd-relative POSIX paths, so the new slashed-path query shape and the resolvePathLinkTarget(match, cwd) reveal path remain valid.
  • Not re-reported — the ambiguous-suffix resolution at workspaceBasenameLookup.ts:58 (suffixMatches[0]) was flagged on the previous run at commit e6b8575 and is byte-identical at this head, so no duplicate comment was posted.
  • No shared-primitive, Tailwind ownership, theme-variant, scroll/virtualization, or visual-geometry changes appear in this diff.

🔍 Agent activity — 10 tool calls

💭 I'm examining the PR's environment routing changes in the shared renderers, checking whether the guard change in ChatMarkdown.tsx from a workspace-basename check to a null environmentId check is safe, and whether the ambiguous suffix-match issue flagged earlier was actually resolved in the current diff. I recall a prior comment flagged that resolving ambiguous suffix matches by just picking the first entry was risky, but comparing the earlier reviewed commit against the current head, the code still does the same thing—so I want to verify what actually changed between those two commits before deciding whether to re-raise it, since I shouldn't post duplicate comments unless the code changed in direct response.

1. git_tools — e6b8575..49603c1

2. browse_code — apps/web/src/workspaceBasenameLookup.ts

💭 That suffix-match ambiguity at line 58 hasn't changed since the prior comment, so I'll skip re-flagging it and shift focus to environment routing in ChatMarkdown.tsx around the modified lines.

3. browse_code — apps/web/src/components/ChatMarkdown.tsx

💭 I should check where environmentId originates within ChatMarkdown, since that's the key rule for environment routing.

4. git_tools — environmentId

💭 The environment routing looks correctly explicit with no fallback to an active environment, which is good. I'm now checking the workspace basename lookup scoping per thread and confirming the null check on threadRef happens before the claim logic runs, which seems properly ordered. I still see the ambiguous suffix match concern flagged in an earlier pass remains unresolved, but since the prior commit reference no longer exists due to a rebase, I need to trace what's changed by looking at the actual commit history on this branch.

5. git_tools

6. browse_code — In apps/web/src, what is scopedThreadKey from @t3tools/client-runtime/environment (packages?) — show its implementation and signature. Also show useRightPanelStore.openFile signature and how the right panel file state is keyed (per thread or global).

💭 The git log seems to show main's history rather than the PR branch commits. Looking at the changed lines for UI consistency, I notice the guard in openFileInPanel shifted from checking needsWorkspaceBasenameLookup to checking environmentId === null -- meaning paths that previously opened synchronously now trigger an async index lookup in all cases, which changes the behavior. That means opening a file now always incurs a round trip before the panel appears, even for full paths that used to open instantly -- a possible perceptible delay on every file chip click. But since the PR's stated intent is that every open goes through the index first, this seems like a deliberate design choice rather than a bug, so I'll treat it as a moderate note rather than a failure. I still need to check whether the ambiguous suffix match issue flagged in the prior run was addressed at head, possibly through added case-folded suffix handling and a new test case, but I can't diff directly against that commit so I should check the PR's commit list on GitHub.

7. github_api_read_only — repos/{owner}/{repo}/pulls/{pull_number}/commits

💭 I notice there's a later commit that fixes the ambiguity, but the head under review still has the unresolved issue — and it was already flagged in the prior run at an earlier commit, so I shouldn't duplicate that finding since the code between the two commits is unchanged aside from test files. Looking further, commit 3851418 added per-thread claim scoping which seems correctly keyed to the panel, though the Map could grow unbounded per thread — a minor memory concern rather than a UI bug. More notably, the last two commits stripped out tests covering per-thread isolation and the ./-strip/case-fold normalization behavior, with the commit message claiming those were just local verification and don't belong in the suite — but that leaves the new normalization and scoping behaviors without regression coverage.

8. browse_code — apps/web/src/workspaceBasenameLookup.test.ts

💭 I'm spotting several behavioral changes that lack test coverage: the new path normalization function, the case-folded suffix matching, and the per-thread claim isolation whose signature now requires scope but whose tests still all use the same thread. This is a solid finding under the guidance requiring focused tests for behavior and state-transition changes. I also notice openFileInPanel now always awaits an index lookup before opening, even for fully-qualified paths that used to open synchronously — meaning every chip click now waits on a network RPC instead of getting immediate feedback. It's mitigated somewhat since the exact-path match usually resolves to the same result, just delayed, but it's still a real interaction regression worth flagging. Digging further, I check the environment routing logic and confirm the environmentId null-check in openFileInPanel is effectively unreachable since threadRef always implies a non-null environmentId, so that's harmless. But I spot a more concerning issue: pickWorkspaceBasenameMatch returns a workspace-root-relative path from the index, and I need to check whether openAt and revealMarkdown consumers correctly interpret that relative path or expect something else. I also note the sequence-tracking map for lookups never gets cleaned up per thread, which is a minor unbounded growth concern but likely too small to flag. I'll keep evaluating other edge cases before deciding what's worth reporting. The suffix ambiguity was already flagged in a prior run and remains unaddressed, so I won't repeat it. What's left worth posting: the deleted test coverage for the new normalize function and claim scope isolation is a concrete gap since the public API changed without corresponding assertions, and the synchronous-open regression where every chip click now waits on an RPC before the panel opens — I should check whether openFile shows a loading state to soften that concern. Checking the check's actual rule set, this interaction delay doesn't clearly map to a covered violation category — the closest matches are about primitives or scroll behavior, neither of which fit cleanly. The strongest genuine finding here is really the deleted test coverage for state transitions, which the check explicitly calls out; I should also verify whether the file panel claim is scoped correctly per-thread. Tracing the PR panel's synthetic thread key confirms scoping is consistent — the panel key matches the scope key exactly, so that's actually correct. Now I'm weighing whether to flag missing test coverage for the newly introduced lookup behavior, but the check's own guidance warns against requiring tests too broadly. But here the behavior changed substantially — path-matching semantics and the claim-scoping API — and tests covering claim-scope isolation were added and then removed in the same PR, with the commit message admitting they don't belong. That isolation logic is the entire point of the change yet has zero coverage, meaning a regression back to a global counter would silently pass; same goes for the ./-strip and case-folded suffix paths. I'm now figuring out where in the diff to place an inline comment about this, likely near the claim describe block in the test file. I'm also weighing whether to flag the always-index-lookup behavior as a secondary concern, but since resolving slashed file-chip paths through the workspace index is the deliberate core intent of this PR, calling that out as a regression risks a false positive unless I can point to a concrete demonstrated failure. I'm concluding I'll focus my comment on the missing test coverage for this behavior change, which is enough grounds to fail the review. Checking the openFileInPanel guard once more, I confirm environmentId is never null when threadRef is set, so that's not a real issue worth raising. I'm also verifying the dependency array and import usage look consistent with the rest of the codebase, then checking whether the workspace lookup path normalization sends fuzzy path queries in a format the search RPC actually supports.

9. browse_code — How does the searchProjectEntries RPC (project entries search, used with { cwd, query, limit, kind: "file" }) match the query against paths? Does it support queries containing slashes (e.g. "docs/plan.md") — is it a fuzzy path matcher over full relative paths or basename-only? Are the returned entry paths relative to the given cwd or to the project/worktree root? Show the server implementation.

💭 The client-side path stripping duplicates server behavior but is harmless, and the cwd-relative path resolution in revealMarkdownFileInFileManager looks correct. My main finding is that tests are missing for the newly-introduced per-thread claim scope isolation behavior, and I'm weighing whether that gap alone should fail the check. I'll check the missing-test finding is in scope — yes, workspaceBasenameLookup.test.ts matches the included patterns — and draft an inline comment targeting the duplicated claimWorkspaceBasenameLookup("thread-a") calls. The comment explains that the claim API moved from a global counter to a per-scope Map, but every test still uses the same scope, so nothing actually exercises the isolation guarantee the change was meant to provide; reverting to the old global counter would still pass all tests. I'll also flag that coverage for normalizeWorkspaceLookupPath's .//backslash stripping and case-folded suffix branch seems to have been dropped in recent commits. Suggesting a diff snippet with a new test case... I'll figure out where to attach this comment in the diff, then submit it as a review comment via the github_pr_review tool.

10. modify_pr — One finding: the new lookup branches introduced by this PR (per-thread claim scoping, .//backslash normalization, case-folded slashed-suffix matching) ended up with no test coverage after the last two commits removed the cases that exercised them. Environment routing in ChatMarkdown still resolves from threadRef.environmentId ?? explicitEnvironmentId with no active-environment fallback, and the claim scope now matches the right panel's byThreadKey keying, so those parts look correct. Note: the ambiguous-suffix resolution at workspaceBasenameLookup.ts:58 flagged on the previous run is unchanged at this head, so it is not re-reported here.


Agent Credits: 648 credits