docs(attachments): qualify visible application context reset

This commit is contained in:
cesnimda
2026-11-17 07:54:40 +01:00
parent 2affeaca68
commit 3b661d12d7
16 changed files with 284 additions and 0 deletions
@@ -0,0 +1,9 @@
# Visible attachment context reset
17 November 2026. Source `2affeaca68fa0cf191f1c57edb7cce2b0ac36e5b` on `codex/a3-ui-10`, following local source `a877b97d`/evidence `c354e38b`. Publication remains pending afterHTTP502; last verified remote A3 was `13769a19`.
On application change, clear previous attachment rows/actions/error and close/clear the previous preview. Existing URL-effect cleanup releases the old preview URL. Current application reads restore their own rows as before; upload state and session generation protections remain. This prevents a new application's controls from acting on a retained previous file while its list is pending.
Two original regressions FAILED; final89 cases/four suites PASSED (87 overlaps). TypeScript, scoped lint, diff check and AST update PASSED (19,294 nodes/47,419 edges). Native/gzip/source evidence: `evidence/attachment-reset/SOURCE_RECEIPTS.json`. Real UI providers, mocked API/session and synthetic blobs only; no real file deletion or native browser/device/full security/release acceptance.
Same-application competing preview ordering has separate reproduced follow-up tests. Existing Next build and final A3/I18N/security/release gates remain open. Rollback: revert only this source commit; no data/schema change.
@@ -0,0 +1,60 @@
{
"sourceCommit": "2affeaca68fa0cf191f1c57edb7cce2b0ac36e5b",
"sourcesLfSha256": {
"job-tracker-ui/src/attachment-action-lifetime.test.tsx": "8747dfa8f4e1727ee34c21460ff222ae0fe7034186e4d7e0bbfea4a600b4561e",
"job-tracker-ui/src/components/Attachments.tsx": "0d3b4368337022b9a2f62122008a8f7aac728a450563d201cfbfd75f5c461d8b"
},
"evidenceLfSha256": {
"red.json": "acd26f6adbe28fb3a94a0ef72ea916a16cef8705ba9d9149552a4b0bfe286853",
"red.txt": "90dfe1b1cc2d1c87e760c96aa1a1d81e41e43c4d4c6de0892eaf0fc80bda892b",
"green.json": "032e2749e872acf3db82102b2581d90fa1ce5f1b87ea44e6c62fed4cc7a1d440",
"green.txt": "d3159b81aff2e4fc9df2761c69ccaa5741676a09c6349fb450d5d5c551296cfe",
"typecheck.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"lint.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"graph.txt": "89d506b676f9e0bdd0516d805e7b0813a885f842844363e55e6a423dd04d575a"
},
"nativeReceipts": [
{
"path": "red.json",
"gzipPath": "red.json.gz",
"rawSha256": "acd26f6adbe28fb3a94a0ef72ea916a16cef8705ba9d9149552a4b0bfe286853",
"gzipSha256": "57990ef835975f3e29c47f7f99ab749d28e6d7be897eff27ae3c5f63fb49dd84"
},
{
"path": "red.txt",
"gzipPath": "red.txt.gz",
"rawSha256": "fc04d71a99f9858231832dd7900a36acf6ca8661ebfd0bb44e78d9d0807c5845",
"gzipSha256": "2e38d828f2ef478630319e89a3f625e28473a7ab40436cf70f75a44b910e3e40"
},
{
"path": "green.json",
"gzipPath": "green.json.gz",
"rawSha256": "032e2749e872acf3db82102b2581d90fa1ce5f1b87ea44e6c62fed4cc7a1d440",
"gzipSha256": "b8ce03194e4af837c129198614085ff3c7853417d99764af9cfa50750c803f95"
},
{
"path": "green.txt",
"gzipPath": "green.txt.gz",
"rawSha256": "5f95bb833d9b93193ff87d5886d6c1912d0b450750685783197e3bea4b7795f6",
"gzipSha256": "d05738e9d2cf17bfc7f89ca4a6a42a484ef65466e93d9f2944c32b2830b64267"
},
{
"path": "typecheck.txt",
"gzipPath": "typecheck.txt.gz",
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
},
{
"path": "lint.txt",
"gzipPath": "lint.txt.gz",
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
},
{
"path": "graph.txt",
"gzipPath": "graph.txt.gz",
"rawSha256": "f806ffe472315035706e8f559ef6ef9c51024648d66d76bc1d5d7cc2e5ea11c4",
"gzipSha256": "c7fe5a7c6e1a4f5a7532cb6cb3e4d996892f0a0e36e3e2e4ce7181d7ecf0d73e"
}
]
}
@@ -0,0 +1,18 @@
Re-extracting code files in . (no LLM needed)...
[graphify watch] 619 file(s) not classified (no supported extension or shebang), skipped: .dockerignore, .env.example, .git, .gitattributes, .gitignore, 1440-en-dark-converted.gz (+613 more)
AST cache: 2561/3010 files served from cache (85%); 449 to extract
AST extraction: 100/449 uncached files (22%) [16 workers]
AST extraction: 200/449 uncached files (44%) [16 workers]
AST extraction: 300/449 uncached files (66%) [16 workers]
AST extraction: 400/449 uncached files (89%) [16 workers]
AST extraction: 449/449 uncached files (100%) [16 workers]
warning: 8 .sql file(s) contributed nothing to the graph because a dependency is missing: tree_sitter_sql not installed. Install it with: pip install "graphifyy[sql]" (#1745)
warning: 144 code file(s) yielded no symbols (0.14 MB) — a data file, or source this extractor models no symbols for: JobTrackerApi.Tests/PdfBrowserStub/Program.cs, JobTrackerApi/Program.cs, JobTrackerApi/Properties/AssemblyInfo.cs, browser-extension/tests/capture-url.test.mjs, docs/audits/2026-09-07/validation/evidence/b05-excel-probe.ps1 (+139 more)
[graphify watch] community set changed since labeling (0 saved labels, 1138 communities now; renamed 101 community(ies) by their hub). Run `graphify label` to refresh names with the LLM.
Graph has 19294 nodes (above 5000 limit). Building aggregated community view...
graph.html written (aggregated: 1138 community nodes, 3137 cross-community edges)
Tip: run with --obsidian for full node-level detail.
[graphify watch] Rebuilt: 19294 nodes, 47419 edges, 1138 communities
[graphify watch] graph.json, graph.html and GRAPH_REPORT.md updated in graphify-out
Code graph updated. For doc/paper/image changes run /graphify --update in your AI assistant.
Tip: set GEMINI_API_KEY or GOOGLE_API_KEY to use Gemini for semantic extraction.
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
Test Suites: 4 passed, 4 total
Tests: 89 passed, 89 total
Snapshots: 0 total
Time: 19.927 s
Ran all test suites matching src/attachment-action-lifetime.test.tsx|src/attachments.test.tsx|src/dialog-text.test.tsx|src/file-picker-activation.test.tsx.
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\attachment-reset-green.json
File diff suppressed because one or more lines are too long
@@ -0,0 +1,188 @@
FAIL src/attachment-action-lifetime.test.tsx (7.537 s)
● switching application clears old attachment actions while the next list is pending
expect(element).not.toBeInTheDocument()
expected document not to contain element, found <button class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-colorPrimary css-ex68ib-MuiButtonBase-root-MuiButton-root" tabindex="0" type="button">Recorded.pdf</button> instead
220 | mockedApi.get.mockReturnValueOnce(next.promise);
221 | await act(async () => { view.rerender(page(77)); });
> 222 | expect(screen.queryByText(file.fileName)).not.toBeInTheDocument();
| ^
223 | expect(screen.queryByRole('button', { name: `Delete: ${file.fileName}` })).not.toBeInTheDocument();
224 | await act(async () => next.resolve({ data: [{ ...file, id: 77, fileName: 'Next.pdf' }] }));
225 | expect(await screen.findByText('Next.pdf')).toBeVisible();
at Object.toBeInTheDocument (src/attachment-action-lifetime.test.tsx:222:49)
● switching application closes and releases its already-open attachment preview
expect(element).not.toBeInTheDocument()
expected document not to contain element, found <div aria-labelledby="_r_j_" aria-modal="true" class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthMd MuiDialog-paperFullWidth css-1peo4km-MuiPaper-root-MuiDialog-paper" role="dialog" style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"><h2 class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-1c7yqfx-MuiTypography-root-MuiDialogTitle-root" id="_r_j_">Preview: Recorded.pdf</h2><div class="MuiDialogContent-root css-gjjto8-MuiDialogContent-root"><iframe src="blob:previous-application" style="width: 100%; height: 560px; border: 0px; border-radius: 12px;" title="Preview: Recorded.pdf" /></div><div class="MuiDialogActions-root MuiDialogActions-spacing css-15fu35s-MuiDialogActions-root"><button class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root" tabindex="0" type="button">Download</button><button class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root" tabindex="0" type="button">Close</button></div></div> instead
Ignored nodes: comments, script, style
<html
lang="en"
>
<head>
<meta
content=""
name="emotion-insertion-point"
/>
</head>
<body
style="padding-right: 1024px; overflow: hidden;"
>
<div
aria-hidden="true"
>
<div
class="MuiBox-root css-0"
>
<div
class="MuiBox-root css-1owejxv"
>
<div
class="MuiBox-root css-0"
>
<p
class="MuiTypography-root MuiTypography-body1 css-1v8ok63-MuiTypography-root"
>
Attachments (1)
</p>
<p
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
>
Upload resumes, cover letters, portfolios, and supporting files for this application.
</p>
<div
class="MuiBox-root css-x2j9i8"
>
<div
class="MuiChip-root MuiChip-outlined MuiChip-sizeSmall MuiChip-colorDefault MuiChip-outlinedDefault css-1w2bku1-MuiChip-root"
>
<span
class="MuiChip-label MuiChip-labelSmall css-19m61dl-MuiChip-label"
>
0 images
</span>
</div>
<div
class="MuiChip-root MuiChip-outlined MuiChip-sizeSmall MuiChip-colorDefault MuiChip-outlinedDefault css-1w2bku1-MuiChip-root"
>
<span
class="MuiChip-label MuiChip-labelSmall css-19m61dl-MuiChip-label"
>
1 PDFs
</span>
</div>
<div
class="MuiChip-root MuiChip-outlined MuiChip-sizeSmall MuiChip-colorDefault MuiChip-outlinedDefault css-1w2bku1-MuiChip-root"
>
<span
class="MuiChip-label MuiChip-labelSmall css-19m61dl-MuiChip-label"
>
Max 10 MB each
</span>
</div>
</div>
</div>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary css-74b9is-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
<span
class="MuiButton-icon MuiButton-startIcon MuiButton-iconSizeSmall css-d8i980-MuiButton-startIcon"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-1umw9bq-MuiSvgIcon-root"
data-testid="CloudUploadOutlinedIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"
/>
</svg>
</span>
Upload
</button>
<input
hidden=""
multiple=""
type="file"
/>
</div>
<div
class="MuiBox-root css-497k9w"
>
<p
class="MuiTypography-root MuiTypography-body1 css-1g7ym63-MuiTypography-root"
>
Drag and drop files here
</p>
<p
class="MuiTypography-root MuiTypography-body2 css-1moljxt-MuiTypography-root"
>
or use the upload button to choose documents from your device.
</p>
</div>
<span
aria-atomic="true"
aria-live="polite"
class="MuiBox-root css-ty8jgw"
role="status"
>
Content loaded.
</span>
<div
aria-label="Attachments (1)"
class="MuiTableContainer-root css-1sde01b-MuiTableContainer-root"
role="region"
tabindex="0"
>
<table
aria-label="Current documents"
class="MuiTable-root css-1ii7ygr-MuiTable-root"
>
<thead
class="MuiTableHead-root css-1a7iywq-MuiTableHead-root"
>
<tr
class="MuiTableRow-root MuiTableRow-head css-1xtozoh-MuiTableRow-root"
>
<th
class="MuiTableCell-root MuiTableCell-head MuiTableCell-sizeSmall css-10umtgd-MuiTableCell-root"
scope="col"
>
Name
</th>
<th
class="MuiTableCell-root MuiTableCell-head MuiTableCell-sizeSmall css-vgdc2f-MuiTableCell-root"
scope="col"
>
...
238 | expect(await screen.findByTitle(`Preview: ${file.fileName}`)).toHaveAttribute('src', 'blob:previous-application');
239 | await act(async () => { view.rerender(page(77)); });
> 240 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
| ^
241 | expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:previous-application');
242 | } finally {
243 | view.unmount();
at toBeInTheDocument (src/attachment-action-lifetime.test.tsx:240:66)
at runWithExpensiveErrorDiagnosticsDisabled (node_modules/@testing-library/dom/dist/config.js:47:12)
at checkCallback (node_modules/@testing-library/dom/dist/wait-for.js:124:77)
at checkRealTimersCallback (node_modules/@testing-library/dom/dist/wait-for.js:118:16)
at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:579:19)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 56 skipped, 58 total
Snapshots: 0 total
Time: 8.432 s
Ran all test suites matching src/attachment-action-lifetime.test.tsx with tests matching "switching application".
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\attachment-reset-red.json