Skip to content

Open a received image in full screen; add React to image messages (ADR-0060 amendment, needs owner approval) - #125

Merged
James-Chapman merged 2 commits into
mainfrom
claude/image-viewer-fullscreen
Dec 3, 2026
Merged

James-Chapman merged 2 commits into
mainfrom
claude/image-viewer-fullscreen

Conversation

@James-Chapman

@James-Chapman James-Chapman commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The received-image viewer from #122 never went full screen on any platform: it was a modal <dialog> sized to the window. It now opens in full screen. Image messages also get a React button, with quick reactions and reaction chips under the image.

What changed

  • ImageViewer.svelte opens in full screen with the DOM Fullscreen API. The full-screen element is a new .image-viewer-frame inside the dialog, because the API refuses a dialog element. Escape or the bar's new Full screen / Exit full screen button returns it to the window. A second Escape or Close closes it, and closing always leaves full screen. Where full screen is refused, the viewer fills the window as before. Its position: fixed; inset: 0 now comes from our CSS, not the web view's dialog styles.
  • App.svelte reports every fullscreenchange with the new setMainFullscreen(on). The host's set_main_fullscreen { on } mirrors set_call_fullscreen: host-only, never relayed to the core, main window only, and it acts on Windows only. Both now share set_window_fullscreen. capabilities/main.json grants it; the call window is refused.
  • fullscreen.ts adds leaveFullscreen. The dialog's cancel handler and its teardown use it.
  • Image messages: Timeline.svelte adds React before Reply in the image's action bar and keeps one image's quick reactions open at a time. The new Reactions.svelte draws the picker and the chips for Message.svelte and ImageMessage.svelte with the same markup. The page already counted reactions to images but never showed them. Reply, Pin and Report are unchanged.
  • ADR-0060 amendment of 3 December 2026 (proposed), plus frontend/AGENTS.md and src-tauri/AGENTS.md.

Why it changed

The owner reported that the image popout does not go full screen on Linux (at least Wayland), and that it should be full screen, not full window. The cause: nothing ever requested full screen. On Windows, wry leaves WebView2's full-screen event unhandled, so the host must do it, as it already does for the call window's screen share. The owner also asked for a React button on image messages.

Evidence, from WebKitGTK 2.52.6 (webkit2gtk-4.1, as wry uses) on Linux Mint 22.3, run as a real Wayland client of a headless Weston 13. The harness mounts the real Timeline.svelte inside the app's main/.shell/.pane/.room-view/.room-main ancestors, with a stubbed IPC:

  • Before: the viewer was a 1000×700 modal in a 1000×700 window on a 1280×800 output, and document.fullscreenElement stayed null. The same held at interface zoom 0.8, 1 and 1.25.
  • After: a synthesized GTK pointer click on the image (a real user gesture) emits WebKit's enter-fullscreen. GTK reports the window FULLSCREEN at 1280×800, with the frame at 1280×800. The first Escape (a synthesized GTK key event) emits leave-fullscreen and keeps the viewer at 1000×700. The second Escape closes it. Close from full screen restores the window.
  • dialog.requestFullscreen() rejects with TypeError; a <div> inside the modal dialog is accepted.
  • React opens six quick reactions under the image, and picking one calls onreact('$i', '👍').

Not reproduced: the report that on Linux the viewer does not even fill the window. In this WebKitGTK it filled the window at every zoom tried. The user's WebKitGTK version, GPU compositing or compositor may differ. Full screen avoids depending on the windowed layout, and the explicit inset: 0 is hardening, not a proven fix.

Not tested by hand: a real GNOME or KDE Wayland session, X11, Windows (WebView2 plus the host's set_fullscreen) and macOS. In the headless Weston picture the full-screen surface sits offset under Weston's panel. A plain GTK 3 window with gtk_window_fullscreen() lands in the same place, so that is Weston's placement.

Tests

Updated

  • src-tauri/tests/ipc.rs: the main capability list pins allow-set-main-fullscreen, and the call window is refused set_main_fullscreen.
  • frontend/tests/bridge-calls.test.mjs: setMainFullscreen(true/false) sends set_main_fullscreen { on }.

New

  • src-tauri/tests/ipc.rs: GIVEN the main window WHEN it asks for full screen THEN the host takes it and relays nothing. Bad on values, the call window and a remote origin are refused.
  • frontend/tests/fullscreen.test.mjs: leaveFullscreen exits only when the element holds full screen, says whether it did, and swallows a refused exit.
  • frontend/tests/room-controls.test.mjs: an image offers React before Reply, a file does not, and its reactions render as isolated chips, most used first, with our own pressed. Without onreact there is no React button, but the chips still show, disabled.

Run on Windows: python tools/dev.py frontend (svelte-check 0 errors, build, 726/726 Node tests), cargo fmt --all -- --check, and cargo test --locked -p persephone-desktop (39 unit tests and 51 IPC tests pass). The full python tools/dev.py check and the workspace tests with --no-fail-fast ran too (results). Every step passes except 18 media-worker tests, which fail on this host's Rust 1.100.1 because the test executables moved; CI pins 1.99.1, and they pass once the worker is placed where they look.

🤖 Generated with Claude Code

CodeRabbit summary

  • Image viewer full screen: The viewer requests full screen on .image-viewer-frame, because dialog.requestFullscreen() is rejected in the tested WebKitGTK environment while a child <div> is accepted.
  • Exit behavior: Escape or the Full screen / Exit full screen button leaves full screen and keeps the viewer open. A second Escape or Close closes the viewer. Closing also exits full screen.
  • Fallback: If full screen is refused, the viewer fills the window using position: fixed; inset: 0.
  • Windows support: The main window calls setMainFullscreen(on) on each fullscreenchange. WebView2 needs this host-side handling. The new set_main_fullscreen command is host-only, not relayed to the core, limited to the main window, and acts only on Windows. It shares set_window_fullscreen with set_call_fullscreen.
  • Image reactions: Image messages show a React action before Reply, quick reactions, and reaction chips. A shared Reactions.svelte component renders these for image and text messages, which removes duplicated markup. Timeline.svelte keeps only one image's quick-reaction picker open at a time.
  • Tests added: Frontend tests cover leaveFullscreen, the bridge call, and image reactions. Rust IPC tests cover the permission and the set_main_fullscreen argument checks.
  • Docs: The ADR-0060 amendment and the AGENTS.md files describe the new behavior.
  • Verification (author-reported): Manual test on WebKitGTK 2.52.6, Linux Mint 22.3, headless Weston. Windows, macOS, GNOME/KDE Wayland, and X11 were not tested by hand. python tools/dev.py frontend, cargo fmt --all -- --check, and cargo test --locked -p persephone-desktop passed. The full python tools/dev.py check was still running.

The image viewer never asked for full screen on any platform: it was a
modal dialog sized to the window. It now opens in full screen with the DOM
Fullscreen API. The full-screen element is a frame inside the dialog,
because the API refuses a dialog element (checked in WebKitGTK 2.52).
Escape and the bar's button leave full screen and keep the viewer open in
the window; a second Escape or Close closes it, and closing leaves full
screen. Where full screen is refused, the viewer fills the window as
before, now placed by its own CSS rather than the web view's dialog styles.

On Windows wry leaves the web view's full-screen event unhandled, so the
main window reports each fullscreenchange with set_main_fullscreen { on },
which mirrors set_call_fullscreen: host-only, never relayed, main window
only, Windows only (ADR-0060 amendment of 3 December 2026).

Image messages get React in their action bar, before Reply, with the quick
reactions and the reaction chips under the image. The page already counted
reactions to images but never showed them. Reactions.svelte now draws the
picker and the chips for text messages and images alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 30f1d213-3b86-4353-8389-af23e357ceb7
Commits

Reviewing files that changed from the base of the PR and between 61c977e and 9012684.

Files selected for processing: 21

  • docs/adr/0060-show-calls-in-a-separate-call-window.md
  • frontend/AGENTS.md
  • frontend/src/App.svelte
  • frontend/src/ImageMessage.svelte
  • frontend/src/ImageViewer.svelte
  • frontend/src/Message.svelte
  • frontend/src/Reactions.svelte
  • frontend/src/Timeline.svelte
  • frontend/src/bridge/index.ts
  • frontend/src/calls.ts
  • frontend/src/fullscreen.ts
  • frontend/src/style.css
  • frontend/tests/bridge-calls.test.mjs
  • frontend/tests/fullscreen.test.mjs
  • frontend/tests/room-controls.test.mjs
  • src-tauri/AGENTS.md
  • src-tauri/build.rs
  • src-tauri/capabilities/main.json
  • src-tauri/permissions/autogenerated/set_main_fullscreen.toml
  • src-tauri/src/lib.rs
  • src-tauri/tests/ipc.rs

No actionable comments were generated in the recent review.

Walkthrough

The PR adds fullscreen support for the main-window image viewer, including host-side handling and fullscreen state reporting. It also adds quick-reaction and counted-reaction controls to image messages through a shared reaction component.

Changes

Image viewer fullscreen

Layer / File(s) Summary
Host fullscreen command and permissions
src-tauri/src/lib.rs, src-tauri/build.rs, src-tauri/capabilities/main.json, src-tauri/permissions/autogenerated/set_main_fullscreen.toml, src-tauri/tests/ipc.rs, src-tauri/AGENTS.md
A shared helper applies fullscreen by window label on Windows. The main-window command is registered and permitted for the main window; IPC tests cover accepted and refused requests.
Fullscreen image viewer
frontend/src/ImageViewer.svelte, frontend/src/style.css, docs/adr/0060-show-calls-in-a-separate-call-window.md, frontend/AGENTS.md
The viewer uses a fullscreen-capable frame, adds a fullscreen control, and exits fullscreen on Escape or cleanup. Its layout fills the window when fullscreen is unavailable or refused.
Fullscreen state reporting
frontend/src/App.svelte, frontend/src/bridge/index.ts, frontend/src/fullscreen.ts, frontend/src/calls.ts, frontend/tests/bridge-calls.test.mjs, frontend/tests/fullscreen.test.mjs
The main page reports fullscreen changes through the bridge to the host command. Tests cover bridge arguments and fullscreen exit behavior.

Image message reactions

Layer / File(s) Summary
Shared reaction rendering
frontend/src/Reactions.svelte, frontend/src/Message.svelte, frontend/src/ImageMessage.svelte
The new Reactions component renders quick-reaction choices and counted reactions. Text and image messages pass reaction data and callbacks to the component.
Image reaction controls
frontend/src/Timeline.svelte, frontend/tests/room-controls.test.mjs, frontend/AGENTS.md
The timeline tracks which image’s quick-reaction picker is open and closes it after selection. Tests cover reaction controls on images and files.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ImageViewer
  participant AppSvelte
  participant FullscreenReporter
  participant setMainFullscreen
  participant set_main_fullscreen
  ImageViewer->>AppSvelte: document fullscreenchange
  AppSvelte->>FullscreenReporter: report fullscreen state
  FullscreenReporter->>setMainFullscreen: send on state
  setMainFullscreen->>set_main_fullscreen: invoke host command
Loading

Possibly related PRs

  • OMG-Software/Persephone#94: Introduces the separate call window referenced by the shared ADR and the call-window permission boundary used by the new fullscreen command.

Suggested reviewers: claude, omg-review-bot

Merge Risk: Minimal · previous review 61c97

This change adds a full-screen mode for the received-image viewer and reaction controls on image messages. No concrete merge-blocking risk was identified. Windows, macOS and other Linux setups were not tested by hand.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names two changes that the changeset contains: full-screen opening of the received-image viewer (ImageViewer.svelte, fullscreen.ts, setMainFullscreen, set_main_fullscreen host command) and R…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names two changes that the changeset contains: full-screen opening of the received-image viewer (ImageViewer.svelte, fullscreen.ts, setMainFullscreen, set_main_fullscreen host command) and React actions on image messages (Reactions.svelte, ImageMessage.svelte, Timeline.svelte). It is specific and matches the PR objectives. It is long at 108 characters and it mentions the ADR amendment and the owner-approval note, which are not code changes, but the primary changes are clearly stated.

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: db700c30-e8d3-481a-922f-cfe4548ea592
Commits

Reviewing files that changed from the base of the PR and between ad81af0 and 61c977e.

Files selected for processing: 21

  • docs/adr/0060-show-calls-in-a-separate-call-window.md
  • frontend/AGENTS.md
  • frontend/src/App.svelte
  • frontend/src/ImageMessage.svelte
  • frontend/src/ImageViewer.svelte
  • frontend/src/Message.svelte
  • frontend/src/Reactions.svelte
  • frontend/src/Timeline.svelte
  • frontend/src/bridge/index.ts
  • frontend/src/calls.ts
  • frontend/src/fullscreen.ts
  • frontend/src/style.css
  • frontend/tests/bridge-calls.test.mjs
  • frontend/tests/fullscreen.test.mjs
  • frontend/tests/room-controls.test.mjs
  • src-tauri/AGENTS.md
  • src-tauri/build.rs
  • src-tauri/capabilities/main.json
  • src-tauri/permissions/autogenerated/set_main_fullscreen.toml
  • src-tauri/src/lib.rs
  • src-tauri/tests/ipc.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@omg-review-bot

omg-review-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

✅ Re-review posted on 9012684

  • Started: 2026-12-03 20:26:10 UTC
  • Changes since: 61c977e, the last review
  • Model: chatgpt
  • Review skill: code-change-review

The re-review is posted here.

@omg-review-bot omg-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated review of 61c977e

Bot review number 1 of 30.

No defects found. The fullscreen lifecycle, Windows host bridge, capability restrictions, image reaction rendering, and related tests are consistent with the stated design. Static review only; tests were not run.

No issues found.

✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.

Model chatgpt · skill code-change-review · 21 files reviewed. Reply to an inline comment to discuss it.

@James-Chapman

Copy link
Copy Markdown
Contributor Author

Local check results for 61c977e (Windows 11, Rust 1.100.1)

python tools/dev.py check ran online. It stopped at cargo test --workspace because of a toolchain fault that also affects main (see below). I then ran every later step of check on its own and the workspace tests with --no-fail-fast.

Step Result
cargo fmt --all -- --check pass
Wasm guest build and Clippy (release) pass
cargo test --workspace --exclude persephone-call-worker --all-targets --no-fail-fast 48 binaries: 1508 passed, 13 failed, 11 ignored. The 13 failures are explained below.
src-tauri/tests/ipc.rs (in the run above) 51 passed, including the new set_main_fullscreen test
cargo clippy --workspace --exclude persephone-call-worker --all-targets -D warnings pass
Call worker build, test (344 passed, 3 ignored), Clippy pass
dev-disposable-servers core tests lib 958, account_settings 15 and registration 5 passed. account: 68 passed and 5 failed for the reason below; 73/73 pass once the worker is beside the test.
dev-disposable-servers core Clippy pass
Contract export --check and tsc pass
python tools/dev.py frontend svelte-check 0 errors, 0 warnings; Vite build pass; Node tests 726/726; line coverage 98.78 %
Python tests/servers (2) and tests/tools (152, 2 skipped) pass

The 13 + 5 test failures: test harness and toolchain, not this PR

  • Every failure is worker binary missing at …\debug\build\<package>\<hash>\persephone-media-worker.exe.
    • crates/core/tests/media_worker.rs: 2 failures.
    • crates/media-broker/tests/contained_worker.rs: 11 failures.
    • crates/core/tests/account.rs image tests: 5 failures.
  • These tests find the worker at current_exe().parent().parent(), which assumes test executables are in target/<profile>/deps/. Cargo 1.100 puts them in target/<profile>/build/<package>/<hash>/out/.
  • CI pins RUST_TOOLCHAIN: "1.99.1", so CI is not affected. This host runs stable 1.100.1.
  • To confirm, I copied the built worker to the path each test expects and reran: media_worker 2/2, contained_worker 11/11 and account 73/73 pass. Then I deleted the copies.
  • This PR changes no file under crates/.

Not run here: live homeservers, the native containment gate (sandbox), the OSV audit, and manual tests on GNOME/KDE Wayland, X11, Windows and macOS (see the PR description).

🤖 Generated with Claude Code

Resolve the frontend/AGENTS.md conflict by keeping both sides: this
branch's image actions (react, reply, pin, report; Reactions.svelte) in
the copy-buttons bullet, and main's room-call ring setting (roomCallRing)
in the call-sounds bullet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@omg-review-bot omg-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated re-review of 9012684

Bot review number 2 of 30.

New findings are only on code changed since the last review (61c977e); the rest was reviewed then.

The change is mostly consistent with the existing call-window fullscreen design, but the image viewer can become stuck when the browser refuses an exit from fullscreen. The refusal path is explicitly swallowed, while the dialog cancel event has already been prevented.

No new issues found in this update.

✅ Approved: no unresolved findings at [P3] MINOR (Defect) or above.

Model chatgpt · skill code-change-review · 21 files reviewed. Reply to an inline comment to discuss it.

@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@James-Chapman
James-Chapman merged commit e2a2262 into main Dec 3, 2026
13 checks passed
@James-Chapman
James-Chapman deleted the claude/image-viewer-fullscreen branch December 3, 2026 21:31
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.

1 participant