Tidy up after the cursor API, the boot sweep and the panel rework - #49
Merged
Conversation
routes_test.go held the tests for six subjects at once, so the tests for a handler lived nowhere near it and the file had no source counterpart. Each suite now sits beside the code it covers and is named after what it exercises, and the shared request harness has a file of its own. Claude-Session: https://claude.ai/code/session_017NsCXwruqBye5cySvFEFiB
Both panels repeated the same summary class string and the same four SVGs, which is how two nominally identical controls drift apart. The summary and its body are now component classes, the shared glyphs are partials, and the pages render the retention window from the constant the sweep uses instead of typing a figure that outlives it. Claude-Session: https://claude.ai/code/session_017NsCXwruqBye5cySvFEFiB
The API doc still promised an unconditional 200, PRODUCT.md still described a listing that only ever ordered newest first, AGENTS.md's file inventory had no entry for the agent prompt, and a comment pointed at the file the header flattening used to live in. Claude-Session: https://claude.ai/code/session_017NsCXwruqBye5cySvFEFiB
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.
A cleanup pass over everything shipped in the last twelve hours: the cursor API (#47), the retention sweep at boot (#46) and the disclosure panel rework (#48).
Tests now sit beside their subject
routes_test.goheld the tests for six subjects at once and had no source counterpart, so a handler's tests lived nowhere near it. Each suite moved to the file for the code it covers and is named after what it exercises (TestHandleListRequests,TestCaptureRequest,TestRenderEndpoint,TestRequireValidEndpoint, …).harness_test.goholdsTestMainand the fixtures every request-driving test shares.AGENTS.mdrecords the rule.Gaps filled
Covering behaviour that shipped without a test:
startRetentionSweepsweeps at boot. The point of Sweep at boot, and stop rendering swept captures #46, previously only covered one layer down atsweepRetention.hasMoreon a full page, and a burst draining to false. It is the signal a poller throttles on, and the agent prompt tells agents to trust it.newestCreatedAtscans rather than reading an end, which is why the listing can flip its order safely.X-Request-Idis replaced, not echoed, so a caller cannot shape a log line.capture-api.spec.ts): over the limit is a 413, at the limit round-trips whole. Only a real socket can see this.Duplication removed
summarystring and the same body wrapper. They are now.panel-summaryand.panel-body, which is whatcomponents.cssandDESIGN.mdalready ask for: a template that re-spells a component as a utility string is the bug. Make the agent panel's copy button a secondary control #48 had to edit both copies in step, which is the drift this prevents.views/partials/icons/.pluralizereplaces four hand-rolledn === 1 ? x : xsternaries across the page scripts and the template.requestsUrlhelper.retentionWindowinstead of typing "4 hours" in three places.agent.goalready made this argument for the prompt; the copy the user reads deserves the same. Moving the constant now moves the promise.Docs corrected
docs/api.mdpromised an unconditional200from the capture route, which the body limit has never honoured.PRODUCT.mddescribed a listing that only ever ordered newest first, which stopped being true with the cursor.AGENTS.mdhad no entry foragent.go. A comment inrender-body.jspointed at the file the header flattening used to live in.Lint, types and spelling
Already at zero and still there: no eslint findings, no
eslint-disable, no@ts-ignoreor@ts-expect-error, noanyannotations or unsafe assertions (the one Go type assertion uses the comma-ok form). No typos or doubled words found, and no em dashes were introduced.Verification
go vet,go test ./src/...(206 assertions),gofmt,eslint,tsc --noEmitandprettier --checkare all clean, andpublic/app.cssmatches a fresh build. The Playwright suite is 69/69.Port 8080 was held by an unrelated process on the machine, so the app was driven on a temporary port for QA; the committed port constant and Playwright config are untouched. Against a real server: capture with UUID header, the full documented cursor loop draining a burst exactly once, malformed-ID 404s, a malformed
since400, the 413 and at-limit round trip, and the retention prose rendering from the constant. In Chrome: the landing page, both panels opening independently, a request sent from the send panel arriving live over the WebSocket, search across body/query/headers, singular and plural counts, delete-one and delete-all confirmation, the agent prompt quoting the serving host, and a swept capture disappearing on the next prune. No console errors. The rendered endpoint page was diffed againstmasterand is byte-identical apart from the intended class andx-textswaps.One thing found, not fixed
A body over 1 MiB answers
413, but the capture handler still runs and stores a capture with an empty body, so the endpoint page shows the request with "None" where the payload was. That predates this window and fixing it changes the capture path, so it is flagged rather than folded in here. Happy to open a follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_017NsCXwruqBye5cySvFEFiB