Skip to content

fix(web): resize the floating preview from any edge - #10467

Merged
juliusmarminge merged 1 commit into
mainfrom
fix-browser-overlay-resizing
Sep 7, 2026
Merged

fix(web): resize the floating preview from any edge#10467
juliusmarminge merged 1 commit into
mainfrom
fix-browser-overlay-resizing

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 7, 2026

Copy link
Copy Markdown
Member

Problem

The floating browser preview could only be resized from a single grip in its bottom-right corner — the one corner that runs into the window edge, so there was often nowhere left to drag toward. It also opened at a fixed 320×200 box regardless of what it was previewing, so the webview was letterboxed inside a padded frame instead of filling it.

Fix

  • Resize from any edge or corner. Eight invisible grab zones straddle the player's edges; the resize cursor is the only affordance, since resizability is the expected state and doesn't need its own chrome.
  • Aspect ratio follows the previewed viewport. The player is sized from what it actually mirrors — the device viewport when one is set, otherwise the size the webview had when it was floated — so the webview fills the frame with no padding. Resizing holds that ratio.
  • The opposite edge stays anchored. Dragging the left edge grows leftward, the top grows upward, and so on, so growth never dead-ends against the window edge. On a plain edge drag the perpendicular axis may use the whole container and the player shifts to stay inside.
  • Width is the only stored dimension. The on-screen frame is derived per layout pass from the measured container instead of being clamped back into the store, so a temporarily narrow window no longer destroys the size you chose. The player also never grows past the source's own rendered size, where it would only upscale.

Verification

apps/web focused tests, lint and typecheck pass. The geometry is covered by behavioral tests in previewMiniPlayerLayout.test.ts: aspect-locked resize from each edge, the anchored opposite edge, corner drags following the dominant axis, stopping at the container edge, shifting on the free axis, the minimum size, and the 1:1 cap.

CleanShot.2026-09-06.at.20.47.57.mp4

Notes

The old corner grip was a focusable button with no key handler, so it was never keyboard-operable; the new rails are pointer-only in the same way. Keyboard resize for the floating player remains unimplemented, as it was before.

Model: Claude Opus 5 (1M context), harness: Claude Code in T3 Code.

Summary by CodeRabbit

  • New Features

    • Mini-player sizing now adapts to the preview content, viewport zoom, and available space.
    • Resize the player from any edge or corner while preserving the preview’s aspect ratio.
    • Drag and reposition the player smoothly within the preview area.
    • Unpositioned players now appear in the top-right by default.
  • Bug Fixes

    • Improved handling of minimum sizes, viewport boundaries, bottom spacing, and oversized previews.
    • Resizing now maintains consistent dimensions and positioning across different preview layouts.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 7, 2026
The floating browser preview could only be resized from a single grip in
its bottom-right corner, which is the corner that runs into the window
edge, and it opened at a fixed 320x200 box that letterboxed the webview.

Every edge and corner is now a grab zone, resizing holds the previewed
viewport's aspect ratio with the opposite edge anchored, and the player
opens at that ratio so the webview fills it with no padding. Width is the
only stored dimension; the frame is derived per layout pass so a narrow
window no longer overwrites the chosen size.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the fix-browser-overlay-resizing branch from 1316c47 to e094155 Compare September 7, 2026 03:51
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@macroscopeapp

macroscopeapp Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The change adds eight production resize interaction paths, derives the preview frame from viewport aspect ratio, and replaces the fixed initial 320x200 layout with a dynamic default. It also changes the live mini-player state model, so the visible behavior spans interaction handling, layout calculations, browser-surface sizing, and state management.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.6 KiB +64 B (+0.5%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB +5 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.6 KiB +59 B (+0.9%) 7.8 KiB
Codex Live turn WebSocket decoded 57.0 KiB 57.1 KiB +88 B (+0.2%) 66.4 KiB
Codex Live turn messages 8 10 +2 (+25.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB 0 B (0.0%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.1 KiB +7 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.6 KiB −7 B (−0.1%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 57.9 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: 6abdf37 · PR result: e094155 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 7efaf853-063f-4079-b6cd-95fe457d9be2

📥 Commits

Reviewing files that changed from the base of the PR and between 6abdf37 and e094155.

📒 Files selected for processing (5)
  • apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx
  • apps/web/src/components/preview/previewMiniPlayerLayout.test.ts
  • apps/web/src/components/preview/previewMiniPlayerLayout.ts
  • apps/web/src/previewMiniPlayerStore.test.ts
  • apps/web/src/previewMiniPlayerStore.ts

Included review availability: 8 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

The mini-player now stores width separately from height, derives aspect-ratio-aware frames from viewport content, and supports unified drag and eight-direction resize gestures within container constraints.

Changes

Mini-player frame management

Layer / File(s) Summary
Width-based state contract
apps/web/src/previewMiniPlayerStore.ts, apps/web/src/previewMiniPlayerStore.test.ts
The store persists a nullable width instead of a size object. Resize operations accept numeric widths and preserve thread-specific state.
Frame resolution and resizing
apps/web/src/components/preview/previewMiniPlayerLayout.ts, apps/web/src/components/preview/previewMiniPlayerLayout.test.ts
Layout utilities resolve source dimensions, initialize constrained frames, preserve aspect ratio, anchor directional resizes, and enforce minimum, container, and bottom-inset limits.
Unified gesture rendering
apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx
The component measures its container, uses one pointer-gesture model for dragging and resizing, captures pointers, and renders the player from the resolved frame.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to e0941

The mini-player gains aspect-ratio-aware resizing from every edge and corner, with source and container limits enforced. No actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Pointer
  participant ThreadPreviewMiniPlayer
  participant previewMiniPlayerLayout
  participant previewMiniPlayerStore

  Pointer->>ThreadPreviewMiniPlayer: Start drag or resize
  ThreadPreviewMiniPlayer->>previewMiniPlayerLayout: Resolve or resize frame
  previewMiniPlayerLayout-->>ThreadPreviewMiniPlayer: Return constrained frame
  ThreadPreviewMiniPlayer->>previewMiniPlayerStore: Store width and position
  ThreadPreviewMiniPlayer-->>Pointer: Render updated player
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 The description clearly explains the problem, implementation, UI behavior, and verification. It does not use the template headings exactly and omits the checklist, but it provides the required technic…
Title check ✅ Passed The title accurately and concisely describes the primary change: enabling resizing of the floating preview from any edge.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-browser-overlay-resizing

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit f57d383 into main Sep 7, 2026
24 checks passed
@juliusmarminge
juliusmarminge deleted the fix-browser-overlay-resizing branch September 7, 2026 08:05
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 7, 2026
## What's Changed
* fix(mobile): keep pending messages in the chat timeline by @juliusmarminge in pingdotgg/t3code#10449
* fix(mobile): show connection status in the floating pill instead of a second one by @juliusmarminge in pingdotgg/t3code#10440
* fix: use Pierre icons consistently for attachments by @juliusmarminge in pingdotgg/t3code#10475
* feat(mobile): open the thread screen as soon as a new task is submitted by @juliusmarminge in pingdotgg/t3code#10435
* fix(devcontainer): make repository setup work by @saphid in pingdotgg/t3code#7875
* fix(projects): prevent invalid script IDs from crashing threads by @saphid in pingdotgg/t3code#10019
* fix(mobile): hide changed-files navigator and restore refresh in raw diff fallback by @lnieuwenhuis in pingdotgg/t3code#9828
* fix(ios): scroll short source files from blank space by @juliusmarminge in pingdotgg/t3code#10178
* feat(mobile): start a new thread on an existing branch by @StiensWout in pingdotgg/t3code#10359
* fix(mobile): improve font-size slider performance and prevent maximum update depth errors by @bbernag in pingdotgg/t3code#7138
* fix(web): keep composer toolbar controls anchored during transitions by @juliusmarminge in pingdotgg/t3code#10478
* fix(web): resize the floating preview from any edge by @juliusmarminge in pingdotgg/t3code#10467
* fix(mobile): prevent chat from disappearing when scrolling by @juliusmarminge in pingdotgg/t3code#10479
* fix(mobile): smooth composer status pill resizing by @juliusmarminge in pingdotgg/t3code#10484
* fix(mobile): release initial scroll target after dragging by @juliusmarminge in pingdotgg/t3code#10483
* fix(mobile): animate thread lifecycle transitions consistently by @juliusmarminge in pingdotgg/t3code#10487
* fix(mobile): restore assistant message bottom padding by @juliusmarminge in pingdotgg/t3code#10491
* fix(mobile): preserve chat rows when toggling commands by @juliusmarminge in pingdotgg/t3code#10492

## New Contributors
* @bbernag made their first contribution in pingdotgg/t3code#7138

**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260907.1332...v0.0.40-nightly.20260907.1346

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.40-nightly.20260907.1346
aorwall added a commit to aorwall/t3code that referenced this pull request Sep 7, 2026
Merges 141 upstream commits (`b438447f6..8b2838e`) into the fork,
following the
`fork-upstream-merge` skill. Landed as a merge commit; conflicts
resolved by the
path-policy verdicts in `docs/fork/inventory.json`.

## Merge shape

563 files landed (`git diff --stat HEAD^1 HEAD`) against 563 in the
upstream
range, so no upstream work was dropped. Fork delta 720 files.

## Conflicts

14 files, resolved by concern. The merge commit message names each. Two
are worth
carrying forward:

- Upstream extracted the project action rows into
`ProjectActionsList.tsx`. The
fork's Edit gate now rides an `editable` prop that defaults to
upstream's
  always-editable behavior, so the gate survives the next extraction.
- Upstream moved the `agent-browser-access` setting onto its new
`/settings/projects` page. `settingsSearch.ts` points that item there
and drops
  a fork delta.

## Two things a clean merge did not show

**Upstream can delete an export the fork still imports.** pingdotgg#10225 removed
`ClientTracingLive` as unused. `apps/web/src/lib/runtime.ts` still
installs it,
and neither file conflicted, so the typecheck failed four ways on a
merge git
called clean. Restored with a `// Fork:` comment naming the consumer.

**A green test step can hide a suite that never finished.** `vp run -r
test`
kills the packages still running when one of them fails. A
`@t3tools/desktop`
failure truncated `apps/web` and `@t3tools/mobile` after each had
reported
hundreds of passing files, and `verify.mjs` counted any package with
labeled
output as tested. Four failing web tests went unreported. The check now
keys on
the closing `Test Files` line and runs every unfinished package alone.

## Unsupported methods

`unsupported-methods.mjs` reports 0 ADD, 0 DROP, 2 KEEP, against 61
dispatched
backend methods and 131 contract methods.

Getting there took a fix. The backend moved its dispatch from
`crates/t3code/src/lib.rs` to `crates/t3code/src/rpc/dispatch.rs`, where
every
arm is a one-line call into a handler below the match. The script read
the old
path and reported zero dispatched methods, then read the new one and
called
`vcs.switchRef` a DROP, because the `unsupported_exit` that refuses it
had moved
out of the arm. It now tries both paths and follows an arm two calls
deep.

Contract changes: `provider.consumeResetCredit` and
`server.getHostResources`
gained `UnsupportedMethodError`; `server.getUsageSummary` lost it, which
closes
the item the previous merge left open.

## Feature classification

**Usable as-is** — client-only, nothing new on the wire. Sidebar drag
across
sections with destination cues and a named drop action (pingdotgg#9731, pingdotgg#9750,
pingdotgg#10378,
pingdotgg#10453, pingdotgg#10464). Composer behavior: a multiline draft survives timeline
scrolling (pingdotgg#10444), the composer stops collapsing on blur (pingdotgg#10437) and
regains
focus when you tab back (pingdotgg#10463). Panel and preview chrome: resize the
floating
preview from any edge (pingdotgg#10467), toolbar controls stay anchored (pingdotgg#10478),
the
stuck resize cursor clears (pingdotgg#10461), the browser hides as the right
panel closes
(pingdotgg#10385), manual panel choices hold during a turn (pingdotgg#10113). Settings and
accessibility polish (pingdotgg#10177, pingdotgg#10262, pingdotgg#10415, pingdotgg#10258, pingdotgg#10124, pingdotgg#10125,
pingdotgg#10127,
pingdotgg#10128, pingdotgg#10175). Performance (pingdotgg#10413, pingdotgg#10190, pingdotgg#10118). Plus the GitHub
mark on
`github.com` links (pingdotgg#10324), the Tux icon for WSL (pingdotgg#8511), a remembered
usage
page selection (pingdotgg#10189), project settings in the legacy sidebar menu
(pingdotgg#10021),
and text-only preview snapshots (pingdotgg#10232).

**Unsupported in Moatless** — resolves to a refusal, or falls through to
its own
empty state. Each is recorded in `docs/fork/gaps.md`:

- Reset credits through the hub and CLIProxyAPI (pingdotgg#10462, pingdotgg#10395,
pingdotgg#10308).
`provider.consumeResetCredit`, new union entry. `UsageLimits.tsx`
catches the
  refusal and shows "Could not use the reset credit."
- Balancing new threads across connected machines (pingdotgg#9895, pingdotgg#10433,
pingdotgg#10407).
`server.getHostResources`, new union entry. Nothing polls until a user
picks
automatic routing, and the composer then reads "Auto balance
unavailable."
- Onboarding: import grouped by repository (pingdotgg#10493), the shared
multi-computer
  wizard (pingdotgg#10465), agent install without Node or npm (pingdotgg#10402). All ride
  `agentSessions.scan` and `.import`, an existing gap.
- Shared project defaults and scoped overrides (pingdotgg#9754). The page reads,
and every
  write goes through `server.updateSettings`, which the backend does not
  dispatch.
- Two new `orchestration.dispatchCommand` types: `thread.active.reorder`
(pingdotgg#9729)
and `thread.user-input.dismiss` (pingdotgg#10431). Both are ordinary controls, a
sidebar
drag and a Dismiss button, and a dispatched command cannot be refused
per type.
That is the standing _A command cannot be refused_ gap, now 26 members
wide.

**Backend behavior to consider reproducing in Moatless** — upstream
server fixes
whose behavior the fork's client assumes:

- Invalid script IDs no longer crash threads (pingdotgg#10019). The fork ships
project
  scripts, so this one is worth reading first.
- Settlement: settle inactive threads without a PR lookup (pingdotgg#10103), skip
disabled
settlement lookups (pingdotgg#10424), settle threads with unanswered async
questions
  (pingdotgg#10400).
- Interrupted threads stay resumable after a restart (pingdotgg#10421).
- Completed requests stay closed across clients (pingdotgg#10123).
- Placeholder branches are followed after a checkout updates (pingdotgg#10441).
- A thread's PR links without an open client (pingdotgg#10101), and checkpoints
are
  captured before a PR status refresh (pingdotgg#10347).
- Adapters declare their own context compaction (pingdotgg#10112).
- Transcripts with oversized tool records import (pingdotgg#10430), and git
status scans
  are skipped while the index is locked (pingdotgg#9845).
- Usage limits pool per provider across accounts and environments
(pingdotgg#10300). The
client renders what `server.getUsageSummary` returns, so this shows
something
  only if the Moatless payload carries per-account limits.

Mobile, marketing, desktop, provider adapters and release tooling are
not this
fork's surface and are not classified.

## Also fixed here, and not upstream's doing

- Three `browser-*` search items still routed to
`/settings/integrations`, which
the fork owns for its Moatless administration page. A non-administrator
who
  searched for them was redirected away from the result.
- `moatless/listSearch.ts` carried no fork-only declaration.
- `pnpm fmt:check` failed on 294 files, 293 of them orval output. The
generator
  now formats what it writes through an `afterAllFilesWrite` hook.
- `@t3tools/moatless-api` exported `./generated`, a barrel that is never
checked
  in.

## Verification

`inventory-check.mjs` clean. `verify.mjs` green on seven checks:
duplicate-adds,
tripwires, resolution-check, unsupported-methods, `fmt:check` (3876
files),
`lint` and `typecheck`.

`test` is red on one package, and it is the machine.
`@t3tools/desktop`'s
`bundled libsecret helper` shells out to `pkg-config` for `libsecret-1`,
which
this sandbox does not have; it fails the same way when retried alone.
Everything
else passes: `apps/web` 369 files, `t3` 291, `@t3tools/mobile` 149,
`t3code-relay` 27, `@t3tools/client-runtime` 71, plus the smaller
packages.

`spec:check` cannot run in a sandbox: it needs a sibling `moatless`
checkout or a
deployment URL and has neither.

Written by Claude Opus 5 in Claude Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Moatless task:
https://moatless.soaplabstest.com/tasks/8d348ecf-f9cb-4e65-b96b-6c1054a8ed33
raman325 added a commit to raman325/t3code that referenced this pull request Sep 7, 2026
* origin/main: (675 commits)
  fix(web): tolerate servers that predate git identity in project import (pingdotgg#10547)
  chore(mobile): bump app version to 1.1.0
  fix(mobile): wait for native thread scroll before reveal (pingdotgg#10486)
  fix(mobile): match Working status color to desktop
  fix(web): remove inserted citations on cancel (pingdotgg#10518)
  feat(web): group onboarding project import by repository (pingdotgg#10493)
  fix(mobile): preserve chat rows when toggling commands (pingdotgg#10492)
  fix(mobile): restore assistant message bottom padding (pingdotgg#10491)
  fix(mobile): animate thread lifecycle transitions consistently (pingdotgg#10487)
  fix(mobile): release initial scroll target after dragging (pingdotgg#10483)
  fix(mobile): smooth composer status pill resizing (pingdotgg#10484)
  fix(mobile): prevent chat from disappearing when scrolling (pingdotgg#10479)
  fix(web): resize the floating preview from any edge (pingdotgg#10467)
  fix(web): keep composer toolbar controls anchored during transitions (pingdotgg#10478)
  fix(mobile): improve font-size slider performance and prevent maximum update depth errors (pingdotgg#7138)
  feat(mobile): start a new thread on an existing branch (pingdotgg#10359)
  fix(ios): scroll short source files from blank space (pingdotgg#10178)
  fix(mobile): hide changed-files navigator and restore refresh in raw diff fallback (pingdotgg#9828)
  fix(projects): prevent invalid script IDs from crashing threads (pingdotgg#10019)
  fix(devcontainer): make repository setup work (pingdotgg#7875)
  ...

# Conflicts:
#	apps/server/src/provider/builtInDrivers.ts
#	docs/README.md
#	docs/user/install.md
#	packages/contracts/src/settings.test.ts
#	packages/contracts/src/settings.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant