Skip to content

refactor(ui): reconcile Logbook mutations with Solid actions - #180338

Closed
steipete wants to merge 2 commits into
mainfrom
solid2/w-s2-logbook-actions
Closed

steipete wants to merge 2 commits into
mainfrom
solid2/w-s2-logbook-actions

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Whole-scope production census at base 49f695b5bc5bb753f34da0e64683f39c499c8e2c → this Logbook action candidate. Counts are AST syntax, not defect counts; each cell is before → after.

Family LOC 1 Handlers 2 Cleanup 3 Reads/Loading/Errored 4 Action/optimistic 5 Imports/lazy 6 Structured/stores/projections 7 Factories 8 Context 9 Reveal 10 Owner APIs
solid 7931 → 7931 3 → 3 6 → 6 0/3/1 → 0/3/1 2/1/1 → 2/1/1 3/2 → 3/2 0/1/0 → 0/1/0 0 → 0 0 → 0 0 → 0 1/1/1 → 1/1/1
config 4962 → 4962 0 → 0 0 → 0 0/0/0 → 0/0/0 0/0/0 → 0/0/0 0/0 → 0/0 1/1/0 → 1/1/0 0 → 0 0 → 0 0 → 0 0/0/0 → 0/0/0
menus 8306 → 8306 0 → 0 2 → 2 0/2/2 → 0/2/2 1/1/0 → 1/1/0 3/1 → 3/1 1/1/0 → 1/1/0 2 → 2 0 → 0 0 → 0 0/0/0 → 0/0/0
rest 20113 → 20113 4 → 4 16 → 16 2/7/4 → 2/7/4 2/2/0 → 2/2/0 6/1 → 6/1 1/2/0 → 1/2/0 0 → 0 2 → 2 0 → 0 0/1/0 → 0/1/0
pagesA 26654 → 26654 3 → 3 3 → 3 13/30/29 → 13/30/29 15/20/0 → 15/20/0 6/0 → 6/0 1/3/1 → 1/3/1 0 → 0 0 → 0 0 → 0 0/0/0 → 0/0/0
pagesB 43692 → 43692 1 → 1 9 → 9 2/30/21 → 2/30/21 9/9/3 → 9/9/3 22/4 → 22/4 3/7/1 → 3/7/1 0 → 0 1 → 1 1 → 1 0/0/0 → 0/0/0
pagesC 54836 → 54970 4 → 4 27 → 27 1/17/14 → 1/17/14 3/5/0 → 4/9/0 43/4 → 43/4 10/10/0 → 10/10/0 20 → 20 0 → 0 0 → 0 0/0/0 → 0/0/0
app 31666 → 31666 2 → 2 3 → 3 0/9/8 → 0/9/8 0/0/0 → 0/0/0 68/7 → 68/7 0/2/0 → 0/2/0 0 → 0 1 → 1 0 → 0 0/0/0 → 0/0/0
lib 54725 → 54725 0 → 0 5 → 5 0/2/2 → 0/2/2 1/1/0 → 1/1/0 15/1 → 15/1 1/2/0 → 1/2/0 0 → 0 1 → 1 0 → 0 0/2/2 → 0/2/2
plugins 4024 → 4024 0 → 0 3 → 3 0/4/4 → 0/4/4 1/1/0 → 1/1/0 13/1 → 13/1 1/2/0 → 1/2/0 0 → 0 0 → 0 0 → 0 2/3/2 → 2/3/2
api 2104 → 2104 0 → 0 0 → 0 0/0/0 → 0/0/0 0/0/0 → 0/0/0 2/0 → 2/0 0/0/0 → 0/0/0 0 → 0 0 → 0 0 → 0 0/0/0 → 0/0/0
total 259013 → 259147 17 → 17 74 → 74 18/104/85 → 18/104/85 34/40/4 → 35/44/4 181/21 → 181/21 19/31/2 → 19/31/2 22 → 22 5 → 5 1 → 1 3/7/5 → 3/7/5

What Problem This Solves

Logbook capture, analysis, standup, and question actions now expose native Solid mutation presentation while their existing owner keeps synchronous admission and accepted results. Capture shows the expected paused value until the server settles. The other three operations expose only progress; generated content and analysis outcomes still come from the owner.

Route, Gateway, descriptor removal, and selected-day changes retire presentation without cancelling the admitted operation. The existing error contract remains visible. A declined owner operation returns no receipt, so it cannot start a phantom optimistic transition.

Touched-file checklist Before → after
1 Native handler defects 0 → 0
2 Component cleanup debt 0 changed; synchronous owner custody retained
3 Primary reads Unchanged; separate Logbook readiness PR
4 Mutation presentations 4 manual → 4 native action callers, one shared generator
5 Lazy boundary Logbook remains behind its existing plugin lazy import
6 State mirrors No new writable owner mirror; optimistic capture value only
7 Handwritten factories 0 → 0 in changed modules
8 Redundant context wrappers 0 → 0
9 Sibling loading Unchanged
10 Owner escapes 0 added

Evidence

Check Result
UI tsrs Passed
Focused tests Three changed single-file suites attempted through the pinned Bun wrapper (logbook-actions, plugin-page, logbook-view), each ended at the no-output watchdog before assertions. CI supplies remaining unit evidence. The built-UI probe verified pending/settled controls and held-write day and route navigation.
Independent P0–P2 review Found one fixture-only unstable retirement promise; corrected every direct Logbook fixture to return a stable promise. No production defect established.
Lint / format Both passed on all nine changed files
Production Knip Same 13 heartbeat-owner unused files as the base; no UI findings
Paired build / strict performance Passed, no violations/warnings; all five production source maps match final source
Visual Four 1440×1000 production-renderer captures inspected; synthetic data only
CI ci:full requested

Production nonblank LOC in the five touched production files: 1342 → 1468 (+126). The growth separates native mutation presentation and names the existing synchronous retirement points; it adds no RPC, dependency, or predicted server-generated output.

Gzip surface Base Head Change
Startup JS 316,259 B 316,246 B −13 B
Startup CSS 40,894 B / 1 request 40,894 B / 1 request unchanged
Chat boot JS 1,436,975 B 1,437,005 B +30 B
New Session boot JS 1,015,004 B 1,014,995 B −9 B

The paired strict check passes the current caps and no-growth tolerance; Logbook retains its lazy boundary. The plain owner retains busy admission flags to reject duplicate synchronous writes before Solid flushes. The view adds optimistic presentation only.

Before: capture request pending

Before: capture request settled

After: optimistic capture request pending

After: capture request settled

CI repair for run 39727889052: all eight plugin-page.session-navigation.browser.test.tsx cases failed because the new action-retirement owner reads the application router and this browser fixture omitted it. The fixture now supplies a real router and stops it on cleanup. The exact browser file passes 8/8 locally. This is a test-fixture correction; production code, bundle metrics, source maps, and the four attached captures are unchanged.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T05:30:00.411035Z d50bb78 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d50bb783c0

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

private readonly host: HTMLElement,
private readonly notify: () => void,
) {
let location = context.router.getState().location;

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.

P1 Badge Add a router to the browser PluginPage fixture

PluginPageOwner now unconditionally reads context.router during construction, but the existing mount() fixture in ui/src/pages/plugin/plugin-page.session-navigation.browser.test.tsx:89-97 still creates an ApplicationContext without a router, and normalizeApplicationContext does not add one. Every Chromium test in that file therefore throws before its iframe mounts; add the same test router supplied by the updated unit fixture so the browser suite can run.

AGENTS.md reference: AGENTS.md:L81-L83

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR presents Logbook mutations through Solid actions while retaining synchronous admission and accepted results in the existing owner.

Example: Click Pause on the 2026-10-21 Logbook while the capture request remains pending.

  • Before: The disabled button still says Pause and the status says Capturing every 30s.
  • After: The disabled button says Resume and the status says Capture paused, then reconciles with the server result.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Visible capture behavior is demonstrated and ownership is coherent, but the confirmed browser-fixture regression blocks merge.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected production-renderer screenshots show pending optimistic capture and settled reconciliation, while the body reports held-write navigation probes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Pending capture changes do not immediately show the requested paused state, and mutation presentation needs to retire when the user leaves its scope.
Reason: The maintainer-authored direction provides visible optimistic feedback without moving RPC admission, generated content, or accepted results into Solid.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the maintainer-directed refactor is useful, but an introduced browser-fixture failure needs repair.

Priority: P2
Reviewed head: d50bb783c0b12ad25252e9e3e675204d1d802ac8

Before merge

  • Supply a router to the browser PluginPage fixture (P2) - The constructor now unconditionally calls context.router.getState(), but mount() in ui/src/pages/plugin/plugin-page.session-navigation.browser.test.tsx:89-97 still supplies an ApplicationContext without router. normalizeApplicationContext does not supply one, so all eight Chromium cases fail before mounting their iframe. Exact-head checks-ui annotations confirm this getState TypeError. Add a real createRouter fixture as already done in plugin-page.test.tsx, preserving the existing navigation and rejection assertions.

Findings

  • [P2] Supply a router to the browser PluginPage fixture — ui/src/pages/plugin/plugin-page-lifecycle.ts:62

Tests

  • Missing end-to-end proof: The supplied captures demonstrate capture presentation; route/day retirement and rejected-write recovery are supported by source and test scenarios rather than inspected runtime artifacts.
Agent review details

How this fits together

The Control UI plugin page mounts Logbook for a Gateway connection; user actions enter the plain Logbook owner as RPC requests, and Solid presents pending state and accepted results.

flowchart LR
  A[Logbook controls] --> B[Plain Logbook owner]
  B --> C[Gateway RPC]
  C --> B
  B --> D[Solid action presentation]
  E[Route and connection lifetime] --> D
  F[Selected day lifetime] --> D
  D --> A
Loading

Technical review

Best possible solution:

Retain the shared Solid presentation adapter and supply the existing real-router fixture pattern to the browser session-navigation tests.

Do we have a high-confidence way to reproduce the issue?

The new unconditional router read reaches a browser fixture without a router, and exact-head CI annotations confirm the resulting getState error; no target code was executed during this review.

Is this the best way to solve the issue?

The adapter follows the repository's existing Solid action recipe while preserving owner authority, and the smallest complete repair is to update the remaining browser consumer fixture.

Full review comments:

  • [P2] Supply a router to the browser PluginPage fixture — ui/src/pages/plugin/plugin-page-lifecycle.ts:62
    The constructor now unconditionally calls context.router.getState(), but mount() in ui/src/pages/plugin/plugin-page.session-navigation.browser.test.tsx:89-97 still supplies an ApplicationContext without router. normalizeApplicationContext does not supply one, so all eight Chromium cases fail before mounting their iframe. Exact-head checks-ui annotations confirm this getState TypeError. Add a real createRouter fixture as already done in plugin-page.test.tsx, preserving the existing navigation and rejection assertions.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f2fccc2d677c.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/plugin/plugin-page.session-navigation.browser.test.tsx --project browser
  • pnpm --dir ui test src/pages/plugin/plugin-page.test.tsx
  • git diff --check

What I checked:

PR surface

Source +134, Tests +157. Total +291 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 171 37 +134
Tests 4 162 5 +157
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 333 42 +291

Review metrics

Metric Value Why it matters
Production versus test LOC Production net +134; tests net +157. The production growth supplies one shared mutation presenter and retirement at existing owners; the tests cover optimistic settlement and distinct retirement boundaries.

Labels

Label changes:

  • add P2: A useful, limited-scope UI refactor needs a focused fixture repair before its browser regression coverage can run.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: A useful, limited-scope UI refactor needs a focused fixture repair before its browser regression coverage can run.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 1:41 AM ET / 05:41 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #180380, carrying the reviewed action implementation and the repaired router fixture on current main. This PR's retained native workflow cannot read the shared landing-state schema; the replacement preserves the review and proof without modifying workflow bindings.

@steipete steipete closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant