Skip to content

fix(server): file listing keeps gitignore status when a filename looks like a git pathspec - #42333

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/server-workspace-entries-literal-pathspecs
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/server-workspace-entries-literal-pathspecs

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When the repository root has a file whose name starts with : and reads as Git pathspec magic, such as :(draft).md, the Files panel shows gitignored files listed with it (such as ignored.log) as normal files instead of greying them out. git check-ignore --stdin exits 128 on that name (fatal: Invalid pathspec magic 'draft' in ':(draft).md'), so the listing loses every ignored label in the batch that holds it.

Change

checkIgnore in apps/server/src/workspace/WorkspaceEntries.ts now prefixes each stdin path with ./, since pathspec magic only applies to a leading :. Because Git echoes each path as given, the loop strips ./ from returned paths before matching entries. --literal-pathspecs, GIT_LITERAL_PATHSPECS, and :(literal) are not used because git check-ignore rejects them for every path (exit 128: pathspec magic not supported by this command: 'literal'). I also let wide folders whose name starts with : use the one-call shortcut, since the : exclusion only existed for the same problem (only glob characters still skip it); in apps/server/src/workspace/WorkspaceEntries.test.ts, the existing root-listing test now includes a :(draft).md file and the wide-folder test checks a :-named folder's labels.

Scope

Bug fix for wrong data (missing ignored labels in folder listings). No issue: this is a small fix for an obvious bug where one file name at the repository root silently drops gitignore labels for the files listed with it.

Verification

Steps (Linux): git init demo-project, add .gitignore (*.log), create ignored.log, notes.md, README.md, and :(draft).md → add the folder as a project → open the right panel → Files.

Setup: Linux (Ubuntu 26.04), web client in T3's built-in browser panel, light theme, 1280x800 viewport, fresh isolated dev data per commit (vp run dev --no-seed), synthetic demo repo, server named "Test machine".

e3ff780 4d1dab2
ignored.log looks like a normal file next to :(draft).md
ignored.log looks like a normal file next to :(draft).md
ignored.log is greyed out as gitignored next to :(draft).md
ignored.log is greyed out as gitignored next to :(draft).md

Tests (Node 26.13.1): On e3ff780, the root-listing test and the wide-folder test fail; on 4d1dab2, WorkspaceEntries.test.ts passes 35/35 three times and vp run check:changed against e3ff780 passes.

Merged tree: 4d1dab2's parent is e3ff780, the newest green main when checked, so the head is the merged tree.

Test output
# e3ff780 — WorkspaceEntries.test.ts on base source
 FAIL  |t3| src/workspace/WorkspaceEntries.test.ts > WorkspaceEntries > list > lists immediate children including ignored and empty directories
AssertionError: expected [ Array(8) ] to deeply equal ArrayContaining{…}

- Expected
+ Received

- ArrayContaining [
+ [
    {
-     "ignored": true,
      "kind": "file",
      "path": ".env",
    },
    {
-     "ignored": true,
+     "kind": "file",
+     "path": ".gitignore",
+   },
+   {
+     "kind": "file",
+     "path": ":(draft).md",
+   },
+   {
      "kind": "directory",
+     "path": "empty",
+   },
+   {
+     "kind": "directory",
      "path": "node_modules",
    },
    {
      "kind": "directory",
      "path": "src",
    },
    {
      "kind": "directory",
-     "path": "empty",
+     "path": "sub",
    },
    {
      "kind": "file",
      "path": "tracked.txt",
-   },
-   {
-     "kind": "file",
-     "path": ":(draft).md",
    },
  ]
 FAIL  |t3| src/workspace/WorkspaceEntries.test.ts > WorkspaceEntries > list > labels the children of wide folders exactly as git does for each child
AssertionError: :foo: expected [ ':foo/pkg-0.js', …(1000) ] to deeply equal []
 Test Files  1 failed (1)
      Tests  2 failed | 33 passed (35)
# 4d1dab2 run 1
 Test Files  1 passed (1)
      Tests  35 passed (35)
# 4d1dab2 run 2
 Test Files  1 passed (1)
      Tests  35 passed (35)
# 4d1dab2 run 3
 Test Files  1 passed (1)
      Tests  35 passed (35)
# 4d1dab2 check:changed
check:changed summary
  pass  format  0.2s
  pass  lint  0.3s
  pass  knip 1/2  7.7s
  pass  knip 2/2  14.0s
  pass  graphql (apps/server)  0.4s
  pass  typecheck (3 packages)  8.8s
  pass  test (2 files)  9.8s
  CI also runs: full test suites, build
  unused patch check skipped: no dependency files changed

Not shown

  • Windows and macOS (: is not a legal Windows filename character, so the root-listing test adds :(draft).md only off Windows).
  • Desktop and mobile clients (both read the same server listing; no client code changed).
  • Folders over 1,000 entries in the app (the wide-folder unit test covers their labels; it fails on e3ff780 and passes on 4d1dab2).

An AI agent ran every check.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4d1dab2 and 4d0a888.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Workspace listing now passes paths with a ./ prefix to Git’s ignore check and removes that prefix from returned paths. Bulk ignored-directory checks include colon-prefixed paths. Tests cover colon-prefixed filenames and directories.

Changes: Workspace ignore paths

Layer / File(s) Summary
Literal path handling and tests
apps/server/src/workspace/WorkspaceEntries.ts, apps/server/src/workspace/WorkspaceEntries.test.ts
WorkspaceEntries.list prefixes paths submitted to git check-ignore with ./ and removes the prefix from returned paths. Bulk ignored-directory checks no longer exclude colon-prefixed paths. Tests cover colon-prefixed filenames and directories.

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

Change: Bug fix

Suggested reviewers: lln556, antoniooo12

Merge Risk: Minimal · previous review 4d1da

This change keeps Git-ignore labels in file listings for filenames such as :(draft).md. No actionable merge-blocking risk was identified, and the change is localized and easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix, the server component, and the specific cause: file listing keeps gitignore status when a filename resembles a Git pathspec. This matches the changeset, which prefixes check-ig…
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content. The Problem section gives the reproduction, the Change section explains t…
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 fix, the server component, and the specific cause: file listing keeps gitignore status when a filename resembles a Git pathspec. This matches the changeset, which prefixes check-ignore paths with './' and strips it from output, and adds tests for a ':(draft).md' root file and a ':'-named wide folder. The title is a single conventional-commit sentence, though at 90 characters it is on the long side.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content. The Problem section gives the reproduction, the Change section explains the './' prefix and why literal-pathspec options were rejected, and the Scope section justifies the absence of a linked issue for a small obvious bug. Verification gives concrete steps, before/after screenshots, and test output across two commits. The description also lists what was not checked (Windows, macOS, desktop and mobile clients, folders over 1,000 entries). Minor issues: the template asks to state the model and harness used, and the description includes it, so this is satisfied. The description has a few unverifiable references, such as links to a commit on a different fork, but it is substantively complete.

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 11c63a9 and 4d1dab2.

Files selected for processing: 2

  • apps/server/src/workspace/WorkspaceEntries.test.ts
  • apps/server/src/workspace/WorkspaceEntries.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Real web app, 1280×800, light theme, fresh isolated state on each commit. Seed an uncommitted repository with .gitignore containing *.log and empty ignored.log, notes.md, README.md, and :(draft).md; open a Replay thread and choose Files in the right panel.

The scenario fails on base and passes on head: ignored.log renders normally before the fix and greyed out afterward.

Before After
Before: ignored.log loses ignored styling After: ignored.log retains ignored styling
ece5f21b17 4d0a888a26

Scenario source · Before recording · After recording

Not shown:

  • Ignored colon-prefixed directories and the wide-folder shortcut were not exercised; this scenario covers the reported filename batch failure.
  • The rename-and-refresh control was not exercised; both commits were compared with the pathspec-like filename present.

@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 Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit 8a5dbb4 into pingdotgg:main Nov 24, 2026
55 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 25, 2026
**v0.1.12-nightly.20261124.5209** · 23 changes from 11 contributors

- **T3 Connect sign-in alerts.** Get notified when a new T3 Connect device signs in.
- **Antigravity quota recovery.** Threads can resume or snooze automatically when Antigravity reports a quota reset time in its error message.
- **Theme editor changes.** Canceling an input method candidate with Escape no longer closes the editor and discards unsaved changes.

### Plus 19 more bug fixes.

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

## What's Changed
* fix(web): Voice Models language menu resets its search filter on close by @only21mil in pingdotgg/t3code#42321
* feat(connect): tell people when a new T3 Connect device signs in by @juliusmarminge in pingdotgg/t3code#42311
* fix(web): new-commits banner on a PR spans the full header width by @juliusmarminge in pingdotgg/t3code#42342
* fix(web): opening a resolved PR comment keeps its toggle under the cursor by @ipanasenko in pingdotgg/t3code#42312
* fix(web): large SVG project icons come back after their link expires by @smirea in pingdotgg/t3code#42329
* fix(server): Antigravity quota failures keep the 'Resets in' reset time by @juliusmarminge in pingdotgg/t3code#42339
* fix(server): file listing keeps gitignore status when a filename looks like a git pathspec by @only21mil in pingdotgg/t3code#42333
* fix(bitbucket): checkouts cloned from ssh.bitbucket.org match their pull requests by @adrhumphreys-atlas in pingdotgg/t3code#42330
* fix(client): a tab-indented fence line in a PR description code block no longer swaps which video plays by @Marve10s in pingdotgg/t3code#42331
* fix(web): script command field shows both hyphens with ligature fonts by @Mnigos in pingdotgg/t3code#42352
* fix(server): honor sort: "created" when merging IssueService.list entries by @AymanKhan9 in pingdotgg/t3code#42350
* fix(server): a terminal commit refreshes cached Changes totals by @juliusmarminge in pingdotgg/t3code#42365
* fix(web): an IME Escape no longer closes the theme editor or ends inspection by @omaribrahim6 in pingdotgg/t3code#42332
* fix(web): Esc in a font family field closes Settings when no edit is pending by @only21mil in pingdotgg/t3code#42361
* fix(relay): traces no longer record callers' IP addresses or user agents by @juliusmarminge in pingdotgg/t3code#42380
* fix(server): source control discovery no longer runs the auth command of a CLI that is not installed by @juliusmarminge in pingdotgg/t3code#42379
* fix(web): sidebar issue and pull request badges share one component by @Bil0000 in pingdotgg/t3code#42275
* feat(relay): delete a user's relay data when Clerk deletes the user by @juliusmarminge in pingdotgg/t3code#42285
* fix(web): Esc in Theme Editor color filter clears the filter without closing the editor by @juliusmarminge in pingdotgg/t3code#42395
* fix(mobile): analytics uses its own random device id by @juliusmarminge in pingdotgg/t3code#42394
* fix(desktop): Windows desktop applies the saved user telemetry opt-out by @juliusmarminge in pingdotgg/t3code#42376
* fix(web): Enter commits Background Activity interval values by @only21mil in pingdotgg/t3code#42392
* fix(server): analytics no longer reads or sends Codex and Claude account IDs by @gabrielelpidio in pingdotgg/t3code#42299

## New Contributors
* @adrhumphreys-atlas made their first contribution in pingdotgg/t3code#42330

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261124.5204...v0.1.12-nightly.20261124.5209

</details>


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

Labels

size:S 10-29 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