Skip to content

test(web): await attachment previews in bounded fixtures - #513

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/rtf-preview-test-readiness
Oct 27, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/rtf-preview-test-readiness

Conversation

@lastobelus

@lastobelus lastobelus commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Attachment browser tests failed in CI. Lazy viewers and real workers were still preparing their output when the tests asserted on it. The table-heavy Word fixture also had no bounded preview viewport. It grew past ten thousand pixels, so viewport rendering did nothing and the 100-report-section case exceeded the test ceiling.

CI evidence points to test readiness and fixture sizing. No product bug is proven.

What changed (tests only)

  • The Word preview gets a bounded, scrollable host. The test waits for page mounting before scrolling to the final report text.
  • Notebook output frames and the RTF and EPUB document iframes are now awaited with browser assertions.

Coverage kept

  • Both Word report sizes
  • The 2.5 MB media fixture
  • Real format workers
  • Content assertions
  • Notebook output limits and scrolling

Production code is unchanged. No timeouts, retries, skips, or mocks were added.

Validation

The selected cases, full file, and changed-file checks used Node 26.12.1.

  • All six selected Word, notebook, RTF, EPUB, and ODS cases passed.
  • The complete attachment browser file passed 130/130.
  • check:changed against origin/lastcode/main passed, including another 130/130 pass of that file.
  • The normal pre-push Quick CI also passed on the exact head and base using its configured Node 24.13.1 runtime.

Fixes #512.

Implemented with gpt-6.1-sol through the Codex harness in LastCode.

Use the document iframe title and expected srcdoc with the browser assertion so real worker conversion and lazy viewer loading can complete before checking RTF and EPUB content.

Carry-Group: upstream-bugfixes
Carry-Fix: #512
Carry-Observation: Keep the real conversion worker and document content assertions while awaiting the rendered iframe through browser readiness.
Run table-heavy reports in a scrollable preview viewport and wait for page mounting before navigating to the final report text. Await saved notebook output frames through browser assertions while preserving output limits and real worker conversion.

Carry-Group: upstream-bugfixes
Carry-Fix: #512
Carry-Observation: Unbounded Word fixtures expanded beyond ten thousand pixels and defeated viewport rendering; notebook output mounting also exceeded the short default wait under CI load.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T00:52:58.287510Z ace3021 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: ace3021eea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit e25d102 into lastcode/main Oct 27, 2026
18 checks passed
@lastobelus
lastobelus deleted the lastcode/rtf-preview-test-readiness branch October 27, 2026 01:03
lastobelus added a commit that referenced this pull request Nov 26, 2026
## Problem

`AttachmentFilePreview.browser.test.tsx` had drifted further from upstream than LastCode needs. Upstream [pingdotgg#31104](https://redirect.github.com/pingdotgg/t3code/pull/31104), pinned at `7f6f47b27b44456f1c8214d3b566b375c09f629e`, added PDF parsing-readiness waits and deliberately removed older reload tests. LastCode's carried commits (downstream changes replayed onto upstream) had brought those tests back. This adds maintenance work when syncing with upstream.

## Change

- **PDF tests:** restores upstream's parsing-readiness scenario, including its worker-reuse assertion in the kept reload test.
  - **Retired:** the old first-page zoom, scroll-clamping (shrunk or removed pages) and fit-width reload coverage.
  - **Still covered:** page, page-relative offset, zoom, and reset for a different file.
- **Image retry:** renders first, then awaits the actual lazy module inside React `act`, under the existing test deadline. It no longer preloads the module before rendering. It then checks the error and retry result with semantic assertions.

This removes a net 202 lines. Against upstream baseline `bf961f8121c6336915ecf7b3f97ce6e68ab38fd7`, the file's diff shrinks from 289 additions and 75 deletions to **85 additions and 73 deletions**.

### Remaining upstream differences

1. **Select keyboard focus:** options can be visible before the select's deferred focus transfer. The test waits for focus before and after `ArrowDown`, then presses `Enter`. This keeps a recovery timing fix.
2. **Image retry readiness:** the lazy-module wait and semantic error and retry assertions described above address a recorded Full CI cold-import flake.
3. **Workspace preview API:** tests import `WorkspaceBrowserPreview` from its extracted module and pass its required `revision` prop. The exact upstream baseline failed four workspace preview tests because the expected export was missing.
4. **HTML reload behavior:** two tests expect an explicit reload to request a newly authorized URL, matching LastCode. Commands, file changes and automatic URL renewals do not replace a loaded page on their own. With only the import adapted, the PDF coverage passed but both HTML tests failed.
5. **Document readiness:** notebook, RTF, EPUB and ODS tests keep their semantic readiness waits for CI failures documented in [#513](#513) and [#515](#515).

The other historical repairs have already converged upstream.

## Scope

This changes one browser test file to reduce upstream drift. It makes no production, deadline, retry, skip or mock changes.

The source commit has one `incubator` carry-group trailer. Its cleanup overlaps later API and recovery integrations in the same fixture hunks, so it must replay after them.

## Verification

- **Image retry:** the selected test passed.
- **Browser tests:** the full file passed, 88/88.
- **Changed-file checks:** format, lint, knip and affected typechecks passed.
- **Quick local CI:** passed on exact head `d26905e8fbc47684b690c99e5dbb040ce79fe4c2` with base `917ed2e7bbd4393775cf76d682f998029f0fdccf`.
- **Carry compilation:** same-base compilation passed before the final image-only correction. GitHub will revalidate the final version.

Local review: 2 rounds with gpt-6.1-terra (xhigh) at d26905e, approved.

Implemented by GPT-6.1 Sol through the Codex harness.

Carry-Source-Ref: refs/lastcode/carry-sources/pr-870/d26905e8fbc47684b690c99e5dbb040ce79fe4c2
Carry-Source-Base: 917ed2e
Carry-Source-Head: d26905e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(web): investigate attachment preview readiness failures in CI

1 participant