Skip to content

feat(web): add compact file chip paths - #8825

Open
ricardosalta wants to merge 4 commits into
pingdotgg:mainfrom
ricardosalta:codex/readable-path-chips-upstream
Open

ricardosalta wants to merge 4 commits into
pingdotgg:mainfrom
ricardosalta:codex/readable-path-chips-upstream

Conversation

@ricardosalta

@ricardosalta ricardosalta commented Aug 30, 2026 •

Copy link
Copy Markdown

What Changed

Added a client-local Settings → General → File chip paths option. The existing short labels remain the default; enabling the option renders workspace files with ./, other files under the inferred home directory with ~/, and unrelated files as absolute paths. Line and column positions stay attached.

The formatter handles POSIX, Windows drive, and UNC paths without generating parent-relative labels. Paths containing . or .. stay absolute because resolving them safely requires the filesystem that owns the workspace. The setting participates in search, persistence, and Restore defaults. This option applies to web and desktop; mobile keeps its existing basename-only renderer.

Why

File-name-only chips hide which directory a referenced file belongs to. Duplicate names get a parent suffix, and the full path is available on hover, but users who scan long agent responses still have to stop and inspect each chip. This keeps the compact default while giving path-oriented workflows an explicit, persistent alternative.

UI Changes

Before — default short labels:

Default basename-only file chip

After — File chip paths enabled:

Compact file path chip enabled

Verification

  • 152 focused tests pass across path formatting, the complete current ChatMarkdown suite, observable live preference changes, persisted settings hydration, rerender isolation, settings search, and schema persistence.
  • Targeted lint, formatting, git diff --check, the actual ChatMarkdown suite, and full web typecheck pass.
  • The pnpm wrapper's automatic install is blocked locally by supply-chain policy findings in 74 unchanged upstream lockfile entries; the repository's committed @pierre/diffs patch was applied to the disposable dependency tree before the affected suite and direct full web typecheck passed.
  • The original artifact passed three independent hostile-review rounds. After rebasing onto current main, the exact new artifact passed a fresh hostile re-audit, including the upstream citation/directive changes in ChatMarkdown.

This is a direct feature PR without prior maintainer approval. I understand the contributor guide prefers an Ideas proposal for non-trivial features and that maintainers may close unsolicited feature PRs.

Checklist

  • This PR is small and focused (focused, but GitHub correctly classifies the 653-line diff as size L; most added surface is regression coverage and the dependency-free React test host)
  • I explained what changed and why
  • I included before/after screenshots for the setting and rendered chip change
  • I included a video for animation/interaction changes (not applicable; no motion change)

Model: GPT-5.6 Sol · Harness: Codex in T3 Code.

Summary by CodeRabbit

  • New Features

    • Added a File chip paths setting under Settings → General.
    • File links now show compact labels by default, with an option to display workspace-relative, home-relative, or full paths.
    • File chip labels continue to include available line and column details.
  • Documentation

    • Added documentation explaining file links, chip labels, path formats, and the new display setting.
    • Added links to the File links documentation from the project README files.

Keep basename-only labels as the default and add a client-local setting that renders workspace paths with ./, home paths with ~/, and other paths absolutely. Preserve line and column positions and document the option.
@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c0192a5b-4bfd-4332-9909-02cc77d64b9f

📥 Commits

Reviewing files that changed from the base of the PR and between b1e223e and c475c8d.

📒 Files selected for processing (12)
  • README.md
  • apps/web/src/components/ChatMarkdown.test.tsx
  • apps/web/src/components/ChatMarkdown.tsx
  • apps/web/src/components/settings/SettingsPanels.tsx
  • apps/web/src/components/settings/settingsSearch.ts
  • apps/web/src/filePathDisplay.test.ts
  • apps/web/src/filePathDisplay.ts
  • apps/web/src/hooks/useSettings.ts
  • docs/README.md
  • docs/user/file-links.md
  • packages/contracts/src/settings.test.ts
  • packages/contracts/src/settings.ts

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


📝 Walkthrough

Walkthrough

Adds a showFileLinkPaths client setting for file-link chips. Implements compact path formatting across POSIX, Windows, and WSL paths. Updates chat rendering, settings controls, tests, and documentation.

Changes

File chip path display

Layer / File(s) Summary
Settings contract and persistence
packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts
Adds showFileLinkPaths with a default of false, patch support, and validation tests.
Path compaction and label formatting
apps/web/src/filePathDisplay.ts, apps/web/src/filePathDisplay.test.ts
Adds compact path formatting for workspace, home, Windows, WSL, and UNC paths. Adds label formatting tests.
Chat chip rendering and settings controls
apps/web/src/components/ChatMarkdown.tsx, apps/web/src/components/ChatMarkdown.test.tsx, apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/settings/settingsSearch.ts, apps/web/src/hooks/useSettings.ts
Chat chips respond to the setting. The Behavior settings panel and settings search expose it. Tests cover default labels and live updates.
File-link documentation
README.md, docs/README.md, docs/user/file-links.md
Adds file-link documentation links and describes chip labels, path settings, and path conventions.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SettingsPanels
  participant ClientSettings
  participant ChatMarkdown
  participant FilePathDisplay
  participant MarkdownFileLink
  SettingsPanels->>ClientSettings: Set showFileLinkPaths
  ClientSettings-->>ChatMarkdown: Publish settings update
  ChatMarkdown->>FilePathDisplay: Format file chip label
  FilePathDisplay-->>ChatMarkdown: Return compact or short label
  ChatMarkdown->>MarkdownFileLink: Render updated chip
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to c475c

The file-chip path preference retains source positions in compact labels and has no remaining actionable merge risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 9 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: adding compact file chip paths in the web application.
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the behavior, scope, verification, screenshots, and non-applicable video requirement. The unche…
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: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 9 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 30, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a persisted file-chip display preference and new path-formatting behavior used by the production ChatMarkdown renderer. The option is off by default and preserves existing labels, but the change introduces a new product default and spans shared renderer and settings infrastructure.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant