Repository navigation
Play videos inline in chat and add browser and Finder link actions - #297
Merged
Merged
Conversation
Give each movie link in a finished reply its own paused Rune player, using the Files pane's local and remote streaming sources. Preserve links in prose and the original caption on decode failure. Replace session-chip-only secondary handling with target-specific menus for ordinary web links, local files and directories. Keep the browser policy and existing persistent preference, and clarify its off behavior. Verified on macOS with the desktop build, session-view examples, guardrails, and headless chat input: local, remote workspace and HTTPS playback, independent pause, file/folder actions and external link dispatch across restarts.
Replace the standalone play button with a live timeline, elapsed time and playback controls. Paint the thumb independently of message layout and restore the previous play state when scrubbing finishes. Built the desktop app, checked session-view examples and passed all five guardrails. Verified play/pause, both skips and scrubbing while paused and playing in a 780-frame real-time Studio capture.
Replace the separately sized, always-visible toolbar with an aspect-fit stage. A picture click toggles playback; the full-width timeline and grouped 15-second skips share the Files viewer's idle policy and stay visible for keyboard input. Show the pointed time without seeking. During a drag, paint the thumb from the pointer and sample the existing decoded frame at most once per refresh. Land the final seek before restoring playback and keep message-row layout motion off the timeline. Verified the desktop build, standalone session-view examples and all five guardrails on Mac Studio. Recorded a native drag to 26.90 s, reversal to 19.50 s and playback from release. Checked paused and end-of-clip scrubs, keyboard focus, portrait layout and frame-by-frame thumb alignment.
|
PR test build retired — merged into |
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
… local-path confinement Merges origin/dev (5fed7fc, including #297 918d24f) into browser-ui/sec-a1-file-links: - apps/desktop/src/surfaces/files/reply.rs: reject raw UNC hrefs in target(), replace std::fs::metadata(&path) with browser_policy::verify_local_path(&path) before building the right-click menu, remove OS open_default ("Open file") for outside-workspace files (outside files offer safe Reveal only; inside-workspace files open in the built-in viewer), and guard local video paths with verify_local_path / verify_within_root. - features/files/src/{ops,video}.rs: route local video playback through browser_policy::verify_within_root before handing a local path to rune::Player. - apps/desktop/src/shell/view/session/host.rs & crates/session-view/Cargo.toml: preserve both sides' TimelineHost methods and dependencies.
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
…304) - Fold verified merged PRs #280 (WS-9 crates/browser-extensions, confirmed), #281 (PREVIEWS oc-preview:// + ContextPool::is_tab_ready, confirmed third read + merge check), #297 (inline chat video + reply link menu, not reviewed before merge), #299 (WS-1 close_all_connections crash fix), and #300 (Rune eff95e80: #1304 roving-group rescue + #1291 monochrome SMIL animated icons completing UP-069 / WS-6) - Update browser Reviewed column and note #287 eager-attach time_updated regression on UP-095-TOOLS - Audit upstream anomalyco/opencode 2002222d13..fe8def6854 (+19 commits: 7 skipped, 12 added: UP-123..UP-134)
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
…ideo::Auto) Per READER-12's in-workspace video ruling on dev (Rune eff95e80 with live Windows Media Foundation and macOS AVFoundation backends): - Remove `ReplyVideo::Auto` completely; NO video in an assistant reply ever opens or decodes without an explicit user click (neither inside-workspace nor outside-workspace). - On display, `reply::video` performs zero disk or network I/O and returns only the real sanitized path shown on the Play control (middle-truncated on the button, full path in tooltip and accessibility label; consistent native separators on Windows). - On click, `reply::load_video` verifies inside-workspace files via `verify_within_root` (or remote `/api/fs/read/...`) and outside-workspace local files (local sessions only) via `verify_local_path`, then mounts `#297`'s unchanged player and controls. - `http(s)` web video links stay ordinary links that open in the embedded browser pane.
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
* feat(files): click-to-load control and remote-server address policy for inline reply videos
- `crates/browser-policy/src/remote_url.rs` & `lib.rs`: add `is_public_http_url` (refusing
credentials, percent/non-ASCII host obfuscation, single-label hosts, local/internal/metadata
DNS suffixes, alternate IPv4 notations, and all non-globally-routable IPv4/IPv6 ranges
including loopback, RFC 1918, CGNAT, link-local/IMDS `169.254.0.0/16`, and ULA `fc00::/7` /
`fd00:ec2::254`) and `sanitized_http_host`.
- `crates/session-view/src/video.rs`, `video/transport.rs`, `lib.rs`: add `ReplyVideo::{Auto,
OnClick}` and explicit `Slot::{Starting, Active}` state machine in `Clips`; verified
in-workspace clips keep auto-loading while outside-workspace local clips and `http(s)` URLs
render a click-to-load Play control under the link and construct `Player` (with `#297`'s
unchanged player stage and controls) only after user click and host verification.
- `apps/desktop/src/surfaces/files/reply.rs` & `shell/view/session/host.rs`: perform zero
outside-disk or network I/O on display; verify outside local paths via `verify_local_path`
and remote-server `http(s)` URLs via `is_public_http_url` on click (reporting refusals via
toast).
- `crates/opencode-i18n/locales/rune/en.json`: add `rune.video.localFile`,
`rune.video.playInline`, and `rune.video.remoteBlocked`.
* fix(files): drop OS-stack web video click-to-load, disclose real local path on Play control, and keep reference-link controls inline
Per READER-12's review of #307:
- Remove `crates/browser-policy/src/remote_url.rs` (and its exports), `web_video_url` / `Link::Web`
inline video handling in `apps/desktop/src/surfaces/files/reply.rs`, and `rune.video.remoteBlocked`
/ `rune.video.localFile` strings. `http(s)` video links stay ordinary links and open in the
embedded browser pane (enforcing `browser_policy`, remote `TunnelProxy`, isolated storage, and
sandboxed decoders).
- Disclose the real sanitized local path on `ReplyVideo::OnClick { path }` before click: middle-
truncated on the Play button (preserving both root and filename), full path in `.help(...)`
tooltip and accessibility `.label(...)` (never using model-controlled link text).
- Gate `Link::Outside` click-to-load strictly on `app.can_open_in() && !is_remote_session(app)` so
remote-server sessions never offer a local player for server paths.
- Keep reference-style Markdown links' Play controls inline beside their links by appending
document reference definitions invisibly to each Markdown slice instead of detaching controls to
the bottom of the message; also drop mismatched `Slot::Starting` entries cleanly.
* fix(files): require click-to-load for all reply videos (remove ReplyVideo::Auto)
Per READER-12's in-workspace video ruling on dev (Rune eff95e80 with live Windows Media Foundation
and macOS AVFoundation backends):
- Remove `ReplyVideo::Auto` completely; NO video in an assistant reply ever opens or decodes
without an explicit user click (neither inside-workspace nor outside-workspace).
- On display, `reply::video` performs zero disk or network I/O and returns only the real
sanitized path shown on the Play control (middle-truncated on the button, full path in tooltip
and accessibility label; consistent native separators on Windows).
- On click, `reply::load_video` verifies inside-workspace files via `verify_within_root` (or
remote `/api/fs/read/...`) and outside-workspace local files (local sessions only) via
`verify_local_path`, then mounts `#297`'s unchanged player and controls.
- `http(s)` web video links stay ordinary links that open in the embedded browser pane.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standalone video links in a finished assistant reply now have an inline player. Each starts paused and has independent play/pause controls. The original link stays available. Direct HTTP(S) videos, local paths, and files in a remote workspace are supported; links inside prose or code do not expand.
Click the picture to play or pause. The timeline sits above the 15-second skip and playback buttons, fades during uninterrupted playback, and stays visible for keyboard focus. Hover to see a time without seeking; drag to preview the frame. A release continues from that frame if the clip was playing, or holds it if paused.
Right-click a web link for Open link in default browser. For local files, the menu offers Open file and Reveal in Finder; for a directory, Open in Finder. Remote workspace paths do not offer local Finder actions. Settings → Browser → Open links in OpenCode remains the single browser preference, with clearer copy.
Verified on Mac Studio
To try it, have an agent send
[Watch the demo](./demo.mp4)on a line by itself.