Skip to content

fix(ui): preserve controls during remote refresh - #121

Merged
RestartFU merged 5 commits into
masterfrom
xd/when-opening-the-worktree-dropdown-in-the-lunar-16b317c5
Jul 28, 2026
Merged

fix(ui): preserve controls during remote refresh#121
RestartFU merged 5 commits into
masterfrom
xd/when-opening-the-worktree-dropdown-in-the-lunar-16b317c5

Conversation

@RestartFU

@RestartFU RestartFU commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • cap option-picker popovers and scroll long lists so repositories with many worktrees fit on screen
  • keep active sidebar selection through transient remove-and-reinsert reconciliation
  • skip duplicate chat opens so background tree updates cannot steal focus from popovers or inline editors
  • update picker choices in place instead of replacing every GTK row
  • preserve client-only new-chat and new-folder editor rows during daemon tree reconciliation

Testing

  • ./scripts/test.sh — 20/20 test suites passed
  • remote suite — 26 subtests passed, including refreshes with active client placeholders
  • verified Lunar exposes 30 worktrees, covering the long-picker failure condition

Update choice rows in place so metadata refreshes do not dismiss an open popover.

Co-authored-by: Codex <codex@openai.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@RestartFU, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 406c7ba6-9a17-41b5-a5ba-9464a2100aaf

📥 Commits

Reviewing files that changed from the base of the PR and between d079891 and 3335358.

📒 Files selected for processing (5)
  • src/chat/option-picker.c
  • src/remote/remote-tree.c
  • src/tree/sidebar.c
  • src/xd-window.c
  • tests/test-remote.c
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch xd/when-opening-the-worktree-dropdown-in-the-lunar-16b317c5

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.

Keep client-only placeholder rows during daemon tree reconciliation so refreshes cannot discard active new-chat or new-folder input.

Co-authored-by: Codex <codex@openai.com>
@RestartFU RestartFU changed the title fix(chat): keep worktree picker open fix(ui): preserve controls during remote refresh Jul 28, 2026
RestartFU and others added 3 commits July 28, 2026 09:38
Keep the active node through remove-and-reinsert reconciliation and skip duplicate selection opens so background tree updates cannot steal focus.

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Cap popover height so repositories with many worktrees fit on screen instead of producing an oversized popup that is immediately dismissed.

Co-authored-by: Codex <codex@openai.com>
@RestartFU
RestartFU merged commit 50ec2e7 into master Jul 28, 2026
4 checks passed

@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: 3335358ceb

ℹ️ 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".

Comment thread src/remote/remote-tree.c
Comment on lines +95 to +97
if (is_client_placeholder (node))
g_ptr_array_insert (target, MIN (i, target->len),
g_steal_pointer (&node));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reconcile daemon rows without relocating placeholders

When a daemon snapshot adds, removes, or reorders a folder before an inline new-chat row, inserting the placeholder into target at its pre-refresh absolute index does not keep the row alive. Reconciliation first moves the changed daemon row, shifting the placeholder, and then the generic loop removes and reinserts the placeholder to restore this target index; GTK consequently unbinds the active editor, which can commit it through on_editor_focus_left() or discard its focus before the user submits or cancels. Preserve placeholders independently of daemon-row movement rather than assigning them an absolute target index.

Useful? React with 👍 / 👎.

Comment thread src/tree/sidebar.c
Comment on lines +1729 to 1730
if (node == NULL || node == self->selected)
return;

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 Distinguish explicit unselection from reconciliation gaps

When the user explicitly clears the current selection, which is supported because this model enables can_unselect, this return leaves self->selected pointing at the old node. Reselecting that same row is then also suppressed by the identity check, so no node-selected signal is emitted and the pending restore_chat_id is not cleared; if a saved remote chat finishes loading afterward, restoration can unexpectedly replace the user's renewed selection. Ignore only the transient deselection caused by reconciliation, while recording genuine unselection.

Useful? React with 👍 / 👎.

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