Skip to content

fix(mobile): optional toggle to dim agent directory-listing size tokens - #10603

Open
innocarpe wants to merge 2 commits into
stablyai:mainfrom
innocarpe:fix/mobile-dim-dir-listing-sizes
Open

innocarpe wants to merge 2 commits into
stablyai:mainfrom
innocarpe:fix/mobile-dim-dir-listing-sizes

Conversation

@innocarpe

@innocarpe innocarpe commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds an opt-in Terminal setting on mobile that visually dims trailing file-size tokens (1.4K, 738B, 45.9K, …) in agent directory listings.
  • Visual-only xterm decorations — selection, copy, and the PTY buffer stay byte-identical.
  • Off by default; persists per device like the autocomplete toggle.

Fixes

Closes #10508

Test plan

  • Unit tests: preference load/save + subscriber; size-token matcher
  • Manual: enable Settings → Terminal → Dim file sizes; open agent listing; sizes look dimmed; copy still includes sizes

ELI5

Mobile terminals can optionally dim trailing file-size tokens in directory listings so agent ls output is easier to read. It's visual-only and off by default.

…ns (stablyai#10508)

Add a Terminal settings switch (off by default) that visually dims trailing
size tokens like 1.4K / 738B in agent listings. Decorations only — the PTY
buffer, selection, and copy stay byte-identical.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a persisted “Dim file sizes” terminal preference with load, save, and subscription APIs. The terminal WebView receives preference updates through a new bridge command and applies injected decoration logic to trailing directory-listing size tokens. Decorations refresh after terminal writes and scrolling and clear during disposal. Tests cover preference persistence and notifications, token parsing, invalid inputs, and trailing whitespace.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, especially Screenshots, AI Review Report with cross-platform checks, Security Audit, and Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add the mobile toggle, persist it, inject visual-only dimming, and keep selection/copy unchanged as requested for #10508.
Out of Scope Changes check ✅ Passed All changed files support the new terminal dimming feature; no unrelated or desktop-impacting changes are evident.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly matches the main change: adding an optional mobile toggle to dim directory-listing size tokens.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f8740e19-6c19-4cc9-adf8-fa8a82d91090

📥 Commits

Reviewing files that changed from the base of the PR and between 9eff372 and 8be0975.

📒 Files selected for processing (9)
  • mobile/app/terminal-settings.tsx
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/preferences.ts
  • mobile/src/terminal/TerminalWebView.tsx
  • mobile/src/terminal/terminal-dir-listing-size-dim-injected.ts
  • mobile/src/terminal/terminal-dir-listing-size-dim.test.ts
  • mobile/src/terminal/terminal-dir-listing-size-dim.ts
  • mobile/src/terminal/terminal-webview-html.ts
  • mobile/src/terminal/terminal-webview-messages.ts

Comment thread mobile/src/terminal/terminal-dir-listing-size-dim-injected.ts
Comment thread mobile/src/terminal/terminal-dir-listing-size-dim-injected.ts Outdated
Comment thread mobile/src/terminal/TerminalWebView.tsx
Dispose linked IMarkers with decorations, tint overlays from
terminalTheme.background (and refresh after set-theme), and subscribe
before the initial load so a live toggle cannot be overridden by a
stale AsyncStorage read.
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (23a839b96)

Address CodeRabbit: dispose IMarkers with decorations, tint size-dim overlays from terminalTheme.background (+ refresh on set-theme), subscribe before initial load so a live toggle cannot be overridden by a stale AsyncStorage read.

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@AmethystLiang
AmethystLiang requested a review from OrcaWin August 7, 2026 16:50
@nwparker nwparker removed the P1 label Aug 19, 2026

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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile: optional toggle to de-emphasize file-size tokens in agent directory listings

4 participants