Repository navigation
fix(mobile): phone terminal and chat tab names match the desktop - #31384
Conversation
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
497d1b00-3c20-43ba-b3b3-6229a0863568
📒 Files selected for processing: 12
src/main/runtime/mobile-session-terminal-projection.tssrc/main/runtime/orca-runtime-desktop-tab-names.test.tssrc/main/runtime/orca-runtime-hook-agent-status-projection.test.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.tssrc/main/runtime/runtime-mobile-agent-status-builder.tssrc/main/runtime/runtime-mobile-session-projection.tssrc/main/runtime/session-lifecycle/projection/prune-mobile-session-tab-group-layout.tssrc/main/runtime/session-tabs/mobile-session-hydration.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-terminal-tabs.tssrc/shared/runtime-mobile-session-tab-contracts.tssrc/shared/tab-title-resolution.tssrc/shared/workspace-layout/old-client/old-client-session-tabs-projection.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
| ...(tabWide && generatedTitlesEnabled && tab.generatedTitle?.trim() | ||
| ? { generatedTitle: tab.generatedTitle.trim() } | ||
| : {}), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Apply the generated-title setting to the fallback title.
If a saved tab has generatedTitle and tabAutoGenerateTitle is off, this condition omits the metadata. Line 65 still places the generated name in title. The runtime resolver then displays that name on the phone despite the disabled setting. Apply generatedTitlesEnabled when selecting the initial title as well. The PR objective requires generated names to respect this setting.
389bb5c to
f3c934d
Compare
f3c934d to
f0d08ce
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
deddc7f2-b3a7-4976-ae64-fe9e9522749f
📒 Files selected for processing: 1
src/main/runtime/mobile-session-terminal-projection.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| generatedTitlesEnabled, | ||
| fallbackTitle | ||
| ) | ||
| : tab.customTitle?.trim() || liveTitle || fallbackTitle |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,180p' src/main/runtime/mobile-session-terminal-projection.ts
sed -n '1,220p' src/shared/runtime-mobile-session-tab-contracts.ts
sed -n '1,180p' src/shared/tab-title-resolution.ts
rg -n -C 5 "customTitle|titlesByLeafId|resolveTerminalTabTitle|generatedTitle" src/main src/renderer/src src/sharedRepository: stablyai/orca
Length of output: 45664
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- targeted references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' \
-e 'RuntimeMobileSessionTerminalTab' \
-e 'resolveTerminalTabTitle' \
-e 'customTitle' \
-e 'titlesByLeafId' \
-e 'parentTabId' \
src/main/runtime src/shared src/renderer/src 2>/dev/null | \
rg -n 'mobile|Mobile|runtime|Runtime|terminal|Terminal|customTitle|titlesByLeafId|parentTabId|resolveTerminalTabTitle' | \
head -n 1200 || true
printf '%s\n' '--- likely mobile files ---'
rg --files src/main src/shared src/renderer/src | rg -i 'mobile|runtime.*tab|session.*tab|terminal.*tab' | head -n 300Repository: stablyai/orca
Length of output: 42885
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- exact resolver references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' 'resolveTerminalTabTitle' \
src/main/runtime src/renderer/src/runtime src/renderer/src/hooks src/shared || true
printf '%s\n' '--- mobile terminal projection files ---'
sed -n '1,260p' src/main/runtime/runtime-mobile-session-projection.ts
sed -n '1,260p' src/renderer/src/runtime/sync-runtime-graph/mobile-session-terminal-tabs.ts
sed -n '1,220p' src/main/runtime/mobile-session-tab-merge.tsRepository: stablyai/orca
Length of output: 30012
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- headless builder callers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' 'buildHeadlessMobileSessionTerminalTabs' src/main src/shared src/renderer || true
printf '%s\n' '--- mobile runtime projector callers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' 'projectRuntimeMobileSessionTabs' src/main src/shared src/renderer || true
printf '%s\n' '--- exact main resolver block ---'
nl -ba src/main/runtime/runtime-mobile-session-projection.ts | sed -n '175,215p'
printf '%s\n' '--- resolver contract ---'
nl -ba src/shared/tab-title-resolution.ts | sed -n '1,35p'
printf '%s\n' '--- focused renderer title projection ---'
nl -ba src/renderer/src/runtime/sync-runtime-graph/sync-projections.ts | sed -n '1,70p'
nl -ba src/renderer/src/runtime/sync-runtime-graph/mobile-session-terminal-tabs.ts | sed -n '65,135p'Repository: stablyai/orca
Length of output: 13031
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- headless hydration path ---'
nl -ba src/main/runtime/session-tabs/mobile-session-hydration.ts | sed -n '175,245p'
printf '%s\n' '--- runtime projector caller ---'
nl -ba src/main/runtime/session-lifecycle/projection/prune-mobile-session-tab-group-layout.ts | sed -n '70,120p'
printf '%s\n' '--- projector imports and snapshot types ---'
nl -ba src/main/runtime/session-lifecycle/projection/prune-mobile-session-tab-group-layout.ts | sed -n '1,75p'
rg -n -F --glob '*.ts' --glob '*.tsx' \
-e 'RuntimeMobileSessionTabsSnapshot' \
-e 'terminalTabs' \
-e 'snapshot.tabs' \
src/main/runtime/session-tabs src/main/runtime/session-lifecycle src/main/runtime | \
head -n 500 || trueRepository: stablyai/orca
Length of output: 41346
🏁 Script executed:
printf '%s\n' '--- headless split projection ---'
nl -ba src/main/runtime/mobile-session-terminal-projection.ts | sed -n '55,92p'
printf '%s\n' '--- downstream terminal result ---'
nl -ba src/main/runtime/runtime-mobile-session-projection.ts | sed -n '88,105p'
nl -ba src/main/runtime/runtime-mobile-session-projection.ts | sed -n '180,190p'
nl -ba src/main/runtime/runtime-mobile-session-projection.ts | sed -n '235,255p'
printf '%s\n' '--- hydration to projection boundary ---'
nl -ba src/main/runtime/session-tabs/mobile-session-hydration.ts | sed -n '207,235p'
nl -ba src/main/runtime/session-lifecycle/projection/prune-mobile-session-tab-group-layout.ts | sed -n '95,104p'Repository: stablyai/orca
Length of output: 7750
🏁 Script executed:
nl -ba src/main/runtime/runtime-mobile-session-projection.ts | sed -n '255,315p'Repository: stablyai/orca
Length of output: 3223
Preserve leaf titles in split tabs.
When a split tab has a custom title, use each leaf's liveTitle and omit customTitle from split rows. The downstream mobile projection otherwise passes that metadata to resolveTerminalTabTitle, which restores the tab-wide title.
🐛 Suggested fix
: resolveTerminalTabTitle(
{ ...tab, title: liveTitle },
generatedTitlesEnabled,
fallbackTitle
)
- : tab.customTitle?.trim() || liveTitle || fallbackTitle
+ : liveTitle || fallbackTitle
return [
{
type: 'terminal' as const,
id: `${tab.id}::${leafId}`,
parentTabId: tab.id,
leafId,
title,
- customTitle: tab.customTitle?.trim() || null,
+ ...(tabWide ? { customTitle: tab.customTitle?.trim() || null } : {}),
Two places where the phone showed something different from the desktop for the same tab.
Terminal tab names. The phone used the tab's live agent title every time a desktop rename wasn't set. It ignored the generated name, the saved Claude/Codex session name and the quick-command label, all of which the desktop ranks above the live title. So a Cursor tab changed name with every frame (
⠋ Cursor Agent,<task> - ⏳ Working ...), even when the desktop showed a steady name. Now the host ranks names the same way the desktop does (resolveTerminalTabTitle) and uses its own fresher live title as the input. The window snapshot, the layout-owner projection and a headless host rebuilding from its saved session all send those names for single-pane tabs. A generated name is only used while the desktop is showing generated names, including on a headless host's first rebuild from its saved session, which used to show the generated name even with the setting off. Split panes keep their own pane titles there too, as the window sends them.Chat tab names. Renaming a native chat tab on the desktop had no effect on the phone. It kept the saved conversation name or "Claude Chat". Now main reads the rename from the workspace session it already mirrors, the same source the orchestration sender name uses. It renames chat rows whenever that session is written, so the new name reaches the phone about 150ms after the desktop saves. Clearing the name brings back the saved conversation name.
Related:
orca servehost renamed from a paired desktop still isn't sent to that host, so phones paired directly to the host keep the old name. That needs a follow-up.Builds on #22865 by @innocarpe.
Verified with focused tests. Each fails on main and passes here:
⠋ Cursor Agent, and its saved title when generated names are off.Visual Proof
Hidden dev desktops (one built from main, one from this branch) with the same scratch workspace. The terminal tab runs a script that repaints Cursor's frames every second (
⠋ Cursor Agent,Fix login redirect - ⏳ Working ...). Generated tab names are on, and the tab's generated name is "Fix the login redirect bug". The Claude chat tab was renamed "Release notes" from the desktop's Change Title menu. Phone: Orca Mobile 0.0.58 (release APK) on the Android emulator.Desktop, both builds
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Phone, BEFORE (main): the tab name follows each frame.
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Phone, AFTER (this branch): the desktop's name, steady through the same frames.
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Chat tab rename. The release APK doesn't list this desktop's native chat tab, so here is the host's
session.tabs.list, the feed phones read:On main the chat row keeps the saved conversation name ("Reply with ok") while the desktop shows "Release notes".