-
Notifications
You must be signed in to change notification settings - Fork 1
fix(ui): keep analysis-run digests audible and warn on live posts (v0.84.1) #127
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # 0.84.1 Analysis-run digest a11y and live-body warning | ||
|
|
||
| Detail prefixes stay audible and hoverable. Open a cutoff title only | ||
| after reading that the live body may have changed since the run. | ||
| The list stays aggregates-only. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1406,6 +1406,62 @@ function analysisRunCorpusHint(run: AnalysisRun): string | null { | |
| return "These posts are the cutoff corpus this TEPP run measured."; | ||
| } | ||
|
|
||
| /** Git-style prefix. The full digest stays on `title` for verification. */ | ||
| const ANALYSIS_RUN_DIGEST_PREFIX_LENGTH = 12; | ||
|
|
||
| function analysisRunDigestPrefix(digest: string): string { | ||
| return digest.slice(0, ANALYSIS_RUN_DIGEST_PREFIX_LENGTH); | ||
| } | ||
|
|
||
| /** | ||
| * Next action when a cutoff title opens the live post (ADR 0016). | ||
| * | ||
| * Post-body versioning is a later slice. Until then the operator must | ||
| * compare the opened body with this run's cutoff instead of treating | ||
| * today's text as reconstructed evidence. | ||
| */ | ||
| function analysisRunLivePostWarning(cutoffIso: string): string { | ||
| const cutoffDate = cutoffIso.slice(0, 10); | ||
| return ( | ||
| `Opening a title shows the live post. Compare it with cutoff ${cutoffDate} ` + | ||
| "before you treat the body as reconstructed evidence — it may have changed after this run." | ||
| ); | ||
| } | ||
|
|
||
| function analysisRunLivePostButtonLabel(postTitle: string): string { | ||
| return `Open live post (may have changed after cutoff): ${postTitle}`; | ||
| } | ||
|
|
||
| function AnalysisRunReproducibilityDigests({ | ||
| codeRevisionSha, | ||
| configurationSha256, | ||
| }: { | ||
| codeRevisionSha?: string; | ||
| configurationSha256?: string; | ||
| }) { | ||
| if (!codeRevisionSha && !configurationSha256) { | ||
| return null; | ||
| } | ||
| return ( | ||
| <div role="group" aria-label="Analysis run reproducibility digests"> | ||
| <p className="post-meta"> | ||
| <span className="visually-hidden"> | ||
| Hover a prefix to read the full digest for verification.{" "} | ||
|
Contributor
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. This visually-hidden sentence is still announced, and it still names a pointer-only action. Keyboard and assistive-technology operators cannot read the full digest on this head. Keep prefixes audible here; the v0.84.3 successor turns each prefix into an APG disclosure ( |
||
| </span> | ||
| {codeRevisionSha ? ( | ||
| <span title={codeRevisionSha}>{`Code ${analysisRunDigestPrefix(codeRevisionSha)}`}</span> | ||
| ) : null} | ||
| {codeRevisionSha && configurationSha256 ? " · " : null} | ||
| {configurationSha256 ? ( | ||
| <span title={configurationSha256}> | ||
| {`Config ${analysisRunDigestPrefix(configurationSha256)}`} | ||
| </span> | ||
| ) : null} | ||
| </p> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| function AnalysisRunsPanel({ | ||
| accessToken, | ||
| onSelectPost, | ||
|
|
@@ -1488,19 +1544,10 @@ function AnalysisRunsPanel({ | |
| {" · "} | ||
| Requested {selected.requested_at.slice(0, 10)} | ||
| </p> | ||
| {(selected.code_revision_sha || selected.configuration_sha256) && ( | ||
| <p className="post-meta" aria-label="Analysis run reproducibility digests"> | ||
| {selected.code_revision_sha | ||
| ? `Code ${selected.code_revision_sha.slice(0, 12)}` | ||
| : ""} | ||
| {selected.code_revision_sha && selected.configuration_sha256 | ||
| ? " · " | ||
| : ""} | ||
| {selected.configuration_sha256 | ||
| ? `Config ${selected.configuration_sha256.slice(0, 12)}` | ||
| : ""} | ||
| </p> | ||
| )} | ||
| <AnalysisRunReproducibilityDigests | ||
| codeRevisionSha={selected.code_revision_sha} | ||
| configurationSha256={selected.configuration_sha256} | ||
| /> | ||
| <ul> | ||
| {selected.source_counts.map((count) => ( | ||
| <li key={count.count_type_code}> | ||
|
|
@@ -1521,12 +1568,13 @@ function AnalysisRunsPanel({ | |
| {selected.visible_posts && selected.visible_posts.length > 0 ? ( | ||
| <> | ||
| {corpusHint && <p className="post-meta">{corpusHint}</p>} | ||
| <p className="post-meta">{analysisRunLivePostWarning(selected.knowledge_cutoff)}</p> | ||
| <ul aria-label="Posts known at this run cutoff"> | ||
| {selected.visible_posts.map((post) => ( | ||
| <li key={post.post_id}> | ||
| <button | ||
| className="keyman-select" | ||
| aria-label={`Open run post: ${post.post_title}`} | ||
| aria-label={analysisRunLivePostButtonLabel(post.post_title)} | ||
| onClick={() => onSelectPost(post.post_id)} | ||
| > | ||
| {post.post_title} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,4 +55,4 @@ | |
| "sentence_excerpts", | ||
| ] | ||
|
|
||
| __version__ = "0.84.0" | ||
| __version__ = "0.84.1" | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.