Skip to content

app: Name what already-open agents pick up on the done step - #1881

Merged
nortonandreev merged 4 commits into
mainfrom
norton/ai-4263-done-step-restart-line
Oct 23, 2026
Merged

nortonandreev merged 4 commits into
mainfrom
norton/ai-4263-done-step-restart-line

Conversation

@nortonandreev

@nortonandreev nortonandreev commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1854 — AI-4263

What & why

The done step said "Agents you already have open pick this up when they next start", without saying what is picked up. It now gives the reason and the action as two sentences: "Agents load new hooks at startup. Restart any agent you already have open." Workspace and local setups get the same line.

Where to look

The line is hidden when setup turned on no recording, or when the shell can't find kcap (that case has its own note), since there is nothing for an agent to pick up. The header and import copy are #1831's.

Verification

DoneStepViewModelTests 9/9, OnboardingAccessibilityTests 1/1, WizardSimpleStepsTests 22/22 passed. Headless renders:

Before After
Workspace
Local
No recording

Summary by CodeRabbit

  • New Features

    • The onboarding completion screen now shows when workspace setup is preparing, ready, or needs attention.
    • You can retry setup if the daemon is unavailable or workspace registration has not completed.
    • Dashboard and workspace links are available only when the current workspace is ready.
    • A restart notice appears when capture requires restarting the app.
  • Bug Fixes

    • Readiness checks now apply to the current workspace, preventing an earlier workspace’s status from enabling links.

Hooks load when an agent starts, so the line says that agents already open start sending sessions to the workspace (or recording on the machine, in local mode) after a restart. It is hidden when setup turned on no recording.
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

AI-4263

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c7147018-7787-4ce0-b784-ac1377c98bf1
📥 Commits

Reviewing files that changed from the base of the PR and between d1f1dc3 and d2f4168.

📒 Files selected for processing: 7
  • src/Capacitor.App/App.axaml.cs
  • src/Capacitor.App/Services/Onboarding/WizardComposition.cs
  • src/Capacitor.App/ViewModels/Onboarding/DoneStepViewModel.cs
  • src/Capacitor.App/ViewModels/Onboarding/WorkspaceReadiness.cs
  • src/Capacitor.App/Views/Onboarding/DonePaneView.axaml
  • test/Capacitor.App.Tests.Unit/DoneStepViewModelTests.cs
  • test/Capacitor.App.Tests.Unit/WizardCompositionTests.cs

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

📝 Walkthrough

The onboarding Done step now tracks workspace readiness, prepares the daemon, and reports CLI setup. Workspace and dashboard links remain unavailable until readiness is confirmed. The step also displays preparation status, failure details, retry controls, and a restart notice.

Changes: Onboarding readiness and reporting

Layer / File(s) Summary
Track and present workspace readiness
src/Capacitor.App/ViewModels/Onboarding/WorkspaceReadiness.cs, src/Capacitor.App/ViewModels/Onboarding/DoneStepViewModel.cs, src/Capacitor.App/Views/Onboarding/DonePaneView.axaml, test/Capacitor.App.Tests.Unit/DoneStepViewModelTests.cs
The Done step tracks readiness for the current workspace and gates workspace and dashboard links until ready. It displays preparation and failure states, provides a retry command, and shows a restart notice when capture is promised. Tests cover readiness, retries, URL changes, and restart-line visibility.
Prepare the daemon and report CLI setup
src/Capacitor.App/Services/Onboarding/WizardComposition.cs, src/Capacitor.App/App.axaml.cs, test/Capacitor.App.Tests.Unit/WizardCompositionTests.cs
Wizard composition waits for daemon work, ensures the daemon when applicable, and reports CLI setup after readiness. The app resolves a fresh server lane for reporting, with a 30-second timeout. Composition tests cover successful reporting and an unavailable CLI path.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant DoneStepViewModel
  participant WizardComposition
  participant ReportWizardCliSetupAsync
  participant FreshServerLaneAsync
  DoneStepViewModel->>WizardComposition: Request workspace preparation
  WizardComposition->>WizardComposition: Wait for daemon work and ensure daemon when applicable
  WizardComposition->>ReportWizardCliSetupAsync: Report CLI setup after daemon readiness
  ReportWizardCliSetupAsync->>FreshServerLaneAsync: Resolve a fresh server lane
  FreshServerLaneAsync-->>ReportWizardCliSetupAsync: Return lane or no server
  ReportWizardCliSetupAsync-->>WizardComposition: Return report success
  WizardComposition-->>DoneStepViewModel: Return workspace readiness
Loading

Possibly related issues

  • Issue 1854: The Done step now states that agents must restart to load newly installed hooks.

Suggested reviewers: alexeyzimarev, inok

Merge Risk: ⚪ Minimal · up to d2f41

The Done step is mergeable after normal checks. The remaining edge case requires changing servers twice during setup and is recoverable by selecting the server again.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Out of Scope Changes check Warning The pull request also adds workspace registration and daemon-readiness behavior that is not required by issue #1854. WizardComposition now prepares the daemon and reports CLI setup. `DoneStepViewMod… Remove the unrelated daemon preparation, CLI setup reporting, server-lane changes, readiness state, link gating, retry UI, and their tests from this pull request, or move them to a pull request with a directly linked coding requirement. Ret…
Docstring Coverage Warning Docstring coverage is 29.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main user-facing change: naming what already-open agents pick up on the onboarding done step.
Linked Issues check Passed Issue #1854 requires the done-step line to name what an existing agent picks up, state when it applies, and remain readable on its own. DoneStepViewModel.RestartLine now says, “Agents load new hooks…
Full details: Linked Issues check

Explanation

Issue #1854 requires the done-step line to name what an existing agent picks up, state when it applies, and remain readable on its own. DoneStepViewModel.RestartLine now says, “Agents load new hooks at startup. Restart any agent you already have open.” The line applies to both workspace and local setups. It is hidden when no recording is enabled or the path hazard blocks capture. DoneStepViewModelTests covers the visibility and wording cases.

Full details: Out of Scope Changes check

Explanation

The pull request also adds workspace registration and daemon-readiness behavior that is not required by issue #1854. WizardComposition now prepares the daemon and reports CLI setup. DoneStepViewModel now gates workspace and dashboard links, handles retry and failure states, and tracks WorkspaceReadiness. App adds reporting and fresh server-lane handling. The added WizardCompositionTests verify this separate behavior. These changes exceed the requested done-step wording change.

Resolution

Remove the unrelated daemon preparation, CLI setup reporting, server-lane changes, readiness state, link gating, retry UI, and their tests from this pull request, or move them to a pull request with a directly linked coding requirement. Retain the #1854 restart wording and focused tests.

Full details: Docstring Coverage

Explanation

Docstring coverage is 29.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · 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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Clarify when already-open agents begin recording after setup

✨ Enhancement 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Explain that new hooks take effect when already-open agents restart.
• Name the recording destination for workspace and local setups.
• Hide the note when setup added no usable recording connection.
Diagram

graph TD
  F["Setup facts"] --> C{"Capture available?"} -->|Yes| M{"Local mode?"} -->|Yes| L["Machine restart note"] --> V["Done pane"]
  M -->|No| R["Workspace restart note"] --> V
  C -->|No| H["Hide restart note"] --> V
Loading
High-Level Assessment

Keep the note derived from existing done-step facts and bind it through the view model. This follows the pane’s existing conditional-text pattern; hardcoding both variants and their visibility in the view would split the decision across layers.

Files changed (3) +28 / -2

Enhancement (2) +8 / -2
DoneStepViewModel.csDerive a destination-specific restart note +6/-0

Derive a destination-specific restart note

• Adds RestartLine to explain when newly installed hooks take effect. It names the machine in local mode or the workspace otherwise, and returns null when no usable recording connection was added.

src/Capacitor.App/ViewModels/Onboarding/DoneStepViewModel.cs

DonePaneView.axamlBind and conditionally show the restart note +2/-2

Bind and conditionally show the restart note

• Replaces the ambiguous static line with the view-model text and hides the text block when that text is absent.

src/Capacitor.App/Views/Onboarding/DonePaneView.axaml

Tests (1) +20 / -0
DoneStepViewModelTests.csCover restart-note destinations and visibility +20/-0

Cover restart-note destinations and visibility

• Tests workspace and local wording, plus suppression when recording is empty or a path hazard blocks capture.

test/Capacitor.App.Tests.Unit/DoneStepViewModelTests.cs

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@nortonandreev

Copy link
Copy Markdown
Contributor Author

@CodeRabbit approve

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

Closes #1853 — AI-4262

Stacked on #1881 (same done-step row); retargets to `main` once that
merges.

## What & why

**Open your workspace** opened the dashboard before the server had the
cli-setup report, which the app sent only after setup closed, so the
website offered a CLI download the app already includes. The Done step
now brings the daemon up and sends the report first, showing "Getting
your workspace ready…" until it lands. If either fails, a warning card
says why and offers **Try again**. The report is bounded at 30 s, so a
silent server never leaves a spinner.

## Where to look

Ready is never revoked once reached. A failed daemon run is repeated
only on Try again, so a declined service takeover is not asked again. No
website change is needed: kcap-server clears its install-cli step on
`POST /api/users/me/cli-setup`.

## Verification

Full `Capacitor.App.Tests.Unit` after the rebase: 4,245 passed, 10
skipped, 0 failed. Headless renders of the real Done view:

| | Workspace | Local |
|---|---|---|
| Before | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/before-cloud.png"
width="340"> | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/before-local.png"
width="340"> |
| Preparing | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-cloud-preparing.png"
width="340"> | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-local-preparing.png"
width="340"> |
| Ready | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-cloud-ready.png"
width="340"> | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-local-ready.png"
width="340"> |
| Report failed | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-cloud-unreported.png"
width="340"> | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-local-unreported.png"
width="340"> |
| Daemon not running | <img
src="https://raw.githubusercontent.com/kurrent-io/kcap-cli/9fe9ce4f91025c497885a36ce7219fcf9b303d3e/1853/after-cloud-daemon-not-running.png"
width="340"> | |
@nortonandreev

Copy link
Copy Markdown
Contributor Author

@CodeRabbit approve

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved. CodeRabbit has already approved this PR, so no new approval was submitted.

@nortonandreev
nortonandreev merged commit cf5c781 into main Oct 23, 2026
12 checks passed
@nortonandreev
nortonandreev deleted the norton/ai-4263-done-step-restart-line branch October 23, 2026 15:02
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.

app: Name what already-open agents pick up on the done step

1 participant