Skip to content

Fix worktree statusline and picker rendering regressions#243

Merged
Nek-12 merged 10 commits into
mainfrom
fix/worktree-statusline-patch-summary
May 12, 2026
Merged

Fix worktree statusline and picker rendering regressions#243
Nek-12 merged 10 commits into
mainfrom
fix/worktree-statusline-patch-summary

Conversation

@Nek-12

@Nek-12 Nek-12 commented May 11, 2026

Copy link
Copy Markdown
Member

Summary

  • refresh statusline git branch after worktree execution-target changes
  • render patch summaries from structured patch data instead of parsing text
  • update /status session/auth/config ordering and styling
  • keep slash/path picker highlight synced with absolute selection and viewport offset

Verification

  • ./scripts/test.sh ./cli/app
  • ./scripts/test.sh ./server/auth ./cli/app ./cli/app/internal/statuscollect ./server/authstatus ./server/runtime ./server/tools ./shared/serverapi
  • ./scripts/build.sh --output ./bin/builder

Summary by CodeRabbit

  • New Features

    • Added execution target tracking to status overlay for better workspace/branch visibility.
    • Enhanced auth display to show masked API key summaries and explicit "No Auth" status.
  • Bug Fixes

    • Fixed Git branch display to refresh correctly when switching execution targets.
    • Corrected status overlay section ordering and session information layout.
  • Improvements

    • Improved patch summary rendering with cleaner path and change count display.
    • Enhanced slash command and path reference pickers with viewport scrolling support.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8cd707b-9c61-44d8-bfc7-b183a8d7b203

📥 Commits

Reviewing files that changed from the base of the PR and between 5e0e755 and 08a979b.

📒 Files selected for processing (25)
  • cli/app/internal/status/status.go
  • cli/app/internal/status/status_test.go
  • cli/app/internal/statuscollect/auth.go
  • cli/app/internal/statuscollect/collector_test.go
  • cli/app/ui_diff_render_test.go
  • cli/app/ui_layout_rendering_status_overlay.go
  • cli/app/ui_path_reference_picker.go
  • cli/app/ui_path_reference_picker_test.go
  • cli/app/ui_slash_command_picker_test.go
  • cli/app/ui_status.go
  • cli/app/ui_status_overlay_format.go
  • cli/app/ui_status_part2_test.go
  • cli/app/ui_status_test.go
  • cli/app/ui_transcript_page_apply.go
  • cli/app/ui_worktree_commands_part2_test.go
  • cli/app/ui_worktree_commands_test.go
  • cli/tui/model.go
  • cli/tui/model_rendering_entries.go
  • cli/tui/model_rendering_tools.go
  • cli/tui/model_test.go
  • cli/tui/render_style_intents.go
  • server/auth/types.go
  • server/authstatus/service.go
  • server/authstatus/service_test.go
  • shared/clientui/runtime.go
💤 Files with no reviewable changes (1)
  • cli/tui/model.go

📝 Walkthrough

Walkthrough

This PR integrates session execution targets throughout the status pipeline, adds masked API key display, refactors the status overlay's session/config sections with improved styling, introduces structured patch summary rendering to replace regex-based token matching, and enhances picker viewport highlighting with comprehensive tests.

Changes

Session Execution Target Support

Layer / File(s) Summary
SessionExecutionTarget Helpers
shared/clientui/runtime.go
Adds NormalizeSessionExecutionTarget, SessionExecutionTargetIsZero, and SessionExecutionTargetsEqual helpers for consistent target handling and comparison.
Status Request ExecutionTarget Field
cli/app/internal/status/status.go
Request struct gains ExecutionTarget field; ExecutionTarget helper prefers explicit value over runtime-derived target.
UI Status Config Integration
cli/app/ui_status.go
uiStatusConfig adds ExecutionTarget field, propagated to uiStatusRequest; statusLineGitStartupCmd delegates to statusLineGitRefreshCmd; Git background work marked in-flight.
Execution Target Command Flow
cli/app/ui_transcript_page_apply.go
applyProjectedExecutionTarget now returns tea.Cmd, updates statusConfig when workdir changes, triggers Git refresh; session metadata and transcript recovery batched concurrently.
ExecutionTarget, Worktree, and Status Tests
cli/app/internal/status/status_test.go, cli/app/ui_worktree_commands_test.go, cli/app/ui_worktree_commands_part2_test.go, cli/app/ui_status_part2_test.go
Unit tests with stub runtime client verify explicit targets preferred over runtime; test helpers for runtime target refresh and worktree list fixtures; tests verify status line Git branch updates after worktree switch/create/delete and execution target changes; confirms stale branches not retained.

Auth Display with Masked API Keys

Layer / File(s) Summary
Masked API Key Summary
server/auth/types.go
MaskedAPIKeySummary function masks API keys to show last four characters with "API Key ..." prefix.
Auth Service and Status Collector Integration
server/authstatus/service.go, cli/app/internal/statuscollect/auth.go
authInfo and AuthInfo use MaskedAPIKeySummary; return visible "No Auth" when no recognized auth method present.
Auth Display Tests
cli/app/internal/statuscollect/collector_test.go, server/authstatus/service_test.go
Tests validate API key masking and "No Auth" visibility in service and collector layers.

Status Overlay UI Refactoring

Layer / File(s) Summary
Session Lines Helper
cli/app/ui_layout_rendering_status_overlay.go
Introduces statusOverlaySessionLines helper and typed styling (statusOverlayLineStyle) for consistent session section rendering.
Section Organization
cli/app/ui_layout_rendering_status_overlay.go
Session section uses helper-generated lines via style switch; Config section moved earlier; trailing Config block removed.
Skill Line Styling
cli/app/ui_status_overlay_format.go, cli/app/ui_layout_rendering_status_overlay.go
New statusSkillLineStyled helper centralizes skill formatting with caller-controlled generated-label styling; loaded-skill line uses styled variant.
Overlay Tests
cli/app/ui_status_test.go
Tests verify session label ordering, section ordering priority (Session/Git/Context/Auth/Config/Skills), auth rendering, and generated-skill muted styling.

Structured Patch Summary Rendering

Layer / File(s) Summary
Patch Data Structures
cli/tui/render_style_intents.go
transcriptRenderLine and transcriptLayoutLine gain PatchSummary fields; new transcriptPatchSummaryLine struct holds Path, Added, Removed.
Patch Rendering Helpers
cli/tui/model_rendering_tools.go, cli/tui/model_rendering_entries.go
Adds renderPatchSummaryContent, patchSummaryPlainLine, renderPatchSummaryLine for generating and formatting patch summaries; entry rendering propagates patch metadata.
Tool Line Simplification
cli/tui/model.go, cli/tui/model_rendering_tools.go
Removes regexp import and patchCountTokenPattern; styleToolLine removes isPatchBlock flag and regex-based token styling.
Patch Summary Tests
cli/tui/model_test.go, cli/app/ui_diff_render_test.go
Tests verify patch summary renders as plain contiguous path and structured RenderedPatch data is used correctly; updates test assertion for new diff-range ordering.

Picker Viewport and Highlighting

Layer / File(s) Summary
Slash Command Picker Rows
cli/app/ui_path_reference_picker.go
slashCommandPresentation builds rows directly from state.matches instead of fixed page with placeholders.
Picker Highlight and Viewport Tests
cli/app/ui_slash_command_picker_test.go, cli/app/ui_path_reference_picker_test.go
Tests verify viewport scrolling, bidirectional scrolling, auth-filtered visibility, absolute selection tracking, and highlight consistency via theme.ResolvePalette primary TrueColor.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

  • respawn-app/builder#148: Worktree feature changes that propagate and sync execution targets across runtime, UI, and session persistence, directly overlapping with SessionExecutionTarget field and helper additions.
  • respawn-app/builder#43: Large addition of the /status overlay and uiStatusConfig handling, directly complementary to status-overlay refactoring and ExecutionTarget integration.
  • respawn-app/builder#93: Runtime transcript handling, native history flush sequencing, and runtime-event batching affecting ui_runtime_adapter and transcript sync paths.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix worktree statusline and picker rendering regressions' accurately captures the main focus of the changeset—addressing regressions in worktree status display and picker rendering—as confirmed by file summaries and PR objectives.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/worktree-statusline-patch-summary

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 and usage tips.

@Nek-12 Nek-12 linked an issue May 12, 2026 that may be closed by this pull request
@Nek-12 Nek-12 merged commit 36f152d into main May 12, 2026
6 checks passed
@Nek-12 Nek-12 deleted the fix/worktree-statusline-patch-summary branch May 12, 2026 12:38
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.

Focus(selection) jumping when I pressing UP/DOWN throw commands

1 participant