Skip to content

fix(mobile): honour the desktop pinned-worktree placement setting - #25301

Merged
Jinwoo-H merged 9 commits into
mainfrom
mobile-pinned-display-policy
Oct 5, 2026
Merged

Jinwoo-H merged 9 commits into
mainfrom
mobile-pinned-display-policy

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​316 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​301
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115 $\color{#cf222e}{\Huge{\mathbf{−}}}$​33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​82

What

On desktop a pinned workspace shows only in the Pinned section unless Settings → Appearance → Window & Sidebar → "Also show pinned worktrees in their original lists" is on (off by default, #6216). Mobile showed every pinned workspace twice: in Pinned and again in its project group. Mobile now follows the desktop setting.

Cause. workspace-list-sections.ts always kept pinned rows in their groups, with a comment from #6786 saying desktop treats Pinned as an overlay. Desktop changed a week later and mobile never read the key.

Fix. No wire change and no desktop change: settings.get, which mobile already calls, carries showPinnedWorktreesInGroups. One boolean read operation in settings-read-operations.ts, on the same template as the terminal copy setting; an absent key reads as the desktop default, off. The value is host-screen state like the screen's other per-host values: the worktree catalog reads it beside the existing view-settings sync on connect, focus and mount, behind the same current-client check as the catalog fetch, and useHostScreenIdentity resets it with the rest when the screen is reused for another host. The view-settings sync and its goldens are untouched. buildSections takes showPinnedInGroups: when off, pinned rows leave their groups, host pins and device-local pins alike, and a repo whose worktrees are all pinned drops its group, as on desktop.

Lineage follows the pin, as on desktop. Descendants of a pinned workspace move into Pinned nested under it, walking the same children index the lineage renderer uses, so the edge rule lives once. Like desktop's getPinnedSectionWorktrees, the walk crosses rows hidden by search or filters, so a visible grandchild still follows a pinned root when the middle row is hidden; only visible rows are placed.

Native and the page share this code, so native users get it with the next app release and OTA users with the next desktop daily.

Tests (red first)

  • workspace-list-sections.test.ts: with the setting off, a host-pinned and a local-pinned workspace are in Pinned and absent from their group in every group mode; with it on, in both places (today's behaviour). Red: expected [ 'pinned', 'repo:repo-1' ] to deeply equal [ 'pinned' ].
  • workspace-list-pinned-lineage.test.ts: an unpinned child of a pinned parent nests under it in Pinned at depth 1 and leaves the group (red showed it as a depth-0 root in repo:orca); a grandchild whose middle parent is hidden by search still lands in Pinned, as in desktop's "keeps a visible grandchild when the middle parent is absent" test (red: it stayed in repo:orca).
  • settings-read-operations.test.ts: absent, false, non-boolean and null settings read off; true reads on; a refusal is not accepted.
  • host-show-pinned-in-groups.test.ts: the catalog refresh issues one settings.get and applies the value, absent reading as off; a reply landing after the screen's client moved on is dropped; reusing the screen for another host resets the value to off.

No goldens change.

Mobile always kept pinned rows in their groups as well as in Pinned. Desktop's
showPinnedWorktreesInGroups (default off) shows them only in Pinned. Read that
setting with its own settings.get operation, refreshed with the list's view
settings, and leave host and device-local pins out of their groups unless it
is on.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Under single-location a pinned parent left its group while its unpinned child
stayed behind as a root. Visible descendants now follow a pinned ancestor into
Pinned, nested under it, as on desktop. Drop the inert host-id half of the
pinned-policy stale-reply guard; a host switch replaces the client.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…s sync

One "sync from desktop" callback now also reads settings.get for pinned
placement, unawaited so a slow read never holds the ui.get merge; the separate
callback and its plumbing are gone. Re-record the three host.view-settings
goldens, which gain only that settings.get send. The pin expansion walks the
lineage children index the renderer now shares, over visible rows only.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…sync

Both reads in syncViewSettingsFromDesktop now drop a reply only when the client
was replaced; the host-id half compared a captured value with itself. Pin the
no-wait invariant: the ui.get merge applies while settings.get never answers.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The host screen now reads and stores the host’s pinned-worktree grouping setting, then passes it to workspace section construction. Pinned worktrees and their lineage descendants appear in the Pinned section. By default, those rows are excluded from canonical groups; the setting can include them in both. The change also adds a helper to build lineage child lists and tests for settings reads, host refresh behavior, grouping modes, and pinned-worktree lineage.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to aee0c

Pinned worktrees can briefly appear in the wrong groups, remain in an outdated placement after returning to the app, or lose their nesting under search. The change is mergeable with these known display issues accepted or scheduled for follow-up.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description gives a detailed explanation of the problem, implementation, and tests. It omits required template information: a linked issue and visual proof for this behavior change. Add the linked issue, or clarify that the maintainer exception applies. Include before-and-after visual proof, or state N/A with a reason if there is no visual or interaction change. Complete the testing section with the verification perfor…
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: mobile now honors the desktop pinned-worktree placement setting.
Full details: Description check

Resolution

Add the linked issue, or clarify that the maintainer exception applies. Include before-and-after visual proof, or state N/A with a reason if there is no visual or interaction change. Complete the testing section with the verification performed and platforms tested.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Re-reviewed the whole PR end to end (no prior pullfrog review existed), scoped below to what changed since the previous head ba4c7335 → b805b63:

  • Dead stale-reply check removed — syncViewSettingsFromDesktop no longer compares hostId to a copy of itself; the clientRef.current !== requestClient check is now the only stale guard, and hostId drops out of the callback deps. A host switch swaps the shared per-host client (useHostClient(hostId)), so this is behavior-neutral.
  • No-wait invariant pinned — a new case in host-pinned-display-policy-sync.test.ts asserts the ui.get merge still applies while the settings.get placement read never resolves, guarding against reintroducing an await that would hold the view-settings merge.
  • Local rename — pending → queue in getPinnedSectionIdentities; no behavior change.

The three touched mobile suites pass (70/70).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Desktop's Pinned section walks lineage over every worktree and keeps the
visible descendants, so a grandchild still follows a pinned root when search
hides the middle row. Mobile walked visible rows only and left it in its group.
Build the children index from the unfiltered list; membership stays visible-only.
Drop the hostId arg the view-settings sync no longer reads. Pinned-lineage
tests move to their own file to stay under max-lines.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Incremental delta b805b63 → d124c79:

  • Pins now cross search/filter-hidden rows — getPinnedSectionIdentities builds the lineage children index over the full row set and seeds the walk from visible pinned rows, so a visible grandchild follows a pinned root into Pinned even when the middle row is filtered out. Matches desktop's getPinnedSectionWorktrees membership semantics; I confirmed desktop's row-nesting index is also built from the visible list only, so the hidden-middle grandchild renders at depth 0 on both platforms.
  • Dead hostId argument removed — useHostViewSettings no longer takes hostId, now that the prior commit removed its only use; the controller, recorder adapter and sync test were updated in step.
  • Placement test matrix widened — a new describe.each over none/repo/workspaceStatus/prStatus covers host and device-local pins under both policies, and the lineage cases moved into workspace-list-pinned-lineage.test.ts with the new hidden-middle-search case.

Mobile typecheck and lint are clean; the three touched suites pass (51/51).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Reject pinned-policy replies after a host switch. · use-host-view-settings.ts:92-112

mobile/src/host-screen/use-host-view-settings.ts:92-112
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject pinned-policy replies after a host switch.

When the host screen is reused for another hostId, clientRef.current can still hold the old client until useHostScreenIdentity updates it in an effect. If the old host’s settings.get reply resolves first, this check can apply its pinned-placement policy to the new host’s list. The policy controls whether pinned workspaces appear in their groups. Compare the reply’s captured host ID with the current host ID.

Suggested fix
diff --git a/mobile/src/host-screen/use-host-view-settings.ts b/mobile/src/host-screen/use-host-view-settings.ts
--- a/mobile/src/host-screen/use-host-view-settings.ts
+++ b/mobile/src/host-screen/use-host-view-settings.ts
@@
-import { useCallback, useEffect, useMemo } from 'react'
+import { useCallback, useEffect, useMemo, useRef } from 'react'
@@
   client: RpcClient | null
   connState: ConnectionState
+  hostId: string | undefined
   state: HostScreenState
 }) {
-  const { client, connState, state } = args
+  const { client, connState, hostId, state } = args
+  const hostIdRef = useRef(hostId)
+  hostIdRef.current = hostId
@@
     }
     const requestClient = client
+    const requestHostId = hostId
     const viewReply = hostViewSettingsRead.request(requestClient)
@@
-        if (clientRef.current === requestClient && policy.accepted) {
+        if (
+          clientRef.current === requestClient &&
+          hostIdRef.current === requestHostId &&
+          policy.accepted
+        ) {
@@
-  }, [client, connState, applyViewState])
+  }, [client, connState, hostId, applyViewState])
diff --git a/mobile/src/host-screen/use-host-screen-controller.ts b/mobile/src/host-screen/use-host-screen-controller.ts
--- a/mobile/src/host-screen/use-host-screen-controller.ts
+++ b/mobile/src/host-screen/use-host-screen-controller.ts
@@
-  const settings = useHostViewSettings({ client, connState, state })
+  const settings = useHostViewSettings({ client, connState, hostId, state })

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ff6f273-8ffa-465e-b81a-df21c7d441fe
📥 Commits

Reviewing files that changed from the base of the PR and between b805b63 and d124c79.

📒 Files selected for processing (7)
  • mobile/src/host-screen/host-pinned-display-policy-sync.test.ts
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/host-screen/use-host-view-settings.ts
  • mobile/src/test-support/rpc-recording/adapters/host-screen-mount-adapters.ts
  • mobile/src/worktree/workspace-list-pinned-lineage.test.ts
  • mobile/src/worktree/workspace-list-sections.test.ts
  • mobile/src/worktree/workspace-list-sections.ts
💤 Files with no reviewable changes (3)
  • mobile/src/test-support/rpc-recording/adapters/host-screen-mount-adapters.ts
  • mobile/src/host-screen/use-host-view-settings.ts
  • mobile/src/worktree/workspace-list-sections.test.ts

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

The placement read was folded into the desktop view-settings sync, so that
callback juggled an awaited and an unawaited read and three goldens recorded a
settings.get that never answers. useHostShowPinnedInGroups now owns the setting
and the catalog refreshes it beside the view-settings sync on connect, focus and
mount; the sync, screen state and goldens are back to main.

The reader returns desktop's boolean, as its siblings do, so transport no longer
imports a worktree type and the two-literal policy union is gone. makeSection
always applies lineage, the pinned walk is a Set worklist, and the lineage
children index drops a set that duplicated its map's keys.

@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: 4


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3dce15fe-1582-426b-abba-8edc7a650a1d
📥 Commits

Reviewing files that changed from the base of the PR and between d124c79 and 79c2bc0.

📒 Files selected for processing (12)
  • mobile/src/host-screen/host-worktree-catalog-action-error.test.ts
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/host-screen/use-host-show-pinned-in-groups.test.ts
  • mobile/src/host-screen/use-host-show-pinned-in-groups.ts
  • mobile/src/host-screen/use-host-worktree-catalog.ts
  • mobile/src/transport/settings-read-operations.test.ts
  • mobile/src/transport/settings-read-operations.ts
  • mobile/src/worktree/mobile-workspace-lineage.ts
  • mobile/src/worktree/use-workspace-sections.ts
  • mobile/src/worktree/workspace-list-pinned-lineage.test.ts
  • mobile/src/worktree/workspace-list-sections.test.ts
  • mobile/src/worktree/workspace-list-sections.ts
💤 Files with no reviewable changes (1)
  • mobile/src/worktree/mobile-workspace-lineage.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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Re-reviewed the delta since the prior pullfrog review (d124c79 → 79c2bc0, the single commit refactor(mobile): read pinned placement in its own hook):

  • Pinned placement read moved into its own hook — useHostShowPinnedInGroups now owns both the boolean and the settings.get read; useHostViewSettings no longer carries it, so the view-settings merge can't be held by a slow placement read by construction. useHostWorktreeCatalog fires it unawaited beside the existing sync on connect/focus/mount.
  • Policy type collapsed to a boolean — the PinnedDisplayPolicy string union is replaced by showPinnedInGroups across buildSections, useWorkspaceSections, the controller and state; the type is deleted from workspace-list-types.ts.
  • Lineage children simplified — getMobileWorkspaceLineageChildren drops its redundant visibleIds guard (the worktreeById lookup already rejects an absent parent), and getPinnedSectionIdentities walks descendants with live Set iteration instead of a mutable worklist queue.
  • makeSection always nests lineage — parameter order becomes (key, title, data, collapsedGroups, icon?); the Pinned section now runs applyMobileWorkspaceLineage like every other section.
  • Goldens reverted, tests split — because the extra settings.get no longer rides the view-settings sync, the three view-settings goldens return to base and the deleted host-pinned-display-policy-sync.test.ts is replaced by a focused use-host-show-pinned-in-groups.test.ts.

Verified locally: the six touched mobile suites pass (75/75), the full RPC-recording golden suite passes (799/799), and mobile tsc --noEmit and oxlint are clean.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

The host screen is reused across hosts, so the previous host's "show in groups"
value survived a switch until the new read landed, or for good if it failed.
The setting now carries the client that reported it and counts only for that
client, which also makes a late reply from a replaced client inert and drops
the clientRef plumbing.

@pullfrog pullfrog 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.

Important

The stale-reply keying added in this commit has an ordering hole: a superseded client's late reply overwrites the current client's already-applied placement, reverting the list to the default until the next focus/connect.

Reviewed changes

Re-reviewed the incremental delta 79c2bc0 → 0dea271 (the single commit fix(mobile): key pinned placement to the client that reported it):

  • Placement value keyed to the reporting client — useHostShowPinnedInGroups drops its clientRef argument and stores { client, show } in state, exposing the value only while the stored client is the current one; the controller call site no longer passes state.clientRef.
  • Hook tests rebuilt around a mount/switch harness — the clientRef-injection tests are replaced by a mountHook/switchTo harness, adding cases that the prior host's value is dropped on client change and that a reply landing after the change is ignored.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Keying the value to its client hid a previous host's value but still let that
host's late reply overwrite the current host's, reverting the list to the
default until the next refresh. Restore the clientRef write guard; the client
key still covers the effect-long window before clientRef follows a switch.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Re-reviewed the incremental delta 0dea271 → 396258c (the single commit fix(mobile): drop a replaced client's late placement reply), which closes the stale-write hole raised in the prior review:

  • Late reply from a replaced client is dropped — useHostShowPinnedInGroups takes the screen's clientRef again and, after awaiting settings.get, returns without writing when the captured client is no longer current; the controller passes state.clientRef back into the hook. clientRef is set by useHostScreenIdentity's effect, which runs before the catalog's effects fire the sync, so the guard does not drop a current client's reply.
  • Regression test added — a new case syncs the current client's true first, then resolves the previous host's pending false reply, asserting the current value survives; the earlier "ignores a reply that lands after the client changed" case still covers the reverse order.

Verified locally: the touched mobile suites pass (6/6).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

… state

The placement hook kept its own host-switch handling (a client-keyed value plus
a clientRef guard) beside the screen's existing one. showPinnedInGroups now
lives in HostScreenState, resets with the other host-scoped values in
useHostScreenIdentity, and is read in the catalog refresh behind the same
clientRef check as the catalog fetch. The hook and the catalog argument go.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Re-reviewed the delta since the prior pullfrog review (396258c → aee0c09, the single commit refactor(mobile): treat pinned placement like the screen's other host state). The refactor is behavior-preserving:

  • Hook folded into host-screen state — the dedicated useHostShowPinnedInGroups hook is deleted; showPinnedInGroups becomes a plain boolean in useHostScreenState beside the screen's other per-host values, and useHostScreenIdentity resets it to false with the rest when the screen is reused for another host.
  • Placement read moved into the catalog — syncShowPinnedInGroups(requestClient) now lives in useHostWorktreeCatalog and is fired unawaited from startWorktreeRefresh next to the existing view-settings sync. The post-await clientRef.current !== requestClient guard that closed the 0dea271 stale-write hole is preserved verbatim.
  • Controller wiring simplified — useWorkspaceSections now receives state.showPinnedInGroups directly instead of a hook result.
  • Test rebuilt around the production hooks — use-host-show-pinned-in-groups.test.ts is renamed to host-show-pinned-in-groups.test.ts and now mounts the catalog (for the read + stale-reply guard) and the identity hook (for the reset), keeping exact-value assertions.

The removed read-time setting?.client === client filter is subsumed by the write-time guard plus the explicit identity reset: on a hostId change the identity effect resets to false before the new client's sync applies, and worktrees reset in that same effect, so no frame renders new worktrees under the old policy. On a same-host reconnect the last known placement now survives until the new read instead of briefly reverting to the default, which is at least as correct.

Verified locally: the four touched mobile suites pass (71/71), the full src/host-screen suite passes (34/34), the host-mount RPC goldens pass (7/7), and mobile tsc --noEmit and oxlint are clean.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@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: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a23b93a5-40b8-4463-802b-f506c4d585e2
📥 Commits

Reviewing files that changed from the base of the PR and between 0dea271 and aee0c09.

📒 Files selected for processing (5)
  • mobile/src/host-screen/host-show-pinned-in-groups.test.ts
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/host-screen/use-host-screen-identity.ts
  • mobile/src/host-screen/use-host-screen-state.ts
  • mobile/src/host-screen/use-host-worktree-catalog.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.

@Jinwoo-H

Jinwoo-H commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai on the outside-diff note about pinned-policy replies after a host switch (use-host-view-settings.ts): that read no longer lives in useHostViewSettings, which is back to main's shape. Since aee0c09 the placement is host-screen state: useHostScreenIdentity resets it when the screen is reused for another host, and the catalog refresh writes it only while the reply's client is still clientRef.current. host-show-pinned-in-groups.test.ts covers both.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd 'use-host-view-settings\.ts|use-host-screen-identity\.ts|use-host-worktree-catalog\.ts|host-show-pinned-in-groups\.test\.ts|use-host-screen-state\.ts|use-host-screen-controller\.ts' mobile
for f in $(fd 'use-host-view-settings\.ts|use-host-screen-identity\.ts|use-host-worktree-catalog\.ts|host-show-pinned-in-groups\.test\.ts|use-host-screen-state\.ts|use-host-screen-controller\.ts' mobile); do
 echo "===== $f ====="
 ast-grep outline "$f" --items all
done

Length of output: 7605


🏁 Script executed:

#!/bin/bash
set -euo pipefail
for name in use-host-view-settings.ts use-host-screen-identity.ts use-host-worktree-catalog.ts host-show-pinned-in-groups.test.ts use-host-screen-state.ts; do
 f=$(fd -F "$name" mobile | head -1)
 echo "===== $f ====="
 if [ -n "$f" ]; then nl -ba "$f" | sed -n '1,260p'; fi
done

Length of output: 36528


🏁 Script executed:

#!/bin/bash
set -euo pipefail
files=$(fd 'use-host-view-settings\.ts|use-host-screen-identity\.ts|use-host-worktree-catalog\.ts|host-show-pinned-in-groups\.test\.ts|use-host-screen-state\.ts' mobile)
for f in $files; do
  echo "===== $f ====="
  ast-grep outline "$f" --items all | head -100
  nl -ba "$f" | sed -n '1,250p'
done

Length of output: 40983


@Jinwoo-H, thanks for the clarification. I checked the current code. useHostViewSettings no longer reads the pinned-placement setting. useHostScreenIdentity resets showPinnedInGroups when hostId changes. useHostWorktreeCatalog ignores a placement reply if its client is no longer clientRef.current. host-show-pinned-in-groups.test.ts covers the reset and stale-client reply.

My outside-diff concern no longer applies. I withdraw it.


✏️ Learnings added
Learnt from: Jinwoo-H
URL: https://github.com/stablyai/orca/pull/25301

Timestamp: 2026-10-05T02:37:00.107Z
Learning: In the mobile host screen, `showPinnedInGroups` is host-screen state, not part of `useHostViewSettings`. `mobile/src/host-screen/use-host-screen-identity.ts` resets it to false when `hostId` changes. `mobile/src/host-screen/use-host-worktree-catalog.ts` reads `showPinnedWorktreesInGroups` during catalog refresh and ignores replies when the request client is no longer `clientRef.current`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant