refactor(storybook): check recovery disclosure visibility (#16828)

## Thinking Path

> - Paperclip helps people manage AI agents and their work.
> - Recovery previews show when work can continue and when an operator
must inspect it.
> - Saved-source reconstruction keeps its inputs inside a closed
disclosure.
> - The browser query can find those mounted inputs while the disclosure
is closed.
> - The old assertion required the inputs to be absent and failed before
testing the disclosure.
> - This pull request checks that each input is hidden, then keeps the
existing open-and-inspect assertions.

## Linked Issues or Issue Description

Refs #16686.

The `SourceReconstruction` story fails with “Found multiple elements
with the role textbox” while its disclosure is closed. The inputs are
mounted but hidden. Their visibility is the intended contract.

## What Changed

- Assert that all reconstruction text fields are hidden before opening
the disclosure.
- Keep the checks for the saved attachment and the disabled continuation
button after opening it.

## Verification

- Baseline: the browser play function failed at `queryByRole("textbox")`
because it found two hidden fields.
- Treatment: the same story passes all six browser interaction steps.
Both hidden-field checks execute before the disclosure opens.
- All ten play-enabled recovery notice stories pass in the browser,
including automatic recovery, operator and reader blockers, missed
recovery, read failure, mobile, reconstruction, and queued continuation.
Revisiting automatic recovery after the error and reconstruction
fixtures also passes.
- Catalog validation passes. All 28 map and catalog tests pass.
- UI typecheck and token gates pass. All 57 current-head checks pass or
have their expected skipped state, including workspace typecheck, tests,
and build.
- Greptile scored this head 5/5 with no unresolved threads. The initial
description gate did not recognize Storybook play files as tests; the
assertion-only change is classified as a refactor and its rerun passed.
- These stories use production components with fixture data. They do not
prove provider recovery or a production deployment.

## Risks

Low risk. This changes one Storybook assertion. A regression that
exposes a reconstruction field before opening the disclosure still fails
the visibility check.

## Model Used

OpenAI Codex, `gpt-6.1-sol`, xhigh reasoning, with tool use and code
execution. The host does not expose the context-window limit.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-10-19 06:57:56 -05:00
1 parent 51c81d0129
commit 6e89919631
1 file changed
+3 -1
@@ -84,7 +84,9 @@ export const SourceReconstruction: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await expect(canvas.getByText("Continue from saved sources")).toBeVisible();
await expect(canvas.queryByRole("textbox")).not.toBeInTheDocument();
for (const input of canvas.queryAllByRole("textbox")) {
await expect(input).not.toBeVisible();
}
await userEvent.click(canvas.getByText("Continue from saved sources"));
await expect(canvas.getByText("test-audit.patch (4096 bytes)")).toBeVisible();
await expect(canvas.getByRole("button", { name: "Rebuild and continue" })).toBeDisabled();