mirror of
https://github.com/stablyai/orca.git
synced 2026-10-13 00:02:54 +00:00
chore(focus-pane-helper): tighten paneKey parsing and update stale comment
- WorktreeCardAgents: only accept positive-integer paneId tails (rejects empty / non-numeric / zero), via /^\d+$/ pre-test - ManageSessionsSection: rename stale `setActiveTab` reference in a comment Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -184,7 +184,7 @@ export function ManageSessionsSection(): React.JSX.Element {
|
||||
if (worktreeId) {
|
||||
// Why: match SessionsStatusSegment — route through the shared
|
||||
// activation path before switching tab so the worktree container
|
||||
// is mounted by the time setActiveTab runs.
|
||||
// is mounted by the time activateTabAndFocusPane runs.
|
||||
activateAndRevealWorktree(worktreeId)
|
||||
}
|
||||
setActiveView('terminal')
|
||||
|
||||
@@ -88,13 +88,15 @@ const WorktreeCardAgentsBody = React.memo(function WorktreeCardAgentsBody({
|
||||
(tabId: string, paneKey: string) => {
|
||||
acknowledgeAgents([paneKey])
|
||||
const colon = paneKey.indexOf(':')
|
||||
const parsed = colon === -1 ? NaN : Number(paneKey.slice(colon + 1))
|
||||
const tail = colon > 0 ? paneKey.slice(colon + 1) : ''
|
||||
const parsed = /^\d+$/.test(tail) ? Number.parseInt(tail, 10) : NaN
|
||||
let paneId: number | null = null
|
||||
if (Number.isFinite(parsed)) {
|
||||
if (Number.isFinite(parsed) && parsed > 0) {
|
||||
paneId = parsed
|
||||
} else {
|
||||
// Why: paneKey for sidebar agent rows is always ${tabId}:${paneId};
|
||||
// a non-numeric tail means upstream row construction drifted.
|
||||
// Why: paneKey for sidebar agent rows is always ${tabId}:${paneId}
|
||||
// with a positive integer paneId; anything else (empty, zero,
|
||||
// non-numeric) means upstream row construction drifted.
|
||||
console.warn('[WorktreeCardAgents] malformed paneKey, skipping pane focus', paneKey)
|
||||
}
|
||||
// Why: route through activateAndRevealWorktree so cross-repo clicks also
|
||||
|
||||
Reference in New Issue
Block a user