Skip to content

Back/forward buttons and trackpad swipe between threads, an opt-in usage limits strip, and double-click to select inline code - #1756

Merged
currentbits merged 8 commits into
mainfrom
feat/nav-swipe-usage-strip
Oct 30, 2026
Merged

currentbits merged 8 commits into
mainfrom
feat/nav-swipe-usage-strip

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Three small quality-of-life changes for moving around threads and keeping an eye on limits.

Back and forward buttons, plus trackpad swipe (#1752)

  • Back and forward arrows now sit in the sidebar header, next to Hide sidebar. Each is disabled when there's nowhere to go, and the tooltips show the existing ⌘[ / ⌘] shortcuts.
  • A two-finger horizontal swipe over the thread pane goes back (swipe right) or forward (swipe left) once it passes 120px. A swipe commits once per gesture. Code blocks, diffs and anything else that scrolls sideways keep their own horizontal scroll.
  • Both reuse the thread history already on main, so there's no second history.

Usage limits strip (#1755), opt-in

  • Settings → General → Display → "Show usage limits in thread". It's off by default.
  • When it's on, a quiet strip above the composer shows one row per limit window the thread's provider reports (5-hour, weekly…) plus Context. Each row has a 3px bar and "N% left". At 20% left or less it turns amber, and at 10% or less red. Hover a row for its reset time.
  • If the provider can't report limits, it shows one "Limits · Unavailable" row with the reason on hover. A window without a reading is left out rather than drawn as "0% left".
  • It reuses the quota dialog's loader. Each load reads the keychain and calls the provider usage services uncached, so the strip refetches when a run starts or ends and otherwise every 5 minutes.

Double-click selects a whole inline code span (#1754)

  • Double-clicking migration-gate in chat now selects all of it, not just "migration". Drag, single click and triple click are unchanged.

Checks

  • npm run typecheck: clean
  • npm run test:renderer: 3304 pass, 0 fail
  • npx vite build: succeeds

Closes #1752, closes #1754, closes #1755.

🤖 Generated with Claude Code

Willem and others added 8 commits October 30, 2026 12:24
Word selection stops at - and /, so double-clicking `migration-gate`
selected only "migration". The inline code element now selects all its
children on dblclick; drag, single and triple click are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1755)

Settings -> Display gets "Show usage limits in thread" (off by default,
same localStorage uiPrefs pattern as the other Display toggles). When on,
a quiet strip above the composer shows one row per limit window the
thread's provider reports plus a Context row, each read as percent LEFT
so a longer bar means more room. Rows turn amber at 20% left or less and
red at 10% or less; a provider that can't report limits collapses to a
single "Limits · Unavailable" row with its message as the tooltip.

Reuses the quota dialog's own loader and QUOTA_CLOCK_MS cadence (no new
polling) and the header's already-computed context ring, so there is no
new backend work.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Back/forward sidebar buttons need to know up front whether a step would
land anywhere, without actually stepping. canStep wraps stepThread's
existing lookup so App can disable them correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
accumulateSwipe turns a run of wheel events into a single back/forward
commit past a 120px threshold, resetting after a 150ms gap so one
gesture only ever fires once. hasHorizontalScrollAncestor lets the
caller skip swipes starting inside a horizontally scrolling element
(code blocks, diff panes) so they keep their own scroll.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reuses the existing goHistory/stepThread stack (#1506) that already
backs the keyboard shortcuts and mouse side buttons:

- Sidebar header gets Back/Forward icon buttons next to the collapse
  button, each disabled with nowhere to go, tooltips showing the
  matching chord ("Back (⌘[)" / "Forward (⌘])").
- canGoBack/canGoForward are recomputed off a tick counter bumped
  whenever the history ref moves, since the stack itself intentionally
  stays out of React state.
- A two-finger horizontal wheel swipe over the thread pane commits one
  step past a 120px threshold (src/swipeNav.ts), skipped over anything
  that scrolls horizontally itself (code blocks, diffs).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ithout a reading (#1755)

Each providerLimits call reads keychains and hits every provider's usage
API uncached; the dialog's 30s clock only ticks its countdowns. A window
with a NaN usedPercent no longer draws as a red 0% left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1752)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T14:04:23.257336Z e940e59 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e940e59f13

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{showUsageLimitsStrip ? (
<UsageLimitsStrip
loadLimits={loadProviderLimits}
activeProvider={thread.provider}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Select usage limits with the full provider instance reference

For a thread using a named provider instance, such as claude:work, this passes only claude, so the strip displays the default account's limits instead of the account running the thread. electron/providerUsage.js returns named-instance usage under inst.ref, and UsageLimitsStrip selects its row by exact provider equality. Pass threadProviderRef(thread) here so users with separate provider logins see the correct account's remaining quota.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit 51818ab into main Oct 30, 2026
11 of 12 checks passed
@currentbits
currentbits deleted the feat/nav-swipe-usage-strip branch October 30, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant