Skip to content

feat: implement browser preview workspace and resolve authenticated-only selection gap - #60

Merged
wolfiesch merged 14 commits into
LycaonLLC:mainfrom
wolfiesch:feat/browser-preview-workspace
Jul 19, 2026
Merged

feat: implement browser preview workspace and resolve authenticated-only selection gap#60
wolfiesch merged 14 commits into
LycaonLLC:mainfrom
wolfiesch:feat/browser-preview-workspace

Conversation

@wolfiesch

@wolfiesch wolfiesch commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

What this changes

This PR adds a focused, session-linked Browser/App Preview Workspace.

  • projects preview lifecycle, navigation, capture, freshness, authority, and errors by host and session
  • adds a responsive workspace with URL, navigation, recapture, fit/actual-size, input, and upload controls
  • links browser tool calls and session headers to the preview workspace and records sanitized preview activity
  • isolates preview sequencing from the main session cursor and restores preview state after reconnects
  • bounds capture decoding and object-URL ownership, uses cooperative leases, and confines uploads to project-relative paths
  • defaults to credential-free session authority; every non-default-safe preview requires explicit consent tied to its current authority fingerprint
  • supports read-only hosts without exposing unavailable control actions and blocks mutations while cached state catches up

How you verified it

Focused checks completed after the review fixes:

pnpm --filter @t4-code/client exec vp test run test/preview-lease.test.ts test/client-reconnect.test.ts
pnpm --filter @t4-code/web exec vp test run test/preview-workspace.test.ts test/workspace-store.test.ts test/tool-renderers.test.tsx
pnpm --filter @t4-code/client typecheck
pnpm --filter @t4-code/web typecheck
pnpm exec playwright test e2e/remote-app.spec.ts --grep "opens a session-linked browser preview"
pnpm --filter @t4-code/web build

The focused browser flow opens an isolated fixture session, enters Preview, recaptures a blob-backed snapshot, and preserves mobile touch targets without horizontal overflow.

Screenshot

Browser Preview Workspace

Checklist

  • Conventional prefix used in commit and PR title
  • Focused unit, typecheck, build, and browser checks pass
  • Verification commands document observed behavior
  • Public text and screenshot contain no private paths or credentials

Copilot AI review requested due to automatic review settings July 19, 2026 02:41

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6722b1d3e5

ℹ️ 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".

Comment thread apps/web/src/features/preview/preview-model.ts Outdated
Comment thread apps/web/src/features/preview/preview-model.ts

Copilot AI 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.

Pull request overview

Implements a session-linked Browser Preview workspace end-to-end (protocol/client projection + cache, fixture runtime support, and web UI routing), and updates the vendored @oh-my-pi/app-wire artifact to a new pinned release that carries the preview wire additions.

Changes:

  • Bump vendored @oh-my-pi/app-wire to 0.6.0, updating checksums/compatibility metadata and distribution pinning tests.
  • Add preview-specific projection, cache persistence, capture chunk assembly/object-URL ownership, cooperative preview leases, and reconnect preview-state bootstrap in the client + fixture runtime.
  • Add a dedicated web preview workspace route/UI (with controls + snapshot interaction), preview activity logging, and new unit/E2E coverage.

Reviewed changes

Copilot reviewed 35 out of 38 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vendor/app-wire/manifest.json Updates vendored app-wire version + source/tarball metadata.
THIRD_PARTY_NOTICES.md Updates third-party notice to reflect app-wire 0.6.0 provenance/checksums.
pnpm-lock.yaml Updates lockfile references and integrity for vendored app-wire tarball.
packages/protocol/test/distribution.test.ts Updates distribution pinning test expectations for app-wire 0.6.0.
packages/protocol/package.json Points protocol package dependency at new vendored app-wire tarball.
packages/fixture-server/test/engine.test.ts Extends deterministic fixture command coverage for preview commands.
packages/fixture-server/src/fixture-sessions.ts Adds preview sequence tracking to created fixture sessions.
packages/fixture-server/src/fixture-command-frames.ts Adds preview snapshot fixtures + preview event classification helper.
packages/fixture-server/src/engine.ts Adds preview cursor/revision sequencing and preview command responses in fixture engine.
packages/client/test/projection.test.ts Adds/updates projection tests for preview freshness, caching, capture resource behavior.
packages/client/test/preview-lease.test.ts Adds tests for cooperative preview lease manager behavior.
packages/client/test/client-reconnect.test.ts Adds reconnect tests ensuring preview state is requested after attach.
packages/client/src/projection.ts Adds preview projections, freshness/order handling, and preview activity capture.
packages/client/src/projection-cache.ts Bumps projection cache version and persists/restores preview metadata + events.
packages/client/src/preview.ts Adds capture chunk assembly/object-URL ownership and preview lease manager.
packages/client/src/omp-client-runtime.ts Adds preview commands, capture loading, lease management, and preview-state bootstrap on attach/reconnect.
packages/client/src/index.ts Exposes preview APIs/types from the client package entrypoint.
e2e/remote-app.spec.ts Adds E2E coverage for opening preview workspace + recapture + mobile safety.
compat/omp-app-matrix.json Updates compatibility matrix to app-wire 0.6.0 metadata.
apps/web/test/workspace-store.test.ts Extends workspace-store persistence/continuity tests to include preview view state.
apps/web/test/tool-renderers.test.tsx Ensures browser tool renderer offers “Open Preview” only in live render contexts.
apps/web/test/preview-workspace.test.ts Adds unit tests for preview model/policy, adapter lease behavior, and capture URL cleanup.
apps/web/test/panes-live.test.ts Adds tests for preview activity sanitization and dedup across projection replays.
apps/web/test/panes-activity.test.ts Adds tests for preview event classification + export redaction guarantees.
apps/web/src/state/workspace-store.ts Persists per-session preview selection + scale mode in workspace state.
apps/web/src/router.tsx Adds /sessions/$sessionId/preview route and shared session gate logic.
apps/web/src/features/transcript/tool-render/types.ts Extends tool render host interface with openPreview().
apps/web/src/features/transcript/tool-render/tools/browser.tsx Adds “Open Preview” action to browser tool renderer when host supports it.
apps/web/src/features/transcript/tool-render/tool-render.css Styles the new host link and updates focus/touch-target handling.
apps/web/src/features/transcript/SessionMain.tsx Adds preview banner/button and navigation to preview workspace.
apps/web/src/features/preview/PreviewWorkspace.tsx Implements preview workspace UI (controls, snapshot, advanced actions, confirmations).
apps/web/src/features/preview/preview-runtime.ts Adds desktop adapter for preview commands, capture reads, and cooperative leases.
apps/web/src/features/preview/preview-model.ts Adds preview support/status derivation, policy parsing, and safety helpers.
apps/web/src/features/panes/live-projection.ts Includes preview events in inspector activity derivation.
apps/web/src/features/panes/live-inspector.ts Ensures empty projection includes preview fields.
apps/web/src/features/panes/activity-log.ts Adds preview activity classification with strict redaction constraints.
apps/web/src/components/SessionScreen.tsx Adds Preview badge/link in session header when previews exist.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/client/src/omp-client-runtime.ts
Comment thread apps/web/src/features/transcript/tool-render/tool-render.css
Comment thread apps/web/src/features/preview/PreviewWorkspace.tsx
@wolfiesch
wolfiesch merged commit a4d7815 into LycaonLLC:main Jul 19, 2026
4 checks passed
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.

2 participants