Repository navigation
test(file-viewer): wait for the broken inline image fallback before acting - #2437
Conversation
Co-authored-by: sisyphus-dev-ai <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Image loading and file-action checks scripts/file-viewer-regression.ts |
The test eagerly loads the current image and each rendered image in the broken-image case. It waits for the file action and checks clickability with a trial click. |
Keyboard activation of notes links scripts/file-viewer-regression.ts |
The test activates notes links with Enter in six scenarios. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- devswha/ovis#2435: Adds local Markdown images and image-failure fallbacks to the same file-viewer regression fixture.
Suggested reviewers: cheol-95
Merge Risk: 
Minimal · up to 7b46f
-
The test-only synchronization changes do not introduce a merge-blocking risk.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: a test-synchronization fix in scripts/file-viewer-regression.ts that waits for the broken inline image fallback before acting. It is specific, single-sentence, and matches the summary and objectives. The title uses the conventional test(scope) prefix and is 74 characters, within a typical length limit.
Full details: Description check
-
Explanation
The description follows the repository template. It has a Change section that explains the problem (regression synchronization exposed by
#2435), the scope (only scripts/file-viewer-regression.ts, no product change, no changelog fragment), and the specific edits. It also has a Validation section listing the commands run (bun install, unchanged-main runs, probes, five consecutive full runs, bun run check fast, git diff --check), their results, and the checks skipped (full integration suite, other browser scripts, Native Windows and macOS). The template's reference to changelog.d/ is addressed by the explicit 'no changelog fragment' statement. Some sections are long and dense, and the Change section does not state a linked issue, but the template requires one only for features, and this is a test-only fix. The description is mostly complete.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merging 7b46f7f (test-only: main CI was red on 4c62f57, scripts/file-viewer-regression.ts failing twice). Root cause: the #2435 step scrolled the broken image's transient viewer button, which the fallback replaces (a lazy image could also be remounted before it loaded), and the file-preview history steps clicked the notes link while reloaded images could still move the transcript between pointer down and up. The steps now arm the wait for the fallback before loading, act on the fresh node, load the test images eagerly, and open the file by keyboard (these steps check presentation and history, not pointer targeting). Checked in a real browser that the product does not flicker: a MutationObserver counted exactly one opener-to-fallback replacement and no fallback remount on a failed-stat retry. A deterministic mutation makes the old step fail and the new one pass; 5 consecutive full runs pass (65 cases each) and check fast passes. No CodeRabbit review needed for a test-only change. LOW, noted for a follow-up: the transcript can still shift under a pointer while chat images reload (why the history steps now use the keyboard); worth a look for layout stability with many inline images. |
## Release 0.4.21 The release PR, prepared by step 1 of [docs/development.md#releasing](https://github.com/devswha/ovis/blob/main/docs/development.md#releasing), now re-folded on main `1ef6ea329108a0985b823e8235b03daddcd0a5f4` after the owner held 0.4.21 for more work. The merge pass reported the 0.4.21 queue empty. **Do not merge yet:** the owner judges the final build before release. No tag and no Release run from this PR's author. - **Version:** `version` is 0.4.21 in `package.json` and `herdr-plugin.toml`. - **Changelog:** `bun scripts/changelog-fold.ts 0.4.21 2026-10-30` folded 63 fragments into the 2026-10-30 section of `CHANGELOG.md` (71 entries), linked their PRs and deleted the fragments; `changelog.d` holds only `README.md`. - `by @login` on every outside contributor's PR link: #2361 @eddieparc, #2333 @IdrisGit, #2355 @imurfutur3, #2341 @sulthonzh, #2359 @YuuuXie, #2377 @IdrisGit, #2269 @CharleoYang, #2405 @jpcarranza94, #2414 @homebodify, #2417 @cheol-95, #2418 @eddieparc, #2435 @cheol-95. - Two outside PRs had no fragment and got an entry by hand: #2341 (OpenCode background commands, Added) and #2359 (installer test timing, Maintenance). - Issue reporters are credited in their entries: @blaker3115-Agri (#1488), @Hyd3-14 (#2026), @osamahbeig (#2343), @Shunamxiao (#2329), @matiemer (#2362), @kilhyeonjun (#2344), @eddieparc (#2360), @Ploppy3 (#2236), @sulthonzh (#2340), @WOULDU-pres (#2056), @odfalik (#2038), @aNNdii (#511), @Noobear (#2281, fixed by #2424); #2435 fixes @cheol-95's own #2434. - Two fragments ran past the changelog's width (#2418, #2269); their entries are re-wrapped, words unchanged. #2382's entry reads "OpenCode's installer puts its folder first" (reviewed earlier on this PR). - Maintainer PRs without a fragment and without a user-facing change have no entry: #2353 (check tool), #2371 (guide docs), #2396 and #2397 (tests), #2403 and #2433 (server and client transport seams, no behaviour change), #2437 (test-only fix for #2435's check). #2438's own entry (the sidebar selection marked by its fill again) is dropped: the stroke #2352 added never shipped, so users see no change; #2352's entry keeps only the Windows high-contrast Highlight bar. - **Release summaries:** en, ko, ja and zh each have 5 new, 5 improved and 5 fixed lines. Since the first review: New lists the in-browser Claude Code / Codex sign-in (#2428) in place of the tab/workspace shortcut line; Improved lists Settings → Agents (#2427) in place of the sidebar fold line; Fixed lists the Codex wrong-session fix (#2426, #2430) in place of the phone screenshot paste line. The Artifacts and Claude status-line lines keep their reviewed wording (turned on in Settings). Not in 0.4.21: #2420 (Codex chat behind Kiro), #2065 (Portal sign-in) and #2436 (relay foundations) stay open for a later release. - **Remote bundle:** `REMOTE_BUNDLE_VERSION` rises from 39 to 40 because the bundle inputs (`server/`, `shared/`, `patches/`) changed since remote-v39. After merge: push `remote-v40` on the merged commit and wait for the Remote PC bundles workflow before running Release. - **iOS:** `CURRENT_PROJECT_VERSION` stays 3 (#2370 changed `Info.plist`; build 3 is not known to be uploaded yet). ## Validation - `bun scripts/release-guards.ts --base v0.4.20`: "Release 0.4.21: remote bundle, telemetry Worker and release metadata are in order." - `dori heavy … bun run check fast` on this branch: workflow syntax, generated types and themes, typecheck, build, unit tests all ok. Unit: 9166 pass, 0 fail, 36 skip in 591 files. - Every PR in `v0.4.20..main` was pre-run for the owner's hands-on guide on isolated copies (own herdr session, fresh state, never the owner's live session). Items that need a real device (iPhone tap dictation #2370, dictation keyboards #2386, the installed desktop app's title-bar overlay #2381) are left for the owner's final check. This is a release-metadata PR: it changes no code path. Per the release steps, merge it after CI and the owner's go, then push `remote-v40`, wait for its bundles, and run Release with `0.4.21`.
Change
Fix the browser regression synchronization introduced/exposed by #2435, with no product changes and no changelog fragment. Only scripts/file-viewer-regression.ts changes.
Product flicker and root cause
No extra product failure swap found. A pre-navigation MutationObserver probe on main 4c62f57 recorded, for one mounted inline decode failure: pending alt span -> image viewer button containing img -> final file button. That is 2 replacements including pending, exactly 1 replacement after the img/opener exists, with no extra intermediate control after the opener and no fallback -> opener -> fallback bounce. Initial follow/virtualization/skill-driven remounts produced distinct wrapper identities; those are separate mounted lifecycles, not a second failure swap within MarkdownImage. A missing-file stat failure never created an image opener: the pending span becomes the unavailable group containing the file action and Try again; retry retained the exact same file-action DOM node (0 fallback remounts).
MarkdownImage's successful stat renders ReservedImage. A byte/decode error sets failedUrl, and the parent selects Inline's file fallback. The old test used the shared accessible name before that transition, so scrollIntoViewIfNeeded could await stability on the soon-to-be-detached opener. Lazy loading plus follow/late transcript remounts could instead leave the expected fallback unloaded.
Fail-first mutation evidence
A temporary extracted real-browser fixture held the corrupt broken.png response behind an event gate and animated the opener so its pre-error state could not pass the stability check. It started the old getByRole(button, Chat broken inline).scrollIntoViewIfNeeded(), advanced animation frames, then released the corrupt bytes: FAIL, Element is not attached to the DOM, while waiting for the element to be stable (check report 995cc8fa-062b-423e-a865-823e179be043). The new fallback-first sequence under the same byte gate and animation passed both the failed-image and adjacent image-viewer cases (a55a6ca5-f702-490e-a5b7-b78f59ec0b31). No fixed sleep was used; temporary probes were removed.
Actual main CI notes timeout
Inspected run 41036856514 / job 123999785358. Both CI attempts failed before the default-text-popup PASS, waiting for notes.txt / File preview history regression immediately after setFileOpen(null)'s reload. The image-sheet checks occur much later and use their own page, so their forward entries cannot leak backward into this wait. No product history mutation was found.
The unchanged full script reached and passed the broken-image case twice locally; another baseline stopped earlier at a large-source wait. A held-image browser probe with pointer down/up across image loading reproduced the same notes dialog-content timeout with no file-preview history entry; keyboard activation passed with the same held-image fixture. This demonstrates the coordinate/follow-layout failure mode, not proof of the exact event ordering in the historical CI run. During full validation, a second notes pointer activation after a later reload also timed out waiting for the panel; converting the notes history activations consistently removed that dependency. This is test synchronization/isolation, not a product history fix.
Validation
All heavy commands ran through dori heavy fvfix, sequentially in the dedicated worktree.