GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(mobile): subagent timers share the visible second clock by juliusmarminge · Pull Request #25854 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 27, 2026

Copy link
Copy Markdown
Member

Problem

The mobile agents sheet and the subagent group card each ran their own 1s setInterval for elapsed labels. The agents sheet's interval kept re-rendering while its route was hidden or the app was in the background. The group card paused correctly, but it rebuilt focus and AppState gating by hand with two effects. useFileChipShare copied the connection URL into a ref through a layout effect so its useCallback handler could read it.

Change

  • ThreadAgentsSheet (useSubagentElapsed) and thread-subagent-group (SubagentElapsed) now read useVisibleSecondClock. That hook is already on main and already used by ProviderSubagentBar, the worktree setup card, the thread list and the floating working control. It subscribes to the shared secondTick only while the label is live, its route is focused and the app is active.
  • useFileChipShare returns a plain handler that closes over the current httpBaseUrl. The React Compiler memoizes it on its inputs, so it no longer needs the latest-value ref or the layout effect.

What this improves

  • Renders avoided: a running subagent row in the agents sheet no longer re-renders every second while the sheet is unfocused or the app is backgrounded.
  • Sync removed: the hand-rolled AppState listener and interval in the group card, and the ref mirror in useFileChipShare.
  • All visible elapsed labels now tick on the same second boundary instead of each on its own mount phase.
  • No bug-fix claim, so this PR adds no regression test.

Behavior changes:

  • The agents sheet's elapsed labels stop ticking while the sheet is unfocused or the app is in the background. When they resume they show the current second.
  • On mount, the first elapsed value is floored to the whole second (shared tick) rather than taken from Date.now().
  • No logging or refresh changes.

Effects

  • ThreadAgentsSheet.tsx: 1 -> 0
  • thread-subagent-group.tsx: 2 -> 0
  • useFileChipShare.ts: 2 -> 1. The unmount abort stays because it is component-lifetime cleanup.

Verification

  • vp run check:changed: format, lint, knip 1/2 and 2/2, and typecheck (mobile, scripts) all pass.
  • None of the touched files has an existing test.

Model: Claude Opus 5.5, Claude Code harness.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@juliusmarminge @claude
refactor(mobile): subagent timers share the visible second clock
77f6e97
The agents sheet and the subagent group card each ran their own 1s
interval for elapsed labels. The sheet's kept ticking while its route was
hidden or the app was backgrounded; the group card rebuilt focus and app
state gating by hand. File chip sharing mirrored the connection URL into a
ref through a layout effect.

Both elapsed labels now read useVisibleSecondClock, the shared second tick
that pauses while unfocused or backgrounded. useFileChipShare returns a
plain handler that closes over the current connection URL.

Effects: ThreadAgentsSheet 1 -> 0, thread-subagent-group 2 -> 0,
useFileChipShare 2 -> 1 (the unmount abort stays: component-lifetime
cleanup).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 27, 2026
macroscopeapp[bot]
macroscopeapp Bot approved these changes Oct 27, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 77f6e97

Macroscope's review found this PR approvable — This is a contained mobile refactor that replaces duplicated subagent intervals with the existing shared visible-second clock and simplifies file-sharing URL handling. Its runtime effects are limited to synchronized visible timers and localized callback identity/closure behavior, with no schema, deployment, security, billing, or default changes.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: effect/split-mobile-thread-leaves&#35;6b
  • File: .coderabbit.config.ts
  • Commit: 77f6e97
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Team
  • Run ID: b7fe43fe-c998-49ff-9d31-ca9317863979
Commits

Reviewing files that changed from the base of the PR and between 4cb29a5 and 77f6e97.

Files selected for processing: 3
  • apps/mobile/src/features/threads/ThreadAgentsSheet.tsx
  • apps/mobile/src/features/threads/thread-subagent-group.tsx
  • apps/mobile/src/features/threads/useFileChipShare.ts

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

Walkthrough

Two mobile subagent elapsed-time displays now use useVisibleSecondClock instead of local intervals. The file-sharing hook now uses the httpBaseUrl from the render that created its handler.

Changes: Subagent elapsed-time updates

Layer / File(s) Summary
Shared clock for elapsed time
apps/mobile/src/features/threads/ThreadAgentsSheet.tsx, apps/mobile/src/features/threads/thread-subagent-group.tsx
Both displays use useVisibleSecondClock instead of local intervals. The hook is enabled according to each display’s existing activity conditions.

File chip sharing

Layer / File(s) Summary
Render-time URL for sharing
apps/mobile/src/features/threads/useFileChipShare.ts
The share handler uses the render’s httpBaseUrl. Request guarding, abort handling, download and sharing, error reporting, and cleanup remain in the handler.

Priority: Low

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

Change: Refactor

Possibly related PRs

  • pingdotgg/t3code#24827: Changes the same mobile thread files and implements the same clock and render-time URL behavior.
  • pingdotgg/t3code#25612: Changes useVisibleSecondClock to use the shared secondTick store.
  • pingdotgg/t3code#25616: Replaces per-component intervals with shared second ticks for web running-time labels.

Suggested reviewers: macroscopeapp

Merge Risk: Minimal · up to 77f6e

The shared-clock and file-sharing changes are mergeable after normal checks; no concrete issue remains identified.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the problem, changes, behavior effects, and verification results. It does not provide the required Scope and approval information, and it omits the required UI screenshots or … Add the triaged issue or explicit maintainer approval with scope justification. Include before/after screenshots and a short recording if needed to demonstrate the elapsed-label timing behavior.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: replacing subagent timers with the shared visible second clock.
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: Description check

Explanation

The description explains the problem, changes, behavior effects, and verification results. It does not provide the required Scope and approval information, and it omits the required UI screenshots or recording for timing-related behavior.

Resolution

Add the triaged issue or explicit maintainer approval with scope justification. Include before/after screenshots and a short recording if needed to demonstrate the elapsed-label timing behavior.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge merged commit edf5a24 into main Oct 27, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge deleted the effect/split-mobile-thread-leaves#6b branch October 27, 2026 10:59
@lidge-jun lidge-jun mentioned this pull request Oct 27, 2026
perf(mobile): reduce runtime work and refresh preview URLs (chase 261028 B30) goat-si/goat#1959
Merged
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 27, 2026
@github-actions
nightly: 0.1.4-nightly.20261027.3783
9350613
## What's Changed
* refactor(mobile): subagent timers share the visible second clock by @juliusmarminge in pingdotgg/t3code#25854
* refactor(mobile): app update checks start with the app by @juliusmarminge in pingdotgg/t3code#25856
* refactor(mobile): workspace tabs, home filters and connection status derive instead of syncing by @juliusmarminge in pingdotgg/t3code#25813
* refactor(mobile): settings permission and update checks without sync effects by @juliusmarminge in pingdotgg/t3code#25895
* fix(desktop): run the packaged bundle self-check on macOS artifacts by @stbenjam in pingdotgg/t3code#25900
* fix(web): the Add ChatGPT account dialog animates closed once the account connects by @juliusmarminge in pingdotgg/t3code#25868
* refactor(web): composer clears scroll-collapse in render, not after paint by @juliusmarminge in pingdotgg/t3code#25909
* refactor(web): composer overlay re-measures from one layout effect by @juliusmarminge in pingdotgg/t3code#25915
* refactor(web): file browser records the right-click position on its own panel by @juliusmarminge in pingdotgg/t3code#25908
* refactor(web): preview element picker drops its unmount guard by @juliusmarminge in pingdotgg/t3code#25920
* fix(web): PR Code tab no longer requests the diff of a commit the PR dropped by @juliusmarminge in pingdotgg/t3code#25916
* perf(mobile): worktree setup updates commit the thread screen once by @juliusmarminge in pingdotgg/t3code#25910
* fix(desktop): a broken release opens an error window instead of hanging by @t3dotgg in pingdotgg/t3code#25903
* ci(web): releases fail when the built web app cannot boot by @t3dotgg in pingdotgg/t3code#25929
* ci(release): desktop builds that cannot open no longer publish by @t3dotgg in pingdotgg/t3code#25928
* refactor(web): file tree drag mentions use React drag handlers by @juliusmarminge in pingdotgg/t3code#25913
* refactor(mobile): git action results buzz from where they are reported by @juliusmarminge in pingdotgg/t3code#25912
* fix(mobile): the Add environment form shows only its own pairing errors by @juliusmarminge in pingdotgg/t3code#25859
* refactor(mobile): showcase capture runs as an app service, not a chain of effects by @juliusmarminge in pingdotgg/t3code#25857
* fix(server): bound hung delegated stop effects so later runs can start by @juliusmarminge in pingdotgg/t3code#25675
* feat(mobile): add One UI navigation preference on Android by @PixPMusic in pingdotgg/t3code#25758


**Full Changelog**: pingdotgg/t3code@v0.1.4-nightly.20261027.3770...v0.1.4-nightly.20261027.3783

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.4-nightly.20261027.3783
@adampeterhiggins adampeterhiggins mentioned this pull request Oct 29, 2026
chore: sync upstream through 07f7f976 adampeterhiggins/t3code#512
Merged
19 tasks done
@olafura olafura mentioned this pull request Nov 7, 2026
test(features): ledger upstream T3 Code through 9504a09f08 hal-c2/hal-c2#1189
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.