fix(webui): fetch harness roster on connect, not first New Session open - #1236
Merged
Conversation
The Playbook clip picker builds its harness rows and the 'harness >'
category from state.harnesses, but that list was only populated inside
openNewSessionDialog(). On a fresh page load the picker offered sessions
only, and @{harness:...} clips were uninsertable from the web UI even
though the empty-state help advertises them.
harness.list is fleet state: fetch it in the websocket open handler via
a shared refreshHarnesses() helper, so it is populated on first connect
and refreshed on every reconnect (the roster can change across a daemon
restart, which is exactly when reconnects happen). The New Session
dialog now uses the same helper, keeping its open-time availability
refresh and error surface.
Regression coverage in web_smoke: a freshly loaded page must offer the
harness category and @{harness:...} clips in playbookClipRootRows with
no prior New Session visit, and the roster must repopulate after a
forced websocket reconnect.
Closes #1098
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1098.
Problem
The Playbook clip picker builds its harness rows and the
harness ▸category fromstate.harnesses, but that list was only populated insideopenNewSessionDialog(). On a fresh page load the picker offered sessions only —@{harness:…}could not be inserted from the web UI at all until the New Session sheet had been opened once.Change
harness.listis fleet state, so it now travels with the connect flow:refreshHarnesses()helper (next torefreshSessions) fetchesharness.listintostate.harnesses.openhandler calls it on every (re)connect — the roster can change across a daemon restart, which is exactly when reconnects happen.openNewSessionDialog()uses the same helper: it still refreshes availability at open time and keeps its error surface, just through the shared path.Acceptance criteria
@in a freshly loaded web UI offers harness clips and theharness ▸category, with no prior visit to the New Session sheet — regression-tested.Regression test
Added to
web_smoke::web_client_loads_and_websocket_connects(real headless Chromium against a real daemon): pollsstate.harnessesafter connect, assertsplaybookClipRootRows("")containscategory:harnessand an@{harness:…}clip before any dialog interaction, then forcesstate.ws.close()and asserts the roster repopulates. Verified the new assertions fail against the pre-fixindex.html(state.harnesses never populated from the connect flow) and pass with the fix.