-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ui): disclose analysis-run digests from the keyboard (v0.84.3) #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
cursor
wants to merge
4
commits into
feat/role-responsibility-agent-ontology
from
cursor/bc-63c91e55-ff1e-43ff-b3e2-347510c30a5c-916b
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
165b4aa
fix(ui): keep analysis-run digests audible and warn on live posts
cursoragent c7f2462
docs: mark analysis-run seed pointer as v0.84.1
cursoragent afca0ff
fix(ui): disclose analysis-run digests from the keyboard (v0.84.3)
cursoragent 9038020
merge: retarget digest disclosure onto #125 and #127
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # 0.85.1 Analysis-run digest disclosure | ||
|
|
||
| Activate a prefix on the run detail to read the full digest. Hover is | ||
| not the only verification path. The list stays aggregates-only. |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Goal — analysis-run operator loop | ||
|
|
||
| **Status:** Active | ||
| **Date:** 2026-08-16 | ||
|
|
||
| ## Goal | ||
|
|
||
| A buyer can open a seeded analysis run, hear the digest prefixes, reveal | ||
| the full digests without a pointer, and compare any opened live post | ||
| with that run's cutoff before treating the body as reconstructed | ||
| evidence. | ||
|
|
||
| ## Current loop | ||
|
|
||
| 1. #127 is on `feat/role-responsibility-agent-ontology` (`44912a6`). | ||
| Prefixes are audible; the live-body warning is present. | ||
| 2. Land #135 (v0.85.1) so keyboard and AT operators can match a digest | ||
| to the API payload. Do not self-approve or merge from this automation. | ||
| 3. Keep #131 as the write-clock comparison slice. Do not open a second | ||
| write-clock PR. | ||
| 4. #125 (`POST /api/analysis-runs`) is on the same base. Do not open a | ||
| second create PR. | ||
| 5. Post-body versioning at the cutoff remains later work (ADR 0016). | ||
|
|
||
| ## Out of this loop | ||
|
|
||
| Retention purge and the Storybook runner belong to the approved | ||
| frontend-toolchain PR. Failed-run next-action copy already landed with | ||
| #124. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Storybook inventory | ||
|
|
||
| Repeating web objects that must stay tokenized and independently | ||
| composable. The Storybook runner itself lands with the approved | ||
| frontend toolchain PR; this inventory is the product list those | ||
| stories must cover. | ||
|
|
||
| | Object | Tokens | Next action the story must teach | | ||
| |---|---|---| | ||
| | Analysis-run digest disclosure | `--lw-opacity-meta`, `--lw-font-size-meta`, `--lw-space-digest-gap`, `--lw-font-family-mono`, `--lw-focus-ring`, `--lw-focus-offset` | Activate a prefix, then match the revealed digest to the API payload. | | ||
| | Analysis-run live-post warning | `--lw-opacity-meta`, `--lw-font-size-meta` | Compare the opened body with the run cutoff before treating it as reconstructed evidence. | | ||
| | Meta caption (`.post-meta`) | `--lw-opacity-meta`, `--lw-font-size-meta` | Read the clock or count, then take the control beside it. | | ||
|
|
||
| ## References | ||
|
|
||
| World Wide Web Consortium. (2024). *Web content accessibility guidelines | ||
| (WCAG) 2.2* (W3C Recommendation). https://www.w3.org/TR/WCAG22/ | ||
|
|
||
| World Wide Web Consortium. (n.d.). *Disclosure (show/hide) pattern*. | ||
| ARIA Authoring Practices Guide. | ||
| https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/ |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import { render, screen } from "@testing-library/react"; | ||
| import userEvent from "@testing-library/user-event"; | ||
| import { describe, expect, it } from "vitest"; | ||
| import { AnalysisRunReproducibilityDigests } from "./AnalysisRunReproducibilityDigests"; | ||
|
|
||
| const CODE_REVISION_SHA = "abcdef0123456789deadbeefcafebabe"; | ||
| const CONFIGURATION_SHA256 = | ||
| "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"; | ||
|
|
||
| describe("AnalysisRunReproducibilityDigests", () => { | ||
| it("renders nothing when the run has no digests", () => { | ||
| const { container } = render(<AnalysisRunReproducibilityDigests />); | ||
| expect(container).toBeEmptyDOMElement(); | ||
| }); | ||
|
|
||
| it("keeps prefixes audible and hides full digests until activation", () => { | ||
| render( | ||
| <AnalysisRunReproducibilityDigests | ||
| codeRevisionSha={CODE_REVISION_SHA} | ||
| configurationSha256={CONFIGURATION_SHA256} | ||
| />, | ||
| ); | ||
| const group = screen.getByLabelText("Analysis run reproducibility digests"); | ||
| expect(group).toHaveTextContent("Activate a prefix to read the full digest and match the API payload."); | ||
| expect(group).not.toHaveTextContent("Hover"); | ||
| const codeButton = screen.getByRole("button", { name: "Code abcdef012345" }); | ||
| const configButton = screen.getByRole("button", { name: "Config 0123456789ab" }); | ||
| expect(codeButton).toHaveAttribute("aria-expanded", "false"); | ||
| expect(configButton).toHaveAttribute("aria-expanded", "false"); | ||
| expect(group).not.toHaveTextContent(CODE_REVISION_SHA); | ||
| expect(group).not.toHaveTextContent(CONFIGURATION_SHA256); | ||
| }); | ||
|
|
||
| it("reveals the full code digest with Enter and hides it on the next activation", async () => { | ||
| const user = userEvent.setup(); | ||
| render( | ||
| <AnalysisRunReproducibilityDigests | ||
| codeRevisionSha={CODE_REVISION_SHA} | ||
| configurationSha256={CONFIGURATION_SHA256} | ||
| />, | ||
| ); | ||
| await user.tab(); | ||
| expect(screen.getByRole("button", { name: "Code abcdef012345" })).toHaveFocus(); | ||
| await user.keyboard("{Enter}"); | ||
| expect(screen.getByRole("button", { name: "Code abcdef012345" })).toHaveAttribute( | ||
| "aria-expanded", | ||
| "true", | ||
| ); | ||
| expect(screen.getByText(CODE_REVISION_SHA)).toBeInTheDocument(); | ||
| expect(screen.queryByText(CONFIGURATION_SHA256)).not.toBeInTheDocument(); | ||
| await user.keyboard("{Enter}"); | ||
| expect(screen.getByRole("button", { name: "Code abcdef012345" })).toHaveAttribute( | ||
| "aria-expanded", | ||
| "false", | ||
| ); | ||
| expect(screen.queryByText(CODE_REVISION_SHA)).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("reveals the full configuration digest with Space", async () => { | ||
| const user = userEvent.setup(); | ||
| render( | ||
| <AnalysisRunReproducibilityDigests | ||
| codeRevisionSha={CODE_REVISION_SHA} | ||
| configurationSha256={CONFIGURATION_SHA256} | ||
| />, | ||
| ); | ||
| await user.tab(); | ||
| await user.tab(); | ||
| expect(screen.getByRole("button", { name: "Config 0123456789ab" })).toHaveFocus(); | ||
| await user.keyboard(" "); | ||
| expect(screen.getByText(CONFIGURATION_SHA256)).toBeInTheDocument(); | ||
| expect(screen.queryByText(CODE_REVISION_SHA)).not.toBeInTheDocument(); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import { useId, useState } from "react"; | ||
| import { | ||
| analysisRunDigestButtonLabel, | ||
| analysisRunDigestNextAction, | ||
| type AnalysisRunDigestKind, | ||
| } from "./analysisRunDigests"; | ||
|
|
||
| /** | ||
| * One digest disclosure. The button name stays the audible prefix; the | ||
| * full value is shown only after Enter, Space, or click (APG Disclosure). | ||
| */ | ||
| function AnalysisRunDigestDisclosure({ | ||
| kind, | ||
| digest, | ||
| panelId, | ||
| }: { | ||
| kind: AnalysisRunDigestKind; | ||
| digest: string; | ||
| panelId: string; | ||
| }) { | ||
| const [open, setOpen] = useState(false); | ||
| const label = analysisRunDigestButtonLabel(kind, digest); | ||
| return ( | ||
| <span className="analysis-run-digest"> | ||
| <button | ||
| type="button" | ||
| className="analysis-run-digest-toggle" | ||
| aria-expanded={open} | ||
| aria-controls={panelId} | ||
| onClick={() => setOpen((current) => !current)} | ||
| > | ||
| {label} | ||
| </button> | ||
| {open ? ( | ||
| <code id={panelId} className="analysis-run-digest-full"> | ||
| {digest} | ||
| </code> | ||
| ) : null} | ||
| </span> | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Labeled group of analysis-run reproducibility digests. | ||
| * | ||
| * Prefixes remain the accessible contents of the group. Full digests | ||
| * stay off the home list and off the default detail text until the | ||
| * operator activates a prefix. | ||
| */ | ||
| export function AnalysisRunReproducibilityDigests({ | ||
| codeRevisionSha, | ||
| configurationSha256, | ||
| }: { | ||
| codeRevisionSha?: string; | ||
| configurationSha256?: string; | ||
| }) { | ||
| const id = useId(); | ||
| if (!codeRevisionSha && !configurationSha256) { | ||
| return null; | ||
| } | ||
| return ( | ||
| <div role="group" aria-label="Analysis run reproducibility digests"> | ||
| <p className="post-meta">{analysisRunDigestNextAction()}</p> | ||
| <p className="post-meta analysis-run-digest-row"> | ||
| {codeRevisionSha ? ( | ||
| <AnalysisRunDigestDisclosure | ||
| kind="code" | ||
| digest={codeRevisionSha} | ||
| panelId={`${id}-code`} | ||
| /> | ||
| ) : null} | ||
| {codeRevisionSha && configurationSha256 ? " · " : null} | ||
| {configurationSha256 ? ( | ||
| <AnalysisRunDigestDisclosure | ||
| kind="config" | ||
| digest={configurationSha256} | ||
| panelId={`${id}-config`} | ||
| /> | ||
| ) : null} | ||
| </p> | ||
| </div> | ||
| ); | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,23 +88,52 @@ | |
| :root { | ||
| --lw-opacity-meta: 0.7; | ||
| --lw-font-size-meta: 0.85rem; | ||
| --lw-space-digest-gap: 0.35rem; | ||
| --lw-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; | ||
| --lw-focus-ring: 2px solid currentColor; | ||
| --lw-focus-offset: 2px; | ||
| } | ||
|
|
||
| .post-meta { | ||
| opacity: var(--lw-opacity-meta); | ||
| font-size: var(--lw-font-size-meta); | ||
| } | ||
|
|
||
| .visually-hidden { | ||
| position: absolute; | ||
| width: 1px; | ||
| height: 1px; | ||
| .analysis-run-digest-row { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| align-items: baseline; | ||
| gap: var(--lw-space-digest-gap); | ||
| } | ||
|
|
||
| .analysis-run-digest { | ||
| display: inline-flex; | ||
| flex-direction: column; | ||
| align-items: flex-start; | ||
| gap: var(--lw-space-digest-gap); | ||
| } | ||
|
|
||
| .analysis-run-digest-toggle { | ||
| background: none; | ||
| border: none; | ||
| padding: 0; | ||
|
Comment on lines
+116
to
119
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
#139 sets |
||
| margin: -1px; | ||
| overflow: hidden; | ||
| clip-path: inset(50%); | ||
| white-space: nowrap; | ||
| border: 0; | ||
| color: inherit; | ||
| cursor: pointer; | ||
| font: inherit; | ||
| text-decoration: underline; | ||
| text-underline-offset: 0.15em; | ||
| } | ||
|
|
||
| .analysis-run-digest-toggle:focus-visible { | ||
| outline: var(--lw-focus-ring); | ||
| outline-offset: var(--lw-focus-offset); | ||
| } | ||
|
|
||
| .analysis-run-digest-full { | ||
| display: block; | ||
| font-family: var(--lw-font-family-mono); | ||
| font-size: var(--lw-font-size-meta); | ||
| overflow-wrap: anywhere; | ||
| } | ||
|
|
||
| .post-body { | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
openis false this panel is unmounted, soaria-controlson the button points at an id that is not in the document. WAI-ARIA APG Disclosure keeps the controlled element in the tree and toggleshidden(or equivalent). Keyboard/AT operators who follow the control relationship then have nowhere to land.#139 keeps
<code hidden={!open}>in place so the target exists while collapsed.