Compare commits

...
Author SHA1 Message Date
paseo-bot[bot] b0e8724383 fix(opencode): keep history loads read-only and save the new session id at once
Only an interactive resume replaces a lost OpenCode session, so opening an
archived agent's history no longer creates a native session. A replaced
session reports persistenceUpdatedOnResume, so the agent manager stores
the new id when it registers the session, not after the next prompt.
2026-11-17 07:32:24 +00:00
paseo-bot[bot] b4ae32d77e fix(opencode): continue in a new session when the saved one is gone
Resuming an OpenCode agent reused the saved session id without checking
that OpenCode still had it. When the session was gone, every prompt failed
with NotFoundError "Session not found" and the agent never recovered.

Resume now asks OpenCode for the session first. When OpenCode reports it
missing, the agent starts a new native session on the same server, so the
next prompt runs and the new session id is persisted.
2026-11-17 07:20:32 +00:00
paseo-ai[bot] c71d41f687 fix: update lockfile signatures and Nix hash [skip ci] 2026-11-17 06:51:06 +00:00
Mohamed Boudra 689e3412b4 chore(release): reconcile main with 0.16.1 (#9945)
Brings in the shipped 0.16.1 CHANGELOG.md and CHANGELOG.zh-CN.md entries
exactly as tagged, the 0.16.1 version in every package.json and
package-lock.json, and the F-Droid changelog files for version codes
160011-160014.
2026-11-17 13:43:31 +07:00
paseo-bot[bot]andClaude Opus 5.5 349a2e43ea Keep the phone model-label sweep from reading the browser's clipped label (#9934)
* test(app): wait for the model control to re-measure in the label sweep

The phone label sweep read the folded model control twice, 100ms apart,
after each resize. A resize reflows the page at once and the browser
clips the model label with its own ellipsis until the control's layout
event arrives. On a slow runner both reads landed in that window, so the
sweep recorded a truncated label beside the thinking label and stopped.

A settled read now also requires the model label to fit its box, and
gives up after 10s with the last state.

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

* test(app): settle the label sweep on the label its box fits

The previous commit rejected one in-between state: the browser clipping
the model label beside the thinking label. A slow runner can also leave
the label truncated to "Ten second…" after the thinking label is gone,
because the label's box widens at once but its text waits for the next
layout event.

A settled read now requires the shown label to match the box: the full
text when the invisible full-text sizer fits, otherwise a truncation
that fits. That covers both states, so the clipped-label special case
goes.

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

---------

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 06:41:21 +00:00
eabbd3d97c Show a Codex message canceled before it starts as canceled, not as a startup error (#9931)
* fix(server): treat canceled Codex starts as interruptions

* fix(server): report a replaced pending start as undelivered to its sender

waitForAgentRunStart followed the agent rather than the sender's run, so a
send canceled by a replacement before reaching Codex resolved once the
replacement started. Keep the sender's own pending run and reject when it is
cleared before its turn starts.

The canceled-start tests drain streamAgent, because a fresh Codex agent has no
session handle before its first turn (#8393).

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

* fix(server): keep a sender's start wait across a stale-session retry

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

* test(server): expect the start options passed to a foreground run

Session create and scheduled prompts now pass the sender's start options,
so the two call-argument assertions include them.

Co-authored-by: 3ae3ae <3ae3ae@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): keep a Codex message canceled before it starts in history

A Stop or replacing send during Codex preparation settled the run as
canceled without recording the sender's prompt, so the message vanished
from history after a reload and on other clients. Record it as a
rejected attempt, as the start-failure branch already does, so it stays
in history without being delivered.

Co-authored-by: 3ae3ae <3ae3ae@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): return each send's start from dispatch

A send waited for its turn by looking up the agent's pending run when the
wait began. When a provider plugin's session was stale, the first start
failed and its run was cleared before the sender started waiting, so the
send rejected with "has no pending run" while the retry answered it.

startAgentRun now returns the start of the prompt it dispatched. Every run
created for that prompt, including the stale-session retry, is bound to
it, so the send resolves when its own turn starts and rejects when its own
run ends unstarted. This replaces the retry hand-off between runs in the
agent manager.

Co-authored-by: 3ae3ae <3ae3ae@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: 3ae3ae <ogyshjsm@naver.com>
Co-authored-by: Bae Seongmin <83870598+3ae3ae@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: bot <bot@localhost>
Co-authored-by: paseo-bot[bot] <paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: 3ae3ae <3ae3ae@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-17 05:11:25 +00:00
paseo-ai[bot] 0bac18f359 fix: update lockfile signatures and Nix hash [skip ci] 2026-11-17 04:02:57 +00:00
Mohamed Boudra 3eedffc4ac fix(claude): keep the user's ask rules and hooks in Bypass (#9927)
In Bypass, Claude agents again show a permission card for asks from the user's permissions.ask rules (including managed policy), PreToolUse hooks that return ask, compound and piped commands that hit an ask rule, permissions.blockReadsOutsideWorkingDirectories, an organization's ask limit, and sandbox overrides. Claude's own checks are still approved without a card. Upgrades @anthropic-ai/claude-agent-sdk to 0.3.326, which passes the ask's source to canUseTool.

Closes #9916
2026-11-17 10:53:08 +07:00
Michael ThomasandMohamed Boudra e5352c9890 fix: size controls by the primary pointer, not any touch screen (#9909)
* feat(desktop): size controls by the primary pointer, not any touch screen

The desktop app gave touch-sized controls to every machine with a touch
screen, including Windows laptops driven by a trackpad. In Electron, ask
whether a mouse-like primary pointer drives the UI instead: Chromium
reports a fine primary pointer for those laptops and a coarse one for a
tablet with no mouse or trackpad attached.

Browsers and native keep the touch-screen check, so an iPad keeps touch
sizes with a trackpad attached. Swipe gestures still follow the
touch-screen capability.

Refs #9892

* feat(app): size controls by the primary pointer on every platform

Replace the Electron-only check with one rule everywhere: touch-sized
when touch is the primary input, `(pointer: coarse)`, rather than when a
touch screen exists at all. WebKit keeps touch primary on an iPad with a
trackpad attached, so iPad Safari stays touch-sized; Chromium reports a
fine primary pointer for a touch-screen laptop driven by its trackpad, in
the browser and the desktop app. Native is always touch-sized.

`hasTouchScreen()` and its `maxTouchPoints` fallback had no other caller
and are removed. Swipe gestures still follow the touch-screen capability.

Refs #9892

* test(app): exercise pointer sizing through the media source

* test(app): cover touch laptops with a primary pointer

---------

Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
2026-11-17 10:48:34 +07:00
ce09360241 fix(server): agents archived while not loaded get the archive time as their last update (#9926)
* fix(server): move updatedAt when archiving an agent that is only in storage

Archiving a loaded agent sets its updatedAt to the archive time
(markRecordArchived). Archiving an agent that is only in storage, which
is also how a parent's archive reaches its children, kept the old
updatedAt. Lists sorted by updated_at, such as History, then left a
just-archived agent where its last turn put it, sometimes days back, and
clients paging such a list by time never reached it.

archiveSnapshotUnlocked now records the archive time as updatedAt too.

Co-authored-by: RoundRedDot <roundreddot@gmail.com>

* fix(server): keep updatedAt from moving back when an archive is restored

Archiving a stored-only agent now sets updatedAt to the archive time.
When the archive time is earlier than the record's updatedAt, as when a
failed send or resume puts an agent's original archive back after
unarchiving it, updatedAt stays where it is. Clients drop agent updates
that are older than the one they hold, so moving it back left them
showing the agent active.

Co-authored-by: luke <luopeihuan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): keep updatedAt from moving back when a loaded agent's archive is restored

The rule that archiving never moves updatedAt backwards now lives in
buildArchivedAgentRecord, which both archive paths use. A failed send
that resumed the agent before a later loading step failed puts its
original archive back through the loaded path, which had the same
backwards move.

The workspace archive stamp test now uses stamps taken after the
agents' activity, as real archive stamps are.

Co-authored-by: luke <luopeihuan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(server): require the archive time when building an archived agent

buildArchivedAgentRecord no longer accepts an archive that leaves
updatedAt unset, the gap #9920 came through, and its tests now assert
the rule: a later archive time moves updatedAt, an earlier one keeps it.

Co-authored-by: luke <luopeihuan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: luke <luopeihuan@gmail.com>
Co-authored-by: RoundRedDot <roundreddot@gmail.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:55:35 +00:00
paseo-bot[bot]andClaude Opus 5.5 8f3752ecb9 test(app): wait for a label filter row to be laid out before measuring it (#9922)
The workspace-labels journey measured the Urgent filter row right after
opening the label filter page. While the page is still coming in, the
row has no box yet, and the measuring helper threw inside expect.poll,
which ends the poll instead of retrying it. An element with no box now
counts as not settled, and the helper returns the box it settled on
instead of measuring a second time.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 00:36:12 +00:00
73c22f7917 Keep desktop workspaces reachable when sidebar navigation overflows (#9903)
* fix(app): keep desktop workspaces reachable when sidebar navigation overflows

Apply the mobile cap from #8727 to DesktopSidebar: the navigation rows
scroll inside a viewport capped at half the sidebar, so plugin rows no
longer push the Workspaces list out of a short window. The viewport sits
outside the titlebar drag area and opts out of app regions, since
Electron does not clip app-region rects to scroll viewports.

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

* fix(app): keep the sidebar drag strip on Windows and Linux

Moving the desktop navigation rows into a scroll viewport left the
sidebar's drag overlay in an empty container when the window controls
sit top-right, so Windows and Linux lost every window-drag surface in
the sidebar. The strip above the navigation now carries the drag
overlay there, and the rows start flush below it.

Refs #9872

Co-authored-by: Alex Tong <alex.tong@pentatonic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(app): share the window-content marker from the drag-region module

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

* refactor(app): share one nav scroller between the mobile and desktop sidebars

The desktop sidebar's capped nav viewport was a plain ScrollView on every
platform, so on tablets it did not join the overlay's close swipe the way
the mobile nav block and the workspace list do. Both sidebars now render
SidebarNavScroll, which owns the 50% cap, the native gesture-handler
branch linked to the close gesture, the divider, and the web
window-content marker.

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

* fix(app): drop the empty nav divider and drag strip when every top item is hidden

With every top navigation item turned off, the desktop sidebar now starts
at the Workspaces section again, as on main: no 1px divider and no 8px
drag strip above it.

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

---------

Co-authored-by: Alex Tong <alex.tong@pentatonic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-16 23:59:03 +00:00
paseo-bot[bot]andClaude Opus 5.5 038a9ca00d fix(opencode): clear a question that a new message replaces (#9891)
With the default send setting, a message sent while an OpenCode agent
waits on a question steers the turn, and Paseo rejects the question in
OpenCode. The OpenCode session dropped the question from its own list
without reporting it resolved, so the agent manager and the app kept
showing it. Answering or dismissing it then failed with "No pending
permission request", and the prompt could not be closed.

The session now reports permission_resolved whenever OpenCode accepts a
reply, rejection, or answer, as the other providers do.

Fixes #9879

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:03:40 +00:00
paseo-bot[bot]andClaude Opus 5.5 3a7e216b7d test(server): read the latest event when checking a removed file on macOS (#9898)
macOS FSEvents can replay the file's pre-subscription write as a create
after the observer starts. The test read the first event for the path,
so it stayed on that create after the delete arrived in a later batch.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:45:26 +00:00
paseo-bot[bot]andClaude Opus 5.5 6ef188416f test(e2e): start the plugin modal settle check once the sheet is in view (#9889)
The compact sheet holds below the viewport for a few frames before it
slides up. On a slow runner two settle reads 100 ms apart can both land
in that hold. Waiting for the title to enter the viewport first means the
settle check only starts once the slide has begun.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:04:29 +00:00
791bbd3596 fix(app): keep preview tab identities unique across split panes (#9888)
* fix(app): keep preview tab identities unique across split panes

Reserve existing pane and sheet IDs when allocating a new instance, including tabs opened by reconciliation. Keep menu-hosted sheet identities stable across layout changes.

Repair duplicate IDs in saved layouts without discarding tabs, state, or pane focus. Resolve file navigation by target rather than an ID retained from a previous preview.

* fix(app): open a listed subagent as its own agent tab

A subagent opened in place of the compact subagent list got a random
instance id, so "Open as tab" created a tab that no longer carried the
subagent's agent tab id. The in-place sheet now starts from the
subagent's own tab id, still checked against occupied ids and kept
stable across layout updates.

Co-authored-by: Kosmo CHE <108672813+KosmoCHE@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Kosmo CHE <kosmoche@gmail.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Kosmo CHE <108672813+KosmoCHE@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:04:19 +00:00
Angus Buick b95f1bbf31 fix(app): draw the Add host text fields as inputs again (#9864) (#9865)
AdaptiveTextInput wraps its input with withUnistyles, and the pairing link and direct connection modals wrapped AdaptiveTextInput a second time. On web each wrapper is a display: contents element whose style lands on its direct child, so the outer style landed on the inner wrapper and the input lost its border, background and padding.

Drop the outer wrapper, AdaptiveTextInput already themes the placeholder colour. Also give the host password field a placeholder and focus it when pairing asks for a password.
2026-11-16 16:58:48 +00:00
paseo-bot[bot]andClaude Opus 5.5 c2a24ae81e test(e2e): wait for a plugin modal sheet to settle before using the pointer (#9884)
On compact layouts the sheet holds below the viewport and then slides up,
so the Horizontal tab hover could resolve its point mid-slide and the wheel
landed on the rows below the tabs. openExample now waits for the title to
stop moving.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:48:36 +00:00
paseo-bot[bot] 6eb94611b3 test(e2e): wait for the isolated daemon itself, not any listener on its port (#9863)
* test(e2e): wait for the isolated daemon itself, not any listener on its port

The helper reserves a port, releases it, and starts the daemon on it. If
another process takes the port in between, the daemon exits with
EADDRINUSE, but the readiness probe already succeeded against the other
listener. The worker fixture then reported the daemon as started and its
seed client retried a dead endpoint until the 60s fixture timeout.

Readiness now requires /api/status on the port to report this daemon's
server id, so the probe keeps waiting, sees the EADDRINUSE exit, and the
existing retry moves to a fresh port.

* test(e2e): authenticate the readiness probe with the daemon's local credential

A password with spaces cannot travel as an HTTP bearer, so the status
probe of a password-protected daemon stayed 401. The daemon writes a
local credential into its home before listening and /api/status accepts
it, as the CLI's local status does.

---------

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-16 15:03:02 +00:00
Okan YILDIRIM a8cadae0ee fix(app): keep saved hosts when one entry can't be read (#9847)
The host registry was parsed with a strict array schema, so one host or
connection this build couldn't read failed the whole array. The loader then
removed @paseo:daemon-registry, and every saved host and password with it.
That happens after a downgrade, or once a newer build saves a connection kind
this build doesn't know.

- Hosts and connections are read one at a time. One this build can't read
  is skipped, and the other hosts load.
- Skipped entries are written back on every save, so the build that wrote
  them still finds them. Removing a host also drops what this build couldn't
  read for it.
- A value that isn't a JSON array is copied to
  @paseo:daemon-registry:unreadable instead of being removed.
- The stored-password migration still moves a connection password to its
  host when that host also has an unreadable connection.
2026-11-16 14:01:03 +00:00
5a78c1cd16 Let idle cleanup release Codex chats opened only to read history (#9859)
A Codex session opened to read history reads the thread and disposes its
app-server right away, but canStopRuntime() vetoed it because it had no
client. Idle cleanup then kept every such chat loaded in the daemon.

Closes #9804

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Shulem <1703265+Spshulem@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:01:00 +00:00
paseo-bot[bot]anddaysun-k 8522d18ed8 Keep Claude signed in when model discovery runs during a token refresh (#9855)
* Let Claude model discovery finish a token refresh instead of killing it

Model discovery stopped waiting after 5 s by aborting the SDK query and
tree-killing the CLI. A CLI that is still refreshing an expired OAuth
token at that moment has already rotated the refresh token, so the kill
leaves only the revoked token on disk and logs the user out.

The 5 s limit now only bounds the wait. A CLI that has not answered gets
its input ended and exits on its own; it is tree-killed only after a
60 s grace period or when the daemon shuts down.

Fixes #9314

* fix(server): let Claude model discovery finish a token refresh after it answers

Claude Code answers the model list before its startup token refresh has
saved the rotated refresh token. Discovery killed the CLI right after the
answer, so a refresh still in flight left the revoked token on disk and
every later Claude session failed until /login. Discovery now ends the
CLI's input and lets it exit on its own whether or not it answered, with
the existing grace period and shutdown kill as the bound.

Co-authored-by: daysun-k <8309193+daysun-k@users.noreply.github.com>

---------

Co-authored-by: daysun-k <8309193+daysun-k@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-16 12:04:46 +00:00
paseo-bot[bot]andClaude Opus 5.5 be92e85a4e fix(server): return only the newest reply as the last message after a restart (#9846)
After a daemon restart, an agent's timeline is rebuilt from provider
history, and those rows have no turn id. A reply the agent starts on its
own, such as Claude waking after a background subagent, follows the
previous reply with no user message between them, so the last assistant
message lookup joined the two and wait results and finish notifications
returned the old reply with the new one appended.

The timeline projection already treats a message id change as a new
message. Share that rule with the lookup, so both decide which rows are
chunks of one message the same way.

Closes #9814

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:02:51 +00:00
Mohamed Boudra 3d30aaec42 Allow plugins to append agent instructions (#9781)
* feat(plugins): append agent instructions on session open

Recompute plugin instructions for each launch so changes apply on reopen without changing saved agent configuration.

* test(providers): verify plugin instructions on reopen

* fix(codex): refresh instructions from restored collaboration mode

A resumed thread can retain its prior collaboration instructions when the mode catalog is unavailable. Rebuild those instructions from the current launch before the next turn.

* fix(plugins): keep launch instructions out of agent records

Provider persistence handles can contain launch configuration. Strip transient instructions before saving and projecting handles.

* fix(codex): preserve built-in collaboration instructions

Pass agent instructions through the thread configuration so Codex can apply its own Plan and Default mode instructions.

* fix(opencode): preserve instructions when reading history

History-only opens do not apply current plugin contributions, so they must not clear the native session instruction entry.

* fix(codex): retain instructions after rewinding

A rewind forks the native thread, which does not inherit its parent launch instructions. Pass the current instructions to the fork.

* Deliver updated instructions to Codex threads

* Cover Codex snapshots after rewind

* Persist provider state when reopening agents

* Limit resume persistence refresh to providers that need it
2026-11-16 17:10:14 +07:00
a302e65c85 fix(omp): show model names with slashes and underscores in full (#9836)
OMP model labels were built as `${provider}/${name}` and then cut at the
last `/`, so a free-text name such as "... ~60-70 tok/s on 0.2.10, 52/56)"
showed as "56)". Underscores were rewritten to spaces ("IQ3_S" -> "IQ3 S"),
and a colon inside the name cut everything before it.

Pi had the same bug, fixed in #9823. Move that label rule into a shared
model-label module and use it for both providers: free-text names are
kept, path-like names are shortened to their last segment, and a
"Vendor: " prefix is dropped only when it is a prefix.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Rahul Sharma <19687913+rms523@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:54:34 +00:00
paseo-bot[bot] d49991318f fix(server): see same-size edits saved in the tick a file was staged (#9854)
The private index snapshot behind index and All changes comparisons was a
fresh copy, newer than every entry, so Git skipped its same-timestamp
content check and a same-size save made right after staging read as
unchanged. The copy now keeps the source index's mtime, rounded down to
the second.

Closes #9827

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-16 09:48:23 +00:00
33259746db Stop timed-out watcher setups from rescanning large repos every 5 minutes (#9828)
* fix(server): abort timed-out watcher setups and back off their retries

A watcher subscription that missed WORKSPACE_GIT_WATCHER_SUBSCRIBE_TIMEOUT_MS
was abandoned but its startup scan kept walking the tree to completion, and
recovery retried every five minutes forever, repeating the full scan each
time. On a CPU-starved host that kept dozens of directories rescanning.

- FileObserver.subscribe accepts an abort signal that stops the startup scan
  and rejects; WorkspaceGit aborts setups at the deadline and on dispose.
- Consecutive setup timeouts extend the recovery delay past the 5-minute
  ladder cap, doubling up to one hour; an accepted subscription resets it.
  Degraded polling keeps its 5-60 s cadence meanwhile.

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

* fix(file-observer): keep an aborted observation's backend from starting

Aborting a subscription closes its observation, which can happen while
start() is still reading the root. The backend then started after its close
had finished, and the native backend opened a root watcher that nothing
would close.

Co-authored-by: Spencer Shulem <1703265+Spshulem@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(file-observer): abort a subscription mid-scan in the abort test

The test aborted before the backend started, so it passed with the abort
listener removed. A tree past the Linux directory limit makes a scan that
keeps walking fail on the limit instead of rejecting with the reason.

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

---------

Co-authored-by: Spencer Shulem <spshulem@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Spencer Shulem <1703265+Spshulem@users.noreply.github.com>
2026-11-16 09:10:01 +00:00
Mohamed Boudra 41c294c785 Queue agent messages until the current turn ends (#9757)
* fix(server): queue agent messages until the current turn ends

Steering refusal could replace a running turn and cancel compaction. Hold agent-originated messages and notifications together until the recipient settles, retaining explicit interruption and acknowledging finish subscriptions only after dispatch succeeds.

* fix(server): wake queued delivery at turn and permission checkpoints

A pending follow-up must not hide the permission needed to finish the current turn. Wake ready batches on recipient state changes, let completion waits report permission checkpoints, and preserve admission order and session-mode boundaries when busy dispatches retry.

* fix(server): publish autonomous readiness after run settlement

Idle snapshots emitted while the autonomous run record still existed could not wake queued delivery. Publish terminal state after clearing that run, and keep already debounced busy retries ready for the next turn boundary.

* fix(server): apply queued modes only after run admission

Preparing a later mode group could change the running turn before busy admission rejected it. Carry the requested mode into the reserved run and apply it immediately before provider startup, leaving earlier and concurrently started turns untouched.

* fix(server): keep later mode groups queued until turn end

Dispatching every mode group at once prepared later modes against the preceding turn. Keep later groups pending and reject busy sends before changing mode, leaving mode validation outside run startup.

* fix(server): deliver provider commands during queued turns

Offer waiting messages individually through the provider-owned out-of-band path while a recipient runs. Recognized commands retain their existing behavior, while ordinary messages keep waiting without starting their dispatch observers.

* fix(server): offer queued commands once while running

Remember provider declines so timer retries do not repeat side effects or reinterpret a waiting message after provider state changes.

* fix(server): defer commands that request a session mode

An explicit mode belongs to a later turn. Keep those commands on the normal idle dispatch path so an out-of-band offer cannot ignore the requested mode or change the running turn.
2026-11-16 16:02:47 +07:00
Mohamed Boudra e19980a6c9 Dismiss chat errors and identify timed-out requests (#9837)
* fix(app): dismiss chat errors and identify timed-out requests

* test(client): assert subscription timeout codes

* refactor(app): keep toast errors on the existing string boundary

* test(app): remove redundant toast duration coverage
2026-11-16 15:06:24 +07:00
paseo-bot[bot] fa8ba1bd3b test(terminal): wait for the live worker's socket before reaping (#9835)
The reaper signals a worker only after its socket accepts. The two
"cannot be opened for a moment" tests spawned a listening worker and
reaped without waiting for the listen, so on a loaded runner the reaper
found no socket, left the worker alive, and the test failed after
waitUntilGone's 5s deadline. Spawn the worker through a helper that
resolves once the socket is listening, as the other socket tests in
this file already do.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-16 06:46:25 +00:00
Mohamed Boudra e7e1b44ec8 chore(release): reconcile 0.16.0 metadata into main (#9833) 2026-11-16 13:10:33 +07:00
paseo-bot[bot]andClaude Opus 5.5 ee3a3ba8c5 test(app): pick a new port when an isolated daemon loses its reserved one (#9815)
The isolated host daemon helper reserves a port, releases it, and passes
it to the daemon. Another process can bind it in between, and the daemon
exits with EADDRINUSE. That failed a Playwright worker's own daemon in
the e2eWorker fixture. The first start now reserves a fresh port and
starts again when the daemon reports EADDRINUSE; restart() keeps the
endpoint the app already knows.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 06:03:13 +00:00
d15190803a Show Pi model names with slashes and underscores in full (#9823)
* fix(pi): keep slashes and underscores in model display names

Pi model labels were built as `${provider}/${name}` and then cut at the
last `/`, so a free-text name such as "... ~60-70 tok/s, 52/56)" was shown
as "56)". Underscores were also rewritten to spaces ("IQ3_S" -> "IQ3 S").
The compact model trigger in the app repeated the last-`/` cut.

Build the Pi label from the model's own `name`/`id`: shorten only
path-like values with no whitespace (OpenRouter reports names like
"google/gemini-2.5-flash-lite"), and keep free-text names intact. The
compact trigger now strips only a leading provider namespace.

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

* test(pi): cover model labels through the catalog and drop stale ACP copies

acp-agent.test.ts still imported transformPiModels, which the Pi label
fix removed, so its modelTransformer test and a stale copy of the old
Pi label tests failed. The modelTransformer test now supplies its own
transformer, and the Pi label cases run through fetchCatalog with the
reported model names instead of an exported helper.

Co-authored-by: Rahul Sharma <19687913+rms523@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(pi): keep colons inside free-text model names

The vendor-prefix strip cut a free-text Pi name at its first ": ", so
"Qwen3 IQ3_S (tail skip: on, 52/56)" showed as "on, 52/56)". Strip only
when the text before ": " has no parenthesis or comma, which keeps
OpenRouter's "Vendor: Model" names shortened.

Co-authored-by: Rahul Sharma <19687913+rms523@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Rahul Sharma <19687913+rms523@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-16 04:55:28 +00:00
Josh BendavidandClaude Opus 5.5 ade3817a45 fix(server): fall back to the next socket directory when the bind is refused (#9214)
A PASEO_HOME on AFS passes the socket directory checks, then refuses the
Unix socket bind with EPERM, and the terminal worker failed to start. The
worker now binds each eligible candidate in turn and moves on when the
filesystem refuses the socket (EPERM, EACCES, EOPNOTSUPP, ENOTSUP). Other
listen errors still fail the start.

Fixes #9213

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 03:56:04 +00:00
Mohamed Boudra 4f97abc62a fix(app): align composer fullscreen controls with the text rail (#9821)
Fullscreen controls retained a fixed toolbar overhang and aligned to the Send arrow inside its disc. Align their visible glyph edges with the text column independently of the toolbar geometry.
2026-11-16 10:07:15 +07:00
Mohamed Boudra 39db933e6b Keep submitted prompts scrolling down through existing momentum (#9806)
* fix(app): preserve submit scroll through existing momentum

A prompt sent during an active gesture requested the bottom, but the older gesture cancelled that request when momentum ended away. Honor the still-sticky pending request on release while allowing a newer gesture to take ownership.

* fix(app): keep delayed navigation behind user scroll intent
2026-11-16 09:40:00 +07:00
Mohamed Boudra a7a12ef4cd fix(app): keep expanded tool details within their group (#9770)
* fix(app): bound complete inline tool details within groups

Apply the detail height allowance to the complete input/output/error disclosure so expanding a tool cannot bury its collapse header outside the group viewport.

* test(app): verify tool disclosure geometry across painted frames

* test(app): measure disclosure bounds without evidence capture

* fix(app): give capped tool details one vertical scroll owner

* fix(app): allow inline tool details to scroll on iPad

A hover-only Pressable claimed the native responder around the detail scroll view. Keep hover reporting on a passive View so drags reach the capped detail and its later sections remain accessible.

* fix(app): preserve scroll position inside overflowing tool groups

Content-size changes also come from nested disclosures. Follow newly appended calls while preserving the reader’s position when a disclosure changes height.

* test(app): assert inline tool visibility on iPad

Offscreen Output nodes exist before the pan, so selector waits cannot prove reachability. Assert visibility before and after scrolling and verify that collapsing hides the contents before reopening.

* refactor(app): remove unused tool detail hover callbacks

* docs(app): correct inline detail test coverage note

* fix(app): apply grouped detail allowance to reasoning
2026-11-16 09:37:55 +07:00
paseo-bot[bot]andClaude Opus 5.5 0273b6b614 fix(app): end bare URLs at CJK and fullwidth punctuation (#9799)
A bare URL that md4c does not autolink is linked by the text-link
pattern. That pattern stopped only at ASCII whitespace, quotes and
sentence punctuation, so "https://a.com、https://b.com!" became one
link, and "看这里:https://example.com/foo,还有" linked ",还有" too.
Opening the link went to a URL ending in the encoded punctuation.

CJK, fullwidth and typographic punctuation (、。,()【】「」“”…) now
ends the URL. CJK letters in paths still stay in the link.

Refs #9743

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:52:24 +00:00
paseo-bot[bot]andClaude Opus 5.5 8c88b83cd8 fix(server): preview the newest turn's reply in finished notifications (#9793)
A turn the provider starts on its own, such as Claude waking after a
background subagent, has no user message before its reply. The last
assistant message lookup joined every adjacent assistant row, so it
returned the previous turn's reply with the new one appended, and the
220-character notification preview showed only the old reply.

Stop the backward scan at the turn boundary so the lookup returns only
the newest turn's reply, while chunks of one turn are still joined.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:02:46 +00:00
tieoandClaude Opus 5.5 b55955541e fix(dictation): surface the daemon's stream error instead of a delivery timeout (#9784)
The daemon drops a dictation stream when its STT session errors and answers
every later chunk with dictation_stream_error. The app only listened for
acks, so finishing waited 30s and reported a generic timeout. The sender now
fails finish with the daemon's message, and the daemon logs the failure that
dropped the stream once instead of nothing.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:05:47 +00:00
paseo-bot[bot] 2c5f5a1485 test(e2e): keep the planted zombie until its shell has exec'd (#9808)
The daemon-lifecycle cleanup-failure test planted a zombie with
`sleep 0 & echo $!; exec sleep 600`. dash reaps any exited child after
a builtin, so when `sleep 0` exited before `echo` returned, the shell
reaped it and `ps -o stat= -p <pid>` failed. The child now reads fd 3
until the helper closes it, which it does only after the shell has
become `sleep`.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-15 18:38:16 +00:00
685e113358 Fail paseo agent wait when no agent matches the id (#9782)
* fix(cli): fail agent wait when the daemon resolved no agent

The daemon answers wait_for_finish with status "error" both when it could not
resolve the identifier to an agent (final: null) and when the agent it did
resolve finished in error (final: the agent payload). runWaitCommand handed
both to buildWaitResult, which returns a normal result row, so
`paseo agent wait <unknown id>` printed "Agent not found: ..." and exited 0
while every sibling command exits 1 with AGENT_NOT_FOUND (#9736).

Throw AGENT_NOT_FOUND when the state is error and the payload is null, and let
that command error through the inner catch instead of rewrapping it as
WAIT_FAILED. A genuine agent failure still carries its payload, so it keeps
printing its result row. The wire schema is unchanged.

* test(cli): cover the agent wait not-found mapping without module mocks

Move the not-found decision into buildWaitResult, which maps the daemon's
wait reply to the command result, and test that function directly with plain
reply objects instead of mocking the daemon client module. The e2e test in
tests/11-agent-wait.test.ts still covers the command against a real daemon.

Co-authored-by: Eapp1e <163811520+Eapp1e@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cli): keep daemon errors during agent wait reported as WAIT_FAILED

Map the wait reply to the result after the wait's try/catch, so the
AGENT_NOT_FOUND error leaves without the inner catch passing every coded
error through. Connection and RPC errors from waitForFinish are wrapped as
WAIT_FAILED again, as on main.

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

---------

Co-authored-by: Eapp1e <163811520+Eapp1e@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:54:27 +00:00
Huyvux12 28322f1519 fix(server): include local provider config when turn detection is local (#9766) (#9779) 2026-11-15 17:09:46 +00:00
4421f0473a Archive non-Git workspaces from the command center (#9777)
* fix(app): show archive workspace in command center

* test(app): cover archive workspace command center entry

* fix(app): expose archive for non-git workspaces

* fix(app): archive non-Git workspaces from the command center

A plain directory workspace had no Archive workspace entry in the command
center, because the entry came only from the Git action list, which is
empty outside Git. The command center now lists archive for any workspace
that is not Git and runs the workspace's own archive controller, the same
one the Git action uses, so it works whether or not the workspace's
sidebar row is rendered.

Git workspaces are unchanged: archive stays a Git action that shows on
the default list only when it is the promoted primary action.

Co-authored-by: Andreas Heiberg <andreas@heiberg.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Andreas Heiberg <andreas@heiberg.io>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:59:25 +00:00
paseo-bot[bot] 2a432b1e0a test(app): wait for the slash search itself before erasing it (#9790)
The arrow-choice test waited for /tdd to leave the list as proof that
the search had become "h". The option list is a FlatList that mounts
only the rows near its scroll position: right after the arrows wrap to
/exit at the top, /tdd at the bottom is unmounted while the search is
still "". The wait then passed early, Backspace landed before the
cursor reached the search, the /exit choice stood, and Enter archived
the agent.

The test now waits for a popover that shows /help with neither /tdd
nor /exit, in one query. With the search at "" the list always mounts
the bottom row or the chosen one; only the search "h" leaves both out.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-15 15:51:53 +00:00
Mohamed Boudra 1c175b36b3 Keep a dropped Usage card in its new slot on web (#9780)
On web and desktop, dropping a Usage card made it jump above its new slot
and slide back down for 200 ms.

The web list cleared its drag state on drop and rendered the owner's data
again. Usage saves the order through app settings, so the new order
arrived in a later render. The render in between had the old order with
dnd-kit's transforms cleared, which started a transition back to the old
slot. The new order then moved the row's slot under that running
transition.

The list now holds the dropped key order until the owner's data changes
order, and renders the owner's current rows in that order. The drop and
the new order commit in one render, so dnd-kit skips the transition. A
drag that starts during the hold picks up the rows as displayed. Sidebar
lists already reorder in the drop's render and behave as before. The
native list has followed the same rule since #9748.
2026-11-15 21:51:37 +07:00
Junjie ZHANG aa9984b899 fix(app): show the keyboard focus ring on icon buttons (#9745)
The shared icon button chrome set outlineWidth: 0, which overrides the
:focus-visible ring from public/index.html. Header and toolbar icon
buttons (sidebar toggle, workspace actions, Explorer toggle, new tab,
pane menu, diff toolbar) showed no indication of keyboard focus.

Drop the reset and draw the ring 2px inside the frame: the header title
row clips overflow, so an outset ring loses its top and bottom edges.
Pointer focus stays unringed through the existing *:focus rule.
2026-11-15 13:53:12 +00:00
Mohamed Boudra c4ff5599c7 fix(app): close slash picker after inserting a command (#9755)
Publish the resolved replacement selection to the composer. iOS does not emit a native selection event for this edit, leaving autocomplete at the slash until the next keystroke.
2026-11-15 20:34:17 +07:00
Mohamed Boudra ef146bc62d Browse, install and manage plugins from a built-in gallery (#9752)
* feat(app): browse, install and manage plugins from a built-in gallery

Settings → Host → Plugins becomes a gallery with two tabs. Installed lists
the host's plugins with on/off switches and pending updates. Browse lists the
plugin directory with featured cards, categories, sorting and search. Each
plugin has its own page with its screenshots, overview, details, install or
on/off controls, and its own settings screens inline.

Every install asks first, in a sheet naming the source and version, because
installing runs the plugin's code on the host. Uninstalling also asks first;
its confirm says what is deleted.

The daemon fetches the directory from its configured registry
(plugin.registry.list/get, gated by server_info.features.pluginRegistry). The
app never fetches from the registry itself, so a host with a private registry
shows that registry.

README overviews render with the registry's overview contract (the same one
the website uses): only https links and images work, and nothing is read as a
workspace file. Before this, a word like "Node.js" became a broken relative
link.

* fix(app): refresh plugin failures and leave Settings cleanly from a plugin page

The Installed row read the app-side evaluation error without subscribing to the
registry, so a plugin fixed by Reload kept its "failed" badge. Rows and the
plugin page now subscribe through usePluginEvaluationError.

Leaving Settings with no remembered workspace replaced only the top stack entry;
with a plugin page pushed on top, the Plugins list stayed mounted underneath and
reopening Settings stacked a second copy. Dismiss the Settings entries first.

* fix(app): keep Browse working as the registry grows, and test it end to end

Registry listings now reach apps through an open wire schema
(plugin.registry.list/get carry PluginListing*), and the daemon drops a listing
it cannot read instead of failing the whole index. A registry that adds an
artifact kind or bumps schemaVersion no longer breaks Browse on older apps.

The gallery picks its opening tab once, so installing the first plugin keeps
the user on Browse. README links open only https: the parser still autolinks
bare http, www and email text, so a press checks the URL again.

Adds a Browse e2e test against a local registry and Git repository: install
from a row through the confirm sheet, stay on Browse, open the listing page,
uninstall from it.

* test(server): give the oversized-sibling diff refresh the same time budget as its siblings

expect.poll defaults to one second, which a Windows git diff refresh can exceed.

* test(server): wait as long as the other observer tests for native watcher events

expect.poll defaults to one second; macOS FSEvents can deliver later than that on CI.

* fix(app): keep a listed plugin's page usable after uninstalling it, and fetch the directory less

An installed plugin's page finds its listing through the plugin, so uninstalling
a directory plugin from the Installed tab left "not installed or listed" with no
way back. The page now becomes the listing's page, offering Install again.

Updates are re-checked when the host's plugins change and after a failed update,
whose proposal named a revision that no longer exists. The directory, listing
and update queries refetch on mount only once stale, so opening a plugin's page
no longer refetches the whole directory and every update check.

* test(app): install the plugin before opening Plugins in the busy-queue reload test

Plugins opens on Browse when the host has no plugins and stays there after the first install, so a plugin installed through the daemon after the page opened never showed on Installed.

* test(website): wait for hydration before scrolling to the hero in a short window

The router resets the scroll position when the page hydrates. Scrolling to the mockup before that left it below the window, so its start line never came on screen and the opening scene never played. It failed 7 of 10 runs on webkit.

* fix(server): show the registry setup error on Browse instead of asking to retry

The registry's request headers were built inside the try around fetch, so a setup error such as credentials over plain HTTP came back as "Could not reach plugin registry. Retry later." Install already built them first.

* fix(app): show plugin errors without the request details meant for logs

A daemon RPC error's message ends with requestType=… code=…; the daemon's own text is in userMessage. Gallery alerts and toasts now show that text.

* fix(app): show why an update failed on the plugin's page

The update operation's failure was recorded under the plugin ID, but the page only read it to show the spinner, so a failed update looked as if nothing happened. The page now shows the error in its own alert, without the plugin's Failed badge, because the installed version keeps running. While an update is still available the button reads Retry.

* fix(app): show a plugin page's update error only while the update is offered

The failed update stayed in the operations store after the plugin was updated elsewhere or uninstalled, so the page kept saying the update failed. The page now shows it with the Update button it belongs to, as the Installed tab's Updates row does, and uninstalling forgets it.
2026-11-15 20:34:13 +07:00
Mohamed Boudra 2e4dab0556 fix(app): preserve Android Usage drag order and sheet gestures (#9748)
On Android, a slow drag on a Usage card handle moved the sheet instead of the
card. A drop in the same slot left the sheet ignoring body swipes. A drop in a
new slot painted the original order for one or two frames.

The sheet gesture now registers a content drag as both a failure requirement
and a simultaneous relation, and the Gorhom patch spreads relation arrays into
RNGH, so the waiting sheet recognizer no longer cancels the card drag.

The old-order frames came from the list clearing its drag state before the
reordered data arrived. The sheet portal forwards changed children from an
effect, so the list committed old data with fresh transform hosts and a cleared
active key, and the new data about 200 ms later. The draggable-flatlist patch
now renews moved hosts and clears the active key in the render that receives
the reordered data. A same-slot drop resets explicitly because its data does
not change. Every native list that uses the patch gets the drop change.

Repro tooling for both device checks is in packages/app/e2e/mobile/usage-drag.
2026-11-15 20:34:07 +07:00
Mohamed Boudra aa988dd8a8 fix(claude): honor bypass without execution permission prompts (#9760)
Approve Claude execution permission callbacks before creating or emitting permission events, preventing approval cards and transient waiting states in Bypass. Keep AskUserQuestion and ExitPlanMode interactive. Add regression coverage for silent approval and live mode changes.
2026-11-15 20:34:05 +07:00
Okan YILDIRIMandpaseo-bot[bot] 781cb8d5b0 fix(server): reject plugin timeline kinds the app cannot register (#7677)
timeline.append accepted any string as the row kind, but the app registers
renderer kinds with /^[a-z][a-z0-9-]*$/. A plugin that appended a kind such as
repro.card got a successful append, then its client setup threw in
addTimelineRenderer and the whole plugin client failed to load.

The daemon now rejects an append whose kind breaks that rule and names the rule
in the error. The wire schema stays a plain string. Document the rule in the
plugin docs.

Fixes #7326

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-15 12:51:47 +00:00
paseo-bot[bot] 116b0a9190 Open the Explorer from its toggle state after a resize to phone width (#9771)
ensureExplorerSidebar clicked the toggle only when no Explorer was
visible. Right after a resize to phone width one still is for a moment:
the wide layout until the app switches, then the closed phone overlay's
first frame. The helper skipped the click and the phone Explorer, which
starts closed, never opened.

The helper now decides from the toggle's aria-expanded, and the
Explorer spec waits for the app shell to switch layouts after resizing.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-15 12:46:57 +00:00
Mohamed Boudra 5a7a60ae50 test(website): wait for hydration before the hero tests scroll (#9762)
The router scrolls the window back to the top when the page hydrates. The
hero tests scrolled to the mockup right after load, so in WebKit the reset
sometimes landed after the test's scroll and the opening scene never started.

The language button turns enabled in the render after that reset. The
changelog and plugins specs already waited on it with their own copies; the
wait now lives in the shared fixtures and the hero tests open the page with it.
2026-11-15 18:32:17 +07:00
Marcel Wysocki dd06bc0833 test(terminal): wait for the newer worker to exit after a kill stop (#9290)
Cleanup counts a worker gone once its socket refuses connections, and the
worker stops listening before its process exits. The test checked the
worker pid right after closeTerminals() resolved, so it failed whenever
the worker was still exiting. Wait for the pid to disappear, as the
adjacent shutdown tests do.
2026-11-15 10:52:01 +00:00
2eba291a8e Keep idle Claude agents running while a session cron or /loop wakeup is pending (#9744)
* fix(claude): keep an idle agent running while it has a session cron

Claude keeps session-only crons and /loop wakeups in its own process, so
stopping that process drops them. The idle runtime cleanup asked the Claude
session whether it could stop, and the session never knew about these jobs:
they appear nowhere on the message stream.

Claude lists them as session_crons on every Stop hook. The session now
records that list, and canStopRuntime() refuses while it is non-empty. The
next Stop after a fire, a CronDelete or an expiry updates the list.

Co-authored-by: KronixDev <35991992+KronixDev@users.noreply.github.com>

* refactor(claude): type the Stop hook with the SDK's hook input

Co-authored-by: KronixDev <35991992+KronixDev@users.noreply.github.com>

* fix(claude): hold the runtime after a cron tool call until the next Stop

Claude lists session crons only in the Stop hook, and runs Stop only for
turns that complete. A turn that called CronCreate and was interrupted or
failed left the count at zero, so idle cleanup could still stop the
process holding the cron. A CronCreate, CronDelete or ScheduleWakeup call
now marks the count unknown until the next Stop reports it.

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

---------

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: KronixDev <35991992+KronixDev@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:01:41 +00:00
Mohamed Boudra 96a143efe9 Show orchestration and remote in the homepage hero (#9750)
* feat(website): show orchestration and remote in an animated hero mockup

The homepage hero now has five scenes: Orchestration, Remote, Code review,
Pull requests, and Plugins. Orchestration and Remote were missing before,
and they are what separates Paseo from a single-machine agent app.

Orchestration, Code review, and Plugins play a script once the mockup is 60%
on screen, and again on every pill click. Each script is a list of beats
(wait, click, type, user, agent, tools, turnEnd, mark) laid end to end. A
non-React clock owns the time and components read one fact at a time, so
only the part that changed renders. A pointer clicks the composer, the
subagents pill, and the review controls. Reduced motion shows each finished
scene.

The right panel is 300px for the file tree and grows to 424px for the pull
request and the plugin. Picking a pill scrolls the pills and the mockup
into view.

* fix(website): keep a picked hero scene playing and scroll it into view the same in every browser

A pill click before the mockup was 60% on screen played its scene, and then
the visibility start played the same scene again from zero. The player now
starts the opening scene only when no scene has played, and the hero stops
the clock when it unmounts.

Picking a pill used scrollIntoView with `nearest`. For an element taller than
the window, each engine picks its own edge, and WebKit left the pill 25%
visible in a 1280x600 window. The hero now computes the scroll itself: the
least that shows the pills and the mockup, never past the pills at the top.

* fix(website): scroll a picked hero scene by where the hero settles, not where it slides

The hero slides up 40px as it enters. A pill clicked during the slide
measured the frame 40px low, so the scroll stopped with the pills 24px above
the window once the slide ended. This was the cause of the WebKit failure in
CI. The earlier explanation, that engines differ on scrollIntoView, was wrong.

The scroll now measures the frame from layout offsets, which ignore the slide.
The test holds the page clock so the slide stays at its first frame.

* test(website): hold the hero's slide-in still when a pill is picked during it

The test stopped the page timers but let time run, so it caught the bug only
when the click landed in the first second after load. It now pauses the clock
before the page loads and checks that the slide is still in progress at the
click.

* test(website): put the hero's 40px slide-in back by hand in the slide-in test

The test held the page clock to freeze the slide, but WebKit did not hold it,
so the test failed on its own precondition. It now waits for the slide to
end, puts the 40px offset on the container, picks a scene, and removes the
offset. Reduced motion makes the scroll instant, so the test asserts the
result without waiting for a scroll to settle.

* fix(website): start the opening hero scene in a window shorter than most of the mockup

The scene waited for 60% of the mockup to be on screen. A window shorter than
60% of the mockup, such as a wide browser with devtools docked at the bottom,
never reaches that, so the scene never started. It now starts when a line 60%
of the way down the mockup is on screen. That is the same moment in an
ordinary window, and a short window reaches it as the page scrolls past.
2026-11-15 16:39:08 +07:00
paseo-bot[bot] fe59a6c1a2 Keep an archived worktree restorable when reconciliation races its removal (#9753)
Archiving a worktree archives its record, then deletes the directory. A
reconciliation pass that listed the workspace before the archive went on
to read its checkout while the directory was being deleted, saw no Git
checkout, and wrote kind "directory" onto the archived record. Undo then
refused to recreate the worktree: "The archived workspace directory no
longer exists and cannot be recreated."

Reconciliation now skips a record that is archived when it re-reads it
and when it writes the update, as it already does when listing.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
2026-11-15 09:34:41 +00:00
309 changed files with 16291 additions and 2880 deletions
+101 -29
View File
@@ -1,45 +1,117 @@
# Changelog
## 0.16.0-beta.2 - 2026-11-11
## 0.16.1 - 2026-11-17
- **Background tasks:** Paseo now shows the background tasks an agent is running, such as shells and monitors, above the composer, with a Stop button for each. Works with Claude Code, Codex and OpenCode v2. ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162) by [@fxlelouarn](https://github.com/fxlelouarn))
- **Plugin sidebar views:** A plugin can replace the sidebar's content with its own layout of workspaces, agents, projects and terminals across every connected host. Pick the view per device under Settings → Sidebar; Paseo's sidebar header and footer stay in place. ([#8906](https://github.com/getpaseo/paseo/pull/8906))
- **Plugin composer controls:** Plugins can add their own controls to the composer, and read and set its prompt, attachments, provider, model, mode and thinking. They can also put the cursor in any agent's composer, add items to New workspace, and store their own metadata on agents and workspaces. ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207))
- **Faster diff loading:** Opening Changes shows the file tree right away while file contents load. Large diffs arrive in batches, so the rest of the app keeps responding while they load, and diffs take priority over the daemon's background worktree scans. ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243))
- **Polish:** The chat stays still when a turn ends, and returning to a chat that has not changed shows it as it is with no refresh. Tool rows show their final title and icon from the first frame, the context window popover opens with usage already loaded, and sidebar hover cards open one at a time. ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175), [#9242](https://github.com/getpaseo/paseo/pull/9242), [#9248](https://github.com/getpaseo/paseo/pull/9248), [#9212](https://github.com/getpaseo/paseo/pull/9212), [#9071](https://github.com/getpaseo/paseo/pull/9071))
- **Rebuilt mobile chat timeline:** The chat timeline on iOS and Android was rebuilt. Expanding or collapsing a turn summary, todo card or tool-call group keeps the line you tapped in place, and on Android so do Show more, Show less and plan cards. ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085))
- **Keyboard shortcuts on mobile:** With a keyboard connected, iPad and Android now run the same shortcuts as desktop, including your custom bindings. Shortcut hints and Settings → Shortcuts appear when a keyboard is detected. Shortcuts also work in narrow desktop and browser windows. ([#8625](https://github.com/getpaseo/paseo/pull/8625) by [@jeroenfrenken](https://github.com/jeroenfrenken), [@lstroud](https://github.com/lstroud))
- **Touch-sized tablet controls:** On iPad and other touch-screen devices, the wide layout now has touch-sized buttons, rows and bars. The composer toolbar folds its controls into the model menu when space runs out, and swiping right on the workspace reveals a collapsed sidebar as an overlay. ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739) by [@zeyugao](https://github.com/zeyugao))
- **Undo workspace archive:** Archiving a workspace in the app now shows a "Workspace archived" toast for six seconds. Undo, or Cmd/Ctrl+Z, restores the workspace with its tabs and agents. On desktop, sidebar workspace rows also get an archive button on hover. ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104))
- **Fewer reconnects on return:** Returning to the app keeps a working connection, including one in the middle of a large response, and reconnects once when it has to. On a host with several saved connections, Paseo stays on the one that works. ([#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116))
### Fixed
- Fixed Claude Bypass approving actions without a permission card when a `permissions.ask` rule or a hook that returns `ask` required one ([#9927](https://github.com/getpaseo/paseo/pull/9927))
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input ([#9909](https://github.com/getpaseo/paseo/pull/9909) by [@michaelhthomas](https://github.com/michaelhthomas))
- Fixed Claude sessions failing until `/login` when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token ([#9855](https://github.com/getpaseo/paseo/pull/9855) by [@daysun-k](https://github.com/daysun-k))
- Fixed Add host text fields on web drawing without a box, which left the host password field invisible ([#9865](https://github.com/getpaseo/paseo/pull/9865) by [@angusb93](https://github.com/angusb93))
- Fixed an OpenCode question that could not be answered or dismissed after a new message steered the turn ([#9891](https://github.com/getpaseo/paseo/pull/9891))
- Fixed Pi and OMP model names that contain `/` being cut to the text after the last slash ([#9823](https://github.com/getpaseo/paseo/pull/9823), [#9836](https://github.com/getpaseo/paseo/pull/9836) by [@rms523](https://github.com/rms523))
- Fixed Changes leaving out an edit when the file was saved with the same size in the same second it was staged ([#9854](https://github.com/getpaseo/paseo/pull/9854))
- Fixed an error toast that never closed when marking a chat as read failed ([#9837](https://github.com/getpaseo/paseo/pull/9837))
- Fixed wait results and finish notifications after a daemon restart joining an agent's self-started reply to the reply before it ([#9846](https://github.com/getpaseo/paseo/pull/9846))
- Fixed Codex chats staying loaded in the daemon until restart when a client opened them only to read their history ([#9859](https://github.com/getpaseo/paseo/pull/9859) by [@Spshulem](https://github.com/Spshulem))
## 0.16.0 - 2026-11-16
- **Background tasks:** See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2. ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162), [#9635](https://github.com/getpaseo/paseo/pull/9635) by [@fxlelouarn](https://github.com/fxlelouarn))
- **Built-in plugin gallery:** Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page. ([#9752](https://github.com/getpaseo/paseo/pull/9752))
- **Command center tabs:** Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace. ([#9689](https://github.com/getpaseo/paseo/pull/9689))
- **Plugin sidebar views:** Plugins can replace the sidebar with their own workspace and agent layout across connected hosts. Choose a view per device in Settings → Sidebar. ([#8906](https://github.com/getpaseo/paseo/pull/8906))
- **Plugin composer controls:** Plugins can add composer controls, edit drafts and attachments, and change agent settings. They can also add New workspace items and save metadata on agents and workspaces. ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207), [#9734](https://github.com/getpaseo/paseo/pull/9734) by [@michaelmwu](https://github.com/michaelmwu))
- **Arrange Usage cards:** Drag provider cards into your preferred order and turn off cards you do not want in the sidebar summary. Choose the host from Usage settings. ([#9660](https://github.com/getpaseo/paseo/pull/9660), [#9740](https://github.com/getpaseo/paseo/pull/9740), [#9748](https://github.com/getpaseo/paseo/pull/9748), [#9780](https://github.com/getpaseo/paseo/pull/9780))
- **Quieter app reopening:** Returning to an unchanged chat no longer flashes “Updating messages.” Paseo keeps healthy connections open and recovers dropped connections when you return. After reconnecting, an up-to-date chat no longer shows an extra update toast. ([#9242](https://github.com/getpaseo/paseo/pull/9242), [#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116), [#9558](https://github.com/getpaseo/paseo/pull/9558) by [@adamcstephens](https://github.com/adamcstephens))
- **Rebuilt mobile chat:** Expanding turn summaries, todo cards and tool groups keeps your reading position on iOS and Android. Sending during a scroll moves to the new prompt. ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085), [#9806](https://github.com/getpaseo/paseo/pull/9806), [#9693](https://github.com/getpaseo/paseo/pull/9693))
- **Faster diff loading:** Changes shows the file tree before file contents finish loading. Large diffs load in batches and take priority over background worktree scans. ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243), [#9584](https://github.com/getpaseo/paseo/pull/9584))
- **Faster composer menus:** Command and file suggestions open sooner in large lists and stay against the composer as it changes size. ([#9657](https://github.com/getpaseo/paseo/pull/9657), [#9647](https://github.com/getpaseo/paseo/pull/9647), [#9642](https://github.com/getpaseo/paseo/pull/9642))
- **Keyboard shortcuts on mobile:** A connected keyboard gives iPad and Android the same shortcuts as desktop, including custom bindings. Shift+Tab in the iPad composer switches mode without typing a tab. ([#8625](https://github.com/getpaseo/paseo/pull/8625), [#9561](https://github.com/getpaseo/paseo/pull/9561) by [@jeroenfrenken](https://github.com/jeroenfrenken), [@lstroud](https://github.com/lstroud))
- **Touch-sized tablet controls:** Wide layouts on touch devices have larger buttons and rows. The composer folds controls into the model menu when space runs out. ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739) by [@zeyugao](https://github.com/zeyugao))
- **Undo workspace archive:** Restore an archived workspace with Undo or Cmd/Ctrl+Z during the six-second toast. Paseo checks for unsaved files and unpushed commits before removing a worktree. ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104), [#9625](https://github.com/getpaseo/paseo/pull/9625), [#9753](https://github.com/getpaseo/paseo/pull/9753) by [@ragokan](https://github.com/ragokan))
### Added
- Added a Change base picker in Changes for worktree workspaces, so diffs, the commit list and Git actions can use another branch ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934) by [@Myasuka](https://github.com/Myasuka))
- Added links for issue and pull request references such as `#123` and `owner/repo#123` in agent replies, plans, the pull request panel and file previews, for GitHub, GitLab, Gitea, Forgejo and Codeberg ([#8636](https://github.com/getpaseo/paseo/pull/8636))
- Added iPhone Duo layout support: workspace actions sit in the system vertical bar, and the sidebar and workspace split on either side of the fold ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901) by [@zeyugao](https://github.com/zeyugao))
- Added a Change base picker for worktree diffs, commits and Git actions ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934) by [@Myasuka](https://github.com/Myasuka))
- Added issue and pull request links that resolve SSH aliases and fork parent repositories ([#8636](https://github.com/getpaseo/paseo/pull/8636), [#9576](https://github.com/getpaseo/paseo/pull/9576))
- Added an iPhone Duo layout with the sidebar and workspace on opposite sides of the fold ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901) by [@zeyugao](https://github.com/zeyugao))
- Added fx as a provider you can add from the provider catalog in Settings → Hosts → Providers ([#9160](https://github.com/getpaseo/paseo/pull/9160))
- Added background agents: an agent or plugin can create a helper with `background: true` that opens no tab, sends no notification and stays out of the sidebar and default agent lists ([#8683](https://github.com/getpaseo/paseo/pull/8683))
- Added background agents that stay out of tabs, notifications and default agent lists ([#8683](https://github.com/getpaseo/paseo/pull/8683))
- Added syntax highlighting for Terraform and HCL files (`.tf`, `.tfvars`, `.hcl`) ([#9106](https://github.com/getpaseo/paseo/pull/9106))
- Added `PASEO_WORKSPACE_ID` to each agent's environment so an agent can identify, rename or archive its own workspace ([#8939](https://github.com/getpaseo/paseo/pull/8939) by [@DTTerastar](https://github.com/DTTerastar))
- Added plugin badges to sidebar workspace rows ([#7645](https://github.com/getpaseo/paseo/pull/7645) by [@jtomaszewski](https://github.com/jtomaszewski))
- Added a Download button for files without a preview ([#9640](https://github.com/getpaseo/paseo/pull/9640))
- Added Copilot premium-request usage and remaining quota to Usage ([#8489](https://github.com/getpaseo/paseo/pull/8489) by [@thisisryanswift](https://github.com/thisisryanswift))
### Changed
- Changed opening a workspace to restore the tab you left instead of jumping to the agent that needs attention ([#8935](https://github.com/getpaseo/paseo/pull/8935))
- Changed question cards so picking an option no longer advances automatically; continue with Next or Submit ([#8525](https://github.com/getpaseo/paseo/pull/8525))
- Changed the slash command menu to show loading and error states with Retry, and to stop selecting `/exit` by default ([#8905](https://github.com/getpaseo/paseo/pull/8905))
- Changed the workspace header and tabs to switch to compact controls when Explorer or a split pane narrows the workspace ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088) by [@zeyugao](https://github.com/zeyugao))
- Changed question cards to wait for Next or Submit after you select an option ([#8525](https://github.com/getpaseo/paseo/pull/8525))
- Changed the slash command menu to stop selecting `/exit` by default ([#8905](https://github.com/getpaseo/paseo/pull/8905))
- Changed workspace header controls to fit narrow split panes ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088) by [@zeyugao](https://github.com/zeyugao))
- Changed sending a message to a Pi agent whose process has exited to fail immediately with an instruction to reload the agent ([#8718](https://github.com/getpaseo/paseo/pull/8718))
- Changed Rename workspace in the sidebar on desktop and wide web layouts to edit the title in place instead of opening a dialog ([#9280](https://github.com/getpaseo/paseo/pull/9280))
- Changed What's new and the website changelog to show a release's highlights first, with the full list behind Show all changes ([#9281](https://github.com/getpaseo/paseo/pull/9281))
- Changed What's new to show highlights first, with the full list behind Show all changes ([#9281](https://github.com/getpaseo/paseo/pull/9281))
- Changed Claude Bypass to approve execution requests from ask rules and hooks while keeping questions and plan review interactive ([#9760](https://github.com/getpaseo/paseo/pull/9760))
- Changed Claude permission cards to show the reason supplied by the provider ([#3950](https://github.com/getpaseo/paseo/pull/3950) by [@codebutler](https://github.com/codebutler))
- Changed the pull request pane so Activity can be resized or collapsed to give checks more space ([#9656](https://github.com/getpaseo/paseo/pull/9656))
- Changed macOS desktop tab shortcuts to Cmd+Shift+[ and Cmd+Shift+] ([#7692](https://github.com/getpaseo/paseo/pull/7692) by [@jtomaszewski](https://github.com/jtomaszewski))
- Changed Cmd/Ctrl+N on New workspace to open the project chooser without leaving the draft ([#9741](https://github.com/getpaseo/paseo/pull/9741))
- Changed mobile Settings navigation to restore the sidebar where you left it ([#9641](https://github.com/getpaseo/paseo/pull/9641))
### Fixed
- Fixed long tool details hiding their collapse header or preventing scrolling through their output ([#9770](https://github.com/getpaseo/paseo/pull/9770))
- Fixed image previews briefly showing an error or a stretched image while loading ([#9698](https://github.com/getpaseo/paseo/pull/9698))
- Fixed web and desktop chats jumping to the beginning when older history became virtualized ([#9664](https://github.com/getpaseo/paseo/pull/9664) by [@luoph](https://github.com/luoph))
- Fixed older chat history requiring another mouse-wheel movement after reaching the top ([#9570](https://github.com/getpaseo/paseo/pull/9570))
- Fixed losing code indentation and line breaks when copying a selection across part of a code block ([#9515](https://github.com/getpaseo/paseo/pull/9515) by [@michaelmwu](https://github.com/michaelmwu))
- Fixed overlapping axis titles and clipped labels in Mermaid XY charts ([#9483](https://github.com/getpaseo/paseo/pull/9483) by [@FluidXin](https://github.com/FluidXin))
- Fixed the iOS command menu staying open after tapping a command ([#9755](https://github.com/getpaseo/paseo/pull/9755))
- Fixed retrying an edited agent draft after a failed start ([#9534](https://github.com/getpaseo/paseo/pull/9534) by [@michaelmwu](https://github.com/michaelmwu))
- Fixed model profile buttons ignoring taps on Android tablets ([#9526](https://github.com/getpaseo/paseo/pull/9526) by [@moevis](https://github.com/moevis))
- Fixed Settings losing scroll position and edits after appearance changes ([#9605](https://github.com/getpaseo/paseo/pull/9605))
- Fixed unreadable selected rows in light plugin themes and barely visible highlights in Pure Black ([#9579](https://github.com/getpaseo/paseo/pull/9579) by [@nathansgreen](https://github.com/nathansgreen))
- Fixed missing keyboard focus rings on header and toolbar icon buttons on web and desktop ([#9745](https://github.com/getpaseo/paseo/pull/9745) by [@junjzhang](https://github.com/junjzhang))
- Fixed sidebar rows flashing in the wrong position after a drag on iOS and Android ([#9681](https://github.com/getpaseo/paseo/pull/9681))
- Fixed desktop startup reporting failure while its daemon was still starting ([#9043](https://github.com/getpaseo/paseo/pull/9043) by [@magiclaw](https://github.com/magiclaw))
- Fixed typed characters being lost while web and desktop terminals restored their screen ([#9533](https://github.com/getpaseo/paseo/pull/9533))
- Fixed physical arrow keys failing in Android terminals and dropping the next typed character ([#9407](https://github.com/getpaseo/paseo/pull/9407) by [@moevis](https://github.com/moevis))
- Fixed non-Git workspaces missing Archive workspace in the command center ([#9777](https://github.com/getpaseo/paseo/pull/9777) by [@andheiberg](https://github.com/andheiberg))
- Fixed workspace scripts disappearing when a later configuration read timed out ([#9477](https://github.com/getpaseo/paseo/pull/9477) by [@dinhphieu](https://github.com/dinhphieu))
- Fixed sidebar Usage hiding an account after its usage refresh failed ([#9594](https://github.com/getpaseo/paseo/pull/9594))
- Fixed closed agents staying unread when their provider session no longer existed ([#9737](https://github.com/getpaseo/paseo/pull/9737) by [@luoph](https://github.com/luoph))
- Fixed completion notifications showing an older reply after an autonomous agent turn ([#9793](https://github.com/getpaseo/paseo/pull/9793))
- Fixed interrupting messages failing with "already has an active run" ([#9537](https://github.com/getpaseo/paseo/pull/9537) by [@michaelmwu](https://github.com/michaelmwu))
- Fixed message retries being refused after a failure before delivery to the provider ([#9580](https://github.com/getpaseo/paseo/pull/9580) by [@tmad4000](https://github.com/tmad4000))
- Fixed newly reopened agents losing their provider process on the next idle-cleanup sweep ([#8857](https://github.com/getpaseo/paseo/pull/8857) by [@fdkevin0](https://github.com/fdkevin0))
- Fixed Claude session crons and /loop wakeups being lost to idle runtime cleanup ([#9744](https://github.com/getpaseo/paseo/pull/9744) by [@KronixDev](https://github.com/KronixDev))
- Fixed forking from a reply when a tool started before it and finished afterward ([#9627](https://github.com/getpaseo/paseo/pull/9627) by [@ragokan](https://github.com/ragokan))
- Fixed large Codex history pages stopping history loading when their individual items still fit ([#9432](https://github.com/getpaseo/paseo/pull/9432) by [@RockStone](https://github.com/RockStone))
- Fixed OpenCode sessions failing to reconnect after a daemon restart when OpenCode used Bun ([#9653](https://github.com/getpaseo/paseo/pull/9653) by [@quickwind](https://github.com/quickwind))
- Fixed provider refresh retaining OpenCode v1 after an upgrade to v2 ([#9593](https://github.com/getpaseo/paseo/pull/9593) by [@tkfka1](https://github.com/tkfka1))
- Fixed OpenCode v2 failing to discover plugin tools available only to its session ([#9426](https://github.com/getpaseo/paseo/pull/9426) by [@dptsolutions](https://github.com/dptsolutions))
- Fixed ACP models sharing the wrong thinking levels when the provider supplied levels per model ([#9717](https://github.com/getpaseo/paseo/pull/9717) by [@AlfredRR](https://github.com/AlfredRR), [@doskoi](https://github.com/doskoi))
- Fixed failed ACP tools without output preventing conversation history from loading ([#9467](https://github.com/getpaseo/paseo/pull/9467) by [@Myasuka](https://github.com/Myasuka))
- Fixed Pi and OMP tool calls with null optional arguments appearing as unknown tools ([#9506](https://github.com/getpaseo/paseo/pull/9506) by [@papag00se](https://github.com/papag00se))
- Fixed imported OMP sessions saving a file path instead of their session ID ([#8854](https://github.com/getpaseo/paseo/pull/8854) by [@LiebeLee](https://github.com/LiebeLee))
- Fixed cross-host child agents losing their caller's mode when both used the same provider ([#9512](https://github.com/getpaseo/paseo/pull/9512) by [@ortschun](https://github.com/ortschun))
- Fixed plugin child agents changing from failed or canceled to completed when their session closed ([#8563](https://github.com/getpaseo/paseo/pull/8563) by [@hadan8977](https://github.com/hadan8977))
- Fixed CLI commands acting on a different agent whose title matched a missing full agent ID ([#9680](https://github.com/getpaseo/paseo/pull/9680), [#9731](https://github.com/getpaseo/paseo/pull/9731) by [@ese111](https://github.com/ese111))
- Fixed archive, detach and reload failing for agents omitted from the CLI listing ([#9726](https://github.com/getpaseo/paseo/pull/9726) by [@xunWhale](https://github.com/xunWhale))
- Fixed `paseo agent wait` exiting successfully when no agent matched the ID ([#9782](https://github.com/getpaseo/paseo/pull/9782) by [@Eapp1e](https://github.com/Eapp1e))
- Fixed voice mode failing to start when speech input and output both used OpenAI ([#9779](https://github.com/getpaseo/paseo/pull/9779) by [@Huyvux12](https://github.com/Huyvux12))
- Fixed dictation hiding a stream error behind a 30-second delivery timeout ([#9784](https://github.com/getpaseo/paseo/pull/9784) by [@tieo](https://github.com/tieo))
- Fixed plugin providers rejecting Review attachments in All mode ([#9590](https://github.com/getpaseo/paseo/pull/9590) by [@ese111](https://github.com/ese111))
- Fixed plugin timeline writes accepting kinds that the app could not show ([#7677](https://github.com/getpaseo/paseo/pull/7677) by [@ragokan](https://github.com/ragokan))
- Fixed the chat moving when a turn ended ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175))
- Fixed Claude and OpenCode tool rows changing their title and icon as arguments arrived ([#9248](https://github.com/getpaseo/paseo/pull/9248))
- Fixed the context window popover opening before usage was loaded ([#9212](https://github.com/getpaseo/paseo/pull/9212))
- Fixed sidebar hover cards opening together ([#9071](https://github.com/getpaseo/paseo/pull/9071))
- Fixed the working indicator disappearing when returning to a chat whose agent finished while you were away ([#9170](https://github.com/getpaseo/paseo/pull/9170))
- Fixed chats with short collapsed turns opening with empty space until you scrolled ([#8358](https://github.com/getpaseo/paseo/pull/8358), [#9083](https://github.com/getpaseo/paseo/pull/9083))
- Fixed Collapse turns hiding an earlier reply inside a later turn's summary line after an idle Claude, Codex or OpenCode agent was resumed ([#9098](https://github.com/getpaseo/paseo/pull/9098))
- Fixed the missing space between a prompt and the reply or collapsed-turn summary line below it ([#9009](https://github.com/getpaseo/paseo/pull/9009))
- Fixed a long user message showing without its fade and Show more for one frame when a chat opened ([#9302](https://github.com/getpaseo/paseo/pull/9302))
- Fixed Markdown tables showing as literal pipes when written directly below a paragraph with no blank line ([#8485](https://github.com/getpaseo/paseo/pull/8485) by [@ragokan](https://github.com/ragokan), [@suk-6](https://github.com/suk-6), [@thsrite](https://github.com/thsrite))
- Fixed linked badge images that share a line with text rendering as full-width blocks on web and desktop ([#8530](https://github.com/getpaseo/paseo/pull/8530))
- Fixed View diagram opening fullscreen instead of returning to the inline Mermaid diagram after View source ([#8932](https://github.com/getpaseo/paseo/pull/8932) by [@luoph](https://github.com/luoph))
@@ -47,21 +119,16 @@
- Fixed unsent composer text and attachments being deleted when an agent tab was closed ([#9079](https://github.com/getpaseo/paseo/pull/9079))
- Fixed pasting text with hyperlinks into the composer dropping the link URLs; links now paste as Markdown ([#8972](https://github.com/getpaseo/paseo/pull/8972))
- Fixed the composer losing focus after clicking Send with a mouse ([#9015](https://github.com/getpaseo/paseo/pull/9015))
- Fixed the composer resting 50pt above the bottom edge on iPhone ([#8823](https://github.com/getpaseo/paseo/pull/8823) by [@zeyugao](https://github.com/zeyugao))
- Fixed Add host sending you to Settings from the sidebar and New workspace ([#8512](https://github.com/getpaseo/paseo/pull/8512))
- Fixed a failed agent's red dot and Failed grouping staying in the sidebar after opening the agent or choosing Mark as read ([#8831](https://github.com/getpaseo/paseo/pull/8831))
- Fixed a workspace's unread indicator staying on after it was cleared while the agent's runtime was closed ([#9087](https://github.com/getpaseo/paseo/pull/9087))
- Fixed unarchiving a workspace not restoring the agents that were archived with it ([#9210](https://github.com/getpaseo/paseo/pull/9210))
- Fixed the context window popover closing by itself whenever the chat scrolled during a streaming reply ([#8742](https://github.com/getpaseo/paseo/pull/8742) by [@3ae3ae](https://github.com/3ae3ae))
- Fixed the sidebar usage summary updating only when Usage was opened ([#7806](https://github.com/getpaseo/paseo/pull/7806) by [@ragokan](https://github.com/ragokan))
- Fixed tooltips and menus above their trigger briefly covering it on Android when their content grew after opening ([#9247](https://github.com/getpaseo/paseo/pull/9247))
- Fixed History showing "Could not load history" after reloading the web app on the History screen ([#9029](https://github.com/getpaseo/paseo/pull/9029))
- Fixed section links in an HTML file preview replacing the preview with the Paseo app instead of scrolling within the file ([#8559](https://github.com/getpaseo/paseo/pull/8559) by [@3ae3ae](https://github.com/3ae3ae))
- Fixed Files Refresh leaving a newly created file hidden when its folder was collapsed during the refresh ([#8582](https://github.com/getpaseo/paseo/pull/8582) by [@hadan8977](https://github.com/hadan8977))
- Fixed the branch switcher showing "No branches found" while branches are still loading or after the request fails ([#8938](https://github.com/getpaseo/paseo/pull/8938))
- Fixed commit history showing a doubled slash, no rename status and no diff for a file moved up a directory ([#8509](https://github.com/getpaseo/paseo/pull/8509) by [@hadan8977](https://github.com/hadan8977))
- Fixed a merged pull request disappearing from its workspace when the checkout was behind the pull request's head
- Fixed workspace Git watchers staying in fallback polling after a watcher setup timeout
- Fixed abandoned connections staying open for up to 45 seconds after the web or desktop app reconnected ([#9067](https://github.com/getpaseo/paseo/pull/9067))
- Fixed a connection routed through another host closing with "The receiving client cannot keep up with host output" while fetching a very large timeline ([#9109](https://github.com/getpaseo/paseo/pull/9109))
- Fixed a connected host staying in error after it was updated to a supported version ([#8423](https://github.com/getpaseo/paseo/pull/8423) by [@DAnaeto](https://github.com/DAnaeto))
@@ -123,16 +190,21 @@
- Fixed a plugin the daemon terminated for an invalid message staying listed with no exit reported ([#9285](https://github.com/getpaseo/paseo/pull/9285) by [@Brandon168](https://github.com/Brandon168))
- Fixed ACP provider plugins dropping the token usage an agent reports in its prompt response ([#9396](https://github.com/getpaseo/paseo/pull/9396) by [@Myasuka](https://github.com/Myasuka))
- Fixed the published `@getpaseo/*` npm packages declaring no license; they now declare Apache-2.0 ([#7816](https://github.com/getpaseo/paseo/pull/7816) by [@mdlawson](https://github.com/mdlawson), [@ragokan](https://github.com/ragokan))
- Fixed forking from an earlier reply failing with "This checkpoint changed after it was created" after a plugin updated one of its timeline cards ([#8746](https://github.com/getpaseo/paseo/pull/8746) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
- Fixed Collapse turns leaving a turn open, or folding to an earlier reply, when a plugin renders the final reply ([#8811](https://github.com/getpaseo/paseo/pull/8811) by [@geoqiao](https://github.com/geoqiao))
- Fixed plugin screens showing "This plugin surface is unavailable" while the plugin catalog is still loading after an app reload ([#8123](https://github.com/getpaseo/paseo/pull/8123) by [@vs-tahir](https://github.com/vs-tahir))
- Fixed the Workspaces list being pushed out of the mobile sidebar on short screens when plugins add many navigation items ([#8727](https://github.com/getpaseo/paseo/pull/8727) by [@jaredwang](https://github.com/jaredwang))
- Fixed timeline plugins not receiving the sender, event and original text on agent-message tool calls ([#8492](https://github.com/getpaseo/paseo/pull/8492) by [@RRD-dev](https://github.com/RRD-dev), [@luoph](https://github.com/luoph))
- Fixed plugin RPCs failing when their input or output schema uses a transform ([#8550](https://github.com/getpaseo/paseo/pull/8550))
### Breaking
- Removed the deprecated `agent.turn.after.timeline` SDK field, which always returned an empty list ([#9573](https://github.com/getpaseo/paseo/pull/9573) by [@jtomaszewski](https://github.com/jtomaszewski))
### Notes
- Background tasks, the Change base picker, archive undo, background agents, plugin subscriptions and fx need both the host and the app on this version
- Update both the host and app to use the plugin gallery, background tasks, Change base, archive undo, background agents, plugin subscriptions and fx
- Plugin authors reading `agent.turn.after.timeline` must use `timeline.refetch({ direction: "tail", limit: 1, wholeTurns: true })` and filter entries by `event.turnId`
- Archive undo restores the workspace, not uncommitted files removed with its worktree
## 0.15.4 - 2026-11-10
+101 -29
View File
@@ -1,45 +1,117 @@
# Changelog
## 0.16.0-beta.2 - 2026-11-11
## 0.16.1 - 2026-11-17
- **后台任务**:Paseo 现在会在 Composer 上方显示 Agent 正在运行的后台任务,例如 shell 和监视器,每项都带“停止”按钮。支持 Claude Code、Codex 和 OpenCode v2。 ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162),贡献者:[@fxlelouarn](https://github.com/fxlelouarn))
- **插件侧边栏视图**:插件可以用自己的布局替换侧边栏内容,展示所有已连接主机上的工作区、Agent、项目和终端。在“设置 → 侧边栏”中为每台设备选择视图;Paseo 的侧边栏页眉和页脚保持不变。 ([#8906](https://github.com/getpaseo/paseo/pull/8906))
- **插件 Composer 控件**:插件可以向 Composer 添加自己的控件,并读取和设置其中的提示词、附件、Provider、模型、模式和思考强度。插件还可以把光标放到任意 Agent 的 Composer 中、向“新建工作区”添加条目,并在 Agent 和工作区上保存自己的元数据。 ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207))
- **更快的 diff 加载**:打开“更改”时会立即显示文件树,文件内容随后加载。大型 diff 分批到达,加载期间应用的其他部分照常响应,并且 diff 优先于 daemon 的后台 worktree 扫描。 ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243))
- **细节打磨**:一轮对话结束时聊天保持不动,返回没有变化的聊天时直接显示原样,无需刷新。工具行从第一帧起就显示最终标题和图标,上下文窗口浮层打开时用量已加载完成,侧边栏悬停卡片一次只打开一个。 ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175), [#9242](https://github.com/getpaseo/paseo/pull/9242), [#9248](https://github.com/getpaseo/paseo/pull/9248), [#9212](https://github.com/getpaseo/paseo/pull/9212), [#9071](https://github.com/getpaseo/paseo/pull/9071))
- **重建移动端聊天时间线**:iOS 和 Android 上的聊天时间线已重建。展开或折叠轮次摘要、待办卡片或工具调用组时,你点按的那一行保持原位;在 Android 上,“显示更多”“收起”和计划卡片也是如此。 ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085))
- **移动端键盘快捷键**:连接键盘后,iPad 和 Android 现在可使用与桌面端相同的快捷键,包括你自定义的绑定。检测到键盘时会显示快捷键提示和“设置 → 快捷键”。在较窄的桌面端和浏览器窗口中快捷键同样可用。 ([#8625](https://github.com/getpaseo/paseo/pull/8625),贡献者:[@jeroenfrenken](https://github.com/jeroenfrenken)、[@lstroud](https://github.com/lstroud))
- **适合触控的平板控件**:在 iPad 和其他触屏设备上,宽屏布局现在使用适合触控尺寸的按钮、行和栏。Composer 工具栏在空间不足时会把控件收进模型菜单;在工作区上向右滑动,可将已折叠的侧边栏以浮层方式显示。 ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739),贡献者:[@zeyugao](https://github.com/zeyugao))
- **撤销工作区归档**:在应用中归档工作区时,现在会显示“Workspace 已归档”提示,持续六秒。点击“撤销”或按 Cmd/Ctrl+Z 可恢复该工作区及其标签页和 Agent。在桌面端,侧边栏的工作区行在悬停时还会显示归档按钮。 ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104))
- **返回时更少重连**:返回应用时会保留仍可用的连接,包括正在传输大型响应的连接,只在必要时重连一次。主机保存了多个连接时,Paseo 会留在可用的那个连接上。 ([#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116))
### 修复
- 修复 `permissions.ask` 规则或返回 `ask` 的钩子要求确认时,Claude Bypass 不显示权限卡片就批准操作的问题 ([#9927](https://github.com/getpaseo/paseo/pull/9927))
- 修复触屏笔记本以触控板或鼠标为主要输入时,控件仍使用触控尺寸的问题 ([#9909](https://github.com/getpaseo/paseo/pull/9909),贡献者:[@michaelhthomas](https://github.com/michaelhthomas))
- 修复 Claude Code 正在续期已过期的访问令牌时,Paseo 刷新 Claude 模型列表导致 Claude 会话在执行 `/login` 前一直失败的问题 ([#9855](https://github.com/getpaseo/paseo/pull/9855),贡献者:[@daysun-k](https://github.com/daysun-k))
- 修复 Web 端“添加主机”的文本字段没有输入框,导致主机密码字段不可见的问题 ([#9865](https://github.com/getpaseo/paseo/pull/9865),贡献者:[@angusb93](https://github.com/angusb93))
- 修复新消息引导当前回合后,OpenCode 提问既无法回答也无法关闭的问题 ([#9891](https://github.com/getpaseo/paseo/pull/9891))
- 修复名称包含 `/` 的 Pi 和 OMP 模型被截成最后一个斜杠之后文本的问题 ([#9823](https://github.com/getpaseo/paseo/pull/9823), [#9836](https://github.com/getpaseo/paseo/pull/9836),贡献者:[@rms523](https://github.com/rms523))
- 修复文件暂存后在同一秒内以相同大小保存时,“更改”遗漏该修改的问题 ([#9854](https://github.com/getpaseo/paseo/pull/9854))
- 修复将对话标记为已读失败后,错误提示一直不关闭的问题 ([#9837](https://github.com/getpaseo/paseo/pull/9837))
- 修复 daemon 重启后,等待结果和完成通知把 Agent 自行开始的回复与上一条回复拼接在一起的问题 ([#9846](https://github.com/getpaseo/paseo/pull/9846))
- 修复客户端仅为读取历史而打开的 Codex 对话一直加载在 daemon 中直到重启的问题 ([#9859](https://github.com/getpaseo/paseo/pull/9859),贡献者:[@Spshulem](https://github.com/Spshulem))
## 0.16.0 - 2026-11-16
- **后台任务**:在 Composer 上方查看并停止 Claude Code、Codex 和 OpenCode v2 的后台任务。 ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162), [#9635](https://github.com/getpaseo/paseo/pull/9635),贡献者:[@fxlelouarn](https://github.com/fxlelouarn))
- **内置插件库**:无需离开 Paseo,即可浏览、搜索和安装插件,并在同一页面管理插件设置和更新。 ([#9752](https://github.com/getpaseo/paseo/pull/9752))
- **命令中心标签页**:在工作区、文件和操作之间切换,最近使用的工作区优先显示。搜索现在包含已归档工作区,还可匹配工作区内的 Agent 标题。 ([#9689](https://github.com/getpaseo/paseo/pull/9689))
- **插件侧边栏视图**:插件可以用自己的布局替换侧边栏,展示已连接主机上的工作区和 Agent。在“设置 → 侧边栏”中为每台设备选择视图。 ([#8906](https://github.com/getpaseo/paseo/pull/8906))
- **插件 Composer 控件**:插件可以添加 Composer 控件、编辑草稿和附件,以及更改 Agent 设置。插件还可以添加“新建工作区”条目,并在 Agent 和工作区上保存元数据。 ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207), [#9734](https://github.com/getpaseo/paseo/pull/9734),贡献者:[@michaelmwu](https://github.com/michaelmwu))
- **排列用量卡片**:拖动 Provider 卡片来调整顺序,并关闭不想在侧边栏摘要中显示的卡片。在用量设置中选择主机。 ([#9660](https://github.com/getpaseo/paseo/pull/9660), [#9740](https://github.com/getpaseo/paseo/pull/9740), [#9748](https://github.com/getpaseo/paseo/pull/9748), [#9780](https://github.com/getpaseo/paseo/pull/9780))
- **返回应用时更少提示**:返回没有变化的聊天时,不再闪现“正在更新消息”。Paseo 会保留可用的连接,并在你返回时恢复断开的连接。重连后,已是最新状态的聊天也不再显示额外的更新提示。 ([#9242](https://github.com/getpaseo/paseo/pull/9242), [#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116), [#9558](https://github.com/getpaseo/paseo/pull/9558),贡献者:[@adamcstephens](https://github.com/adamcstephens))
- **重建移动端聊天**:在 iOS 和 Android 上展开轮次摘要、待办卡片和工具组时,阅读位置保持不变。滚动期间发送消息会移到新提示词处。 ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085), [#9806](https://github.com/getpaseo/paseo/pull/9806), [#9693](https://github.com/getpaseo/paseo/pull/9693))
- **更快的 diff 加载**:“更改”在文件内容加载完成前先显示文件树。大型 diff 分批加载,且优先于后台 worktree 扫描。 ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243), [#9584](https://github.com/getpaseo/paseo/pull/9584))
- **更快的 Composer 菜单**:大型列表中的命令和文件建议更快打开,并随 Composer 尺寸变化保持贴合。 ([#9657](https://github.com/getpaseo/paseo/pull/9657), [#9647](https://github.com/getpaseo/paseo/pull/9647), [#9642](https://github.com/getpaseo/paseo/pull/9642))
- **移动端键盘快捷键**:连接键盘后,iPad 和 Android 可使用与桌面端相同的快捷键,包括自定义绑定。在 iPad Composer 中按 Shift+Tab 会切换模式,不再输入制表符。 ([#8625](https://github.com/getpaseo/paseo/pull/8625), [#9561](https://github.com/getpaseo/paseo/pull/9561),贡献者:[@jeroenfrenken](https://github.com/jeroenfrenken), [@lstroud](https://github.com/lstroud))
- **适合触控的平板控件**:触屏设备上的宽屏布局使用更大的按钮和行。空间不足时,Composer 会将控件收进模型菜单。 ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739),贡献者:[@zeyugao](https://github.com/zeyugao))
- **撤销工作区归档**:在六秒提示期间,点击“撤销”或按 Cmd/Ctrl+Z 可恢复已归档的工作区。Paseo 在移除 worktree 前会检查未保存的文件和未推送的提交。 ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104), [#9625](https://github.com/getpaseo/paseo/pull/9625), [#9753](https://github.com/getpaseo/paseo/pull/9753),贡献者:[@ragokan](https://github.com/ragokan))
### 新增
- 在“更改”中为 worktree 工作区新增基准分支选择器(Change base),diff、提交列表和 Git 操作可改用其他分支 ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934),贡献者:[@Myasuka](https://github.com/Myasuka))
- 新增 Issue 和 PR 引用链接:Agent 回复、计划、PR 面板和文件预览中的 `#123`、`owner/repo#123` 等引用会链接到 GitHub、GitLab、Gitea、Forgejo 或 Codeberg ([#8636](https://github.com/getpaseo/paseo/pull/8636))
- 新增 iPhone Duo 布局支持:工作区操作位于系统竖向栏中,侧边栏和工作区分列折痕两侧 ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901),贡献者:[@zeyugao](https://github.com/zeyugao))
- 为 worktree 的 diff、提交和 Git 操作新增基准分支选择器(Change base) ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934),贡献者:[@Myasuka](https://github.com/Myasuka))
- 新增可解析 SSH 别名和 fork 上游仓库的 Issue 和 PR 链接 ([#8636](https://github.com/getpaseo/paseo/pull/8636), [#9576](https://github.com/getpaseo/paseo/pull/9576))
- 新增 iPhone Duo 布局,侧边栏和工作区分列折痕两侧 ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901),贡献者:[@zeyugao](https://github.com/zeyugao))
- 新增 fx Provider,可在“设置 → Hosts → 提供方”的 Provider 目录中添加 ([#9160](https://github.com/getpaseo/paseo/pull/9160))
- 新增后台 Agent:Agent 或插件可通过 `background: true` 创建辅助 Agent,它不打开标签页、不发送通知,也不出现在侧边栏和默认 Agent 列表中 ([#8683](https://github.com/getpaseo/paseo/pull/8683))
- 新增后台 Agent,不占用标签页、不发送通知,也不出现在默认 Agent 列表中 ([#8683](https://github.com/getpaseo/paseo/pull/8683))
- 新增 Terraform 和 HCL 文件(`.tf`、`.tfvars`、`.hcl`)的语法高亮 ([#9106](https://github.com/getpaseo/paseo/pull/9106))
- 在每个 Agent 的环境中新增 `PASEO_WORKSPACE_ID`,Agent 可据此识别、重命名或归档自己的工作区 ([#8939](https://github.com/getpaseo/paseo/pull/8939),贡献者:[@DTTerastar](https://github.com/DTTerastar))
- 为侧边栏工作区行新增插件徽章 ([#7645](https://github.com/getpaseo/paseo/pull/7645),贡献者:[@jtomaszewski](https://github.com/jtomaszewski))
- 为无法预览的文件新增“下载”按钮 ([#9640](https://github.com/getpaseo/paseo/pull/9640))
- 在用量中新增 Copilot 高级请求用量和剩余额度 ([#8489](https://github.com/getpaseo/paseo/pull/8489),贡献者:[@thisisryanswift](https://github.com/thisisryanswift))
### 变更
- 打开工作区时恢复你离开时的标签页,不再跳转到需要关注的 Agent ([#8935](https://github.com/getpaseo/paseo/pull/8935))
- 问题卡片中选择选项后不再自动前进;请用“下一步”或“提交”继续 ([#8525](https://github.com/getpaseo/paseo/pull/8525))
- 斜杠命令菜单现在显示加载和错误状态并提供“重试”,且不再默认选中 `/exit` ([#8905](https://github.com/getpaseo/paseo/pull/8905))
- 文件浏览器(Explorer)或分屏使工作区变窄时,工作区页眉和标签页改用紧凑控件 ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088),贡献者:[@zeyugao](https://github.com/zeyugao))
- 问题卡片在选择选项后等待点击“下一步”或“提交” ([#8525](https://github.com/getpaseo/paseo/pull/8525))
- 斜杠命令菜单不再默认选中 `/exit` ([#8905](https://github.com/getpaseo/paseo/pull/8905))
- 调整工作区页眉控件以适应较窄的分屏窗格 ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088),贡献者:[@zeyugao](https://github.com/zeyugao))
- 向进程已退出的 Pi Agent 发送消息时立即失败,并提示重新加载该 Agent ([#8718](https://github.com/getpaseo/paseo/pull/8718))
- 在桌面端和宽屏网页布局中,侧边栏的“重命名 workspace”改为在原处编辑标题,不再打开对话框 ([#9280](https://github.com/getpaseo/paseo/pull/9280))
- “更新内容”和网站更新日志改为先显示每个版本的亮点,完整列表收在“显示全部变更”之后 ([#9281](https://github.com/getpaseo/paseo/pull/9281))
- “更新内容”先显示亮点,完整列表收在“显示全部变更”之后 ([#9281](https://github.com/getpaseo/paseo/pull/9281))
- Claude Bypass 现在批准来自 ask 规则和钩子的执行请求,提问和计划审核仍保留交互 ([#9760](https://github.com/getpaseo/paseo/pull/9760))
- Claude 权限卡片现在显示 Provider 提供的原因 ([#3950](https://github.com/getpaseo/paseo/pull/3950),贡献者:[@codebutler](https://github.com/codebutler))
- PR 窗格中的“活动”可调整大小或折叠,为检查结果留出更多空间 ([#9656](https://github.com/getpaseo/paseo/pull/9656))
- macOS 桌面端的标签页切换快捷键改为 Cmd+Shift+[ 和 Cmd+Shift+] ([#7692](https://github.com/getpaseo/paseo/pull/7692),贡献者:[@jtomaszewski](https://github.com/jtomaszewski))
- 在“新建工作区”按 Cmd/Ctrl+N 会打开项目选择器,同时保留草稿 ([#9741](https://github.com/getpaseo/paseo/pull/9741))
- 移动端设置导航现在恢复侧边栏之前的位置 ([#9641](https://github.com/getpaseo/paseo/pull/9641))
### 修复
- 修复较长的工具详情隐藏折叠标题或无法滚动查看输出的问题 ([#9770](https://github.com/getpaseo/paseo/pull/9770))
- 修复图片预览加载时短暂显示错误或拉伸图片的问题 ([#9698](https://github.com/getpaseo/paseo/pull/9698))
- 修复网页端和桌面端聊天在较早历史记录进入虚拟化后跳到开头的问题 ([#9664](https://github.com/getpaseo/paseo/pull/9664),贡献者:[@luoph](https://github.com/luoph))
- 修复滚动到顶部后仍需再次滚动鼠标滚轮才能加载更早聊天记录的问题 ([#9570](https://github.com/getpaseo/paseo/pull/9570))
- 修复跨越部分代码块复制选区时丢失缩进和换行的问题 ([#9515](https://github.com/getpaseo/paseo/pull/9515),贡献者:[@michaelmwu](https://github.com/michaelmwu))
- 修复 Mermaid XY 图表的轴标题重叠和标签被裁切的问题 ([#9483](https://github.com/getpaseo/paseo/pull/9483),贡献者:[@FluidXin](https://github.com/FluidXin))
- 修复 iOS 上点击命令后命令菜单仍保持打开的问题 ([#9755](https://github.com/getpaseo/paseo/pull/9755))
- 修复 Agent 启动失败后无法重试已编辑草稿的问题 ([#9534](https://github.com/getpaseo/paseo/pull/9534),贡献者:[@michaelmwu](https://github.com/michaelmwu))
- 修复 Android 平板上模型配置按钮不响应点按的问题 ([#9526](https://github.com/getpaseo/paseo/pull/9526),贡献者:[@moevis](https://github.com/moevis))
- 修复更改外观后设置页面丢失滚动位置和编辑内容的问题 ([#9605](https://github.com/getpaseo/paseo/pull/9605))
- 修复浅色插件主题中选中行难以阅读、Pure Black 中高亮几乎不可见的问题 ([#9579](https://github.com/getpaseo/paseo/pull/9579),贡献者:[@nathansgreen](https://github.com/nathansgreen))
- 修复网页端和桌面端页眉及工具栏图标按钮缺少键盘焦点框的问题 ([#9745](https://github.com/getpaseo/paseo/pull/9745),贡献者:[@junjzhang](https://github.com/junjzhang))
- 修复 iOS 和 Android 上拖动后侧边栏行短暂出现在错误位置的问题 ([#9681](https://github.com/getpaseo/paseo/pull/9681))
- 修复桌面端在 daemon 仍启动时报告启动失败的问题 ([#9043](https://github.com/getpaseo/paseo/pull/9043),贡献者:[@magiclaw](https://github.com/magiclaw))
- 修复网页端和桌面端终端恢复画面时丢失输入字符的问题 ([#9533](https://github.com/getpaseo/paseo/pull/9533))
- 修复 Android 终端中实体方向键失效并丢失下一个输入字符的问题 ([#9407](https://github.com/getpaseo/paseo/pull/9407),贡献者:[@moevis](https://github.com/moevis))
- 修复非 Git 工作区在命令中心缺少“归档工作区”的问题 ([#9777](https://github.com/getpaseo/paseo/pull/9777),贡献者:[@andheiberg](https://github.com/andheiberg))
- 修复后续配置读取超时后工作区脚本消失的问题 ([#9477](https://github.com/getpaseo/paseo/pull/9477),贡献者:[@dinhphieu](https://github.com/dinhphieu))
- 修复账号用量刷新失败后侧边栏用量隐藏该账号的问题 ([#9594](https://github.com/getpaseo/paseo/pull/9594))
- 修复 Provider 会话已不存在时,已关闭 Agent 仍保持未读的问题 ([#9737](https://github.com/getpaseo/paseo/pull/9737),贡献者:[@luoph](https://github.com/luoph))
- 修复 Agent 自主运行一轮后完成通知显示旧回复的问题 ([#9793](https://github.com/getpaseo/paseo/pull/9793))
- 修复中断消息因“already has an active run”而失败的问题 ([#9537](https://github.com/getpaseo/paseo/pull/9537),贡献者:[@michaelmwu](https://github.com/michaelmwu))
- 修复消息在交给 Provider 前失败后无法重试的问题 ([#9580](https://github.com/getpaseo/paseo/pull/9580),贡献者:[@tmad4000](https://github.com/tmad4000))
- 修复刚重新打开的 Agent 在下一次空闲清理时失去 Provider 进程的问题 ([#8857](https://github.com/getpaseo/paseo/pull/8857),贡献者:[@fdkevin0](https://github.com/fdkevin0))
- 修复空闲运行时清理导致 Claude 会话 cron 和 /loop 唤醒丢失的问题 ([#9744](https://github.com/getpaseo/paseo/pull/9744),贡献者:[@KronixDev](https://github.com/KronixDev))
- 修复工具在回复之前开始、之后结束时无法从该回复分叉的问题 ([#9627](https://github.com/getpaseo/paseo/pull/9627),贡献者:[@ragokan](https://github.com/ragokan))
- 修复大型 Codex 历史页面在单个条目仍符合大小限制时阻断历史加载的问题 ([#9432](https://github.com/getpaseo/paseo/pull/9432),贡献者:[@RockStone](https://github.com/RockStone))
- 修复 OpenCode 使用 Bun 时,daemon 重启后会话无法重新连接的问题 ([#9653](https://github.com/getpaseo/paseo/pull/9653),贡献者:[@quickwind](https://github.com/quickwind))
- 修复 OpenCode 升级到 v2 后刷新 Provider 仍保留 v1 的问题 ([#9593](https://github.com/getpaseo/paseo/pull/9593),贡献者:[@tkfka1](https://github.com/tkfka1))
- 修复 OpenCode v2 无法发现仅对其会话可用的插件工具的问题 ([#9426](https://github.com/getpaseo/paseo/pull/9426),贡献者:[@dptsolutions](https://github.com/dptsolutions))
- 修复 ACP Provider 按模型提供思考等级时,模型共用错误等级的问题 ([#9717](https://github.com/getpaseo/paseo/pull/9717),贡献者:[@AlfredRR](https://github.com/AlfredRR), [@doskoi](https://github.com/doskoi))
- 修复没有输出的失败 ACP 工具阻止对话历史加载的问题 ([#9467](https://github.com/getpaseo/paseo/pull/9467),贡献者:[@Myasuka](https://github.com/Myasuka))
- 修复带有 null 可选参数的 Pi 和 OMP 工具调用显示为未知工具的问题 ([#9506](https://github.com/getpaseo/paseo/pull/9506),贡献者:[@papag00se](https://github.com/papag00se))
- 修复导入 OMP 会话时保存文件路径而非会话 ID 的问题 ([#8854](https://github.com/getpaseo/paseo/pull/8854),贡献者:[@LiebeLee](https://github.com/LiebeLee))
- 修复跨主机子 Agent 与调用者使用相同 Provider 时丢失调用者模式的问题 ([#9512](https://github.com/getpaseo/paseo/pull/9512),贡献者:[@ortschun](https://github.com/ortschun))
- 修复插件子 Agent 在会话关闭时从失败或已取消变为已完成的问题 ([#8563](https://github.com/getpaseo/paseo/pull/8563),贡献者:[@hadan8977](https://github.com/hadan8977))
- 修复完整 Agent ID 不存在时,CLI 命令误操作标题与该 ID 相同的其他 Agent 的问题 ([#9680](https://github.com/getpaseo/paseo/pull/9680), [#9731](https://github.com/getpaseo/paseo/pull/9731),贡献者:[@ese111](https://github.com/ese111))
- 修复无法归档、分离或重新加载未出现在 CLI 列表中的 Agent 的问题 ([#9726](https://github.com/getpaseo/paseo/pull/9726),贡献者:[@xunWhale](https://github.com/xunWhale))
- 修复 `paseo agent wait` 在没有 Agent 匹配 ID 时仍成功退出的问题 ([#9782](https://github.com/getpaseo/paseo/pull/9782),贡献者:[@Eapp1e](https://github.com/Eapp1e))
- 修复语音输入和输出都使用 OpenAI 时无法启动语音模式的问题 ([#9779](https://github.com/getpaseo/paseo/pull/9779),贡献者:[@Huyvux12](https://github.com/Huyvux12))
- 修复听写流错误被 30 秒交付超时掩盖的问题 ([#9784](https://github.com/getpaseo/paseo/pull/9784),贡献者:[@tieo](https://github.com/tieo))
- 修复插件 Provider 在 All 模式下拒绝 Review 附件的问题 ([#9590](https://github.com/getpaseo/paseo/pull/9590),贡献者:[@ese111](https://github.com/ese111))
- 修复插件时间线写入接受应用无法显示的类型的问题 ([#7677](https://github.com/getpaseo/paseo/pull/7677),贡献者:[@ragokan](https://github.com/ragokan))
- 修复一轮结束时聊天位置移动的问题 ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175))
- 修复 Claude 和 OpenCode 工具行随参数到达而更改标题和图标的问题 ([#9248](https://github.com/getpaseo/paseo/pull/9248))
- 修复用量加载前上下文窗口浮层提前打开的问题 ([#9212](https://github.com/getpaseo/paseo/pull/9212))
- 修复多个侧边栏悬停卡片同时打开的问题 ([#9071](https://github.com/getpaseo/paseo/pull/9071))
- 修复 Agent 在你离开期间完成后,返回聊天时工作指示器消失的问题 ([#9170](https://github.com/getpaseo/paseo/pull/9170))
- 修复包含较短折叠轮次的聊天打开时留有空白、需滚动后才填满的问题 ([#8358](https://github.com/getpaseo/paseo/pull/8358), [#9083](https://github.com/getpaseo/paseo/pull/9083))
- 修复空闲的 Claude、Codex 或 OpenCode Agent 恢复后,“折叠轮次”把较早的回复藏进后一轮摘要行的问题 ([#9098](https://github.com/getpaseo/paseo/pull/9098))
- 修复提示词与其下方的回复或折叠轮次摘要行之间缺少间距的问题 ([#9009](https://github.com/getpaseo/paseo/pull/9009))
- 修复聊天打开时,较长的用户消息有一帧不显示渐隐效果和“展开”的问题 ([#9302](https://github.com/getpaseo/paseo/pull/9302))
- 修复紧跟在段落之后、中间没有空行的 Markdown 表格显示为原始竖线的问题 ([#8485](https://github.com/getpaseo/paseo/pull/8485),贡献者:[@ragokan](https://github.com/ragokan)、[@suk-6](https://github.com/suk-6)、[@thsrite](https://github.com/thsrite))
- 修复网页版和桌面端中与文字同行的带链接徽章图片被渲染成整行宽度的问题 ([#8530](https://github.com/getpaseo/paseo/pull/8530))
- 修复“查看源码”后点击“查看图表”会打开全屏、而不是回到内联 Mermaid 图表的问题 ([#8932](https://github.com/getpaseo/paseo/pull/8932),贡献者:[@luoph](https://github.com/luoph))
@@ -47,21 +119,16 @@
- 修复关闭 Agent 标签页时未发送的 Composer 文本和附件被删除的问题 ([#9079](https://github.com/getpaseo/paseo/pull/9079))
- 修复向 Composer 粘贴带超链接的文本时丢失链接地址的问题;链接现在以 Markdown 形式粘贴 ([#8972](https://github.com/getpaseo/paseo/pull/8972))
- 修复用鼠标点击“发送”后 Composer 失去焦点的问题 ([#9015](https://github.com/getpaseo/paseo/pull/9015))
- 修复 iPhone 上 Composer 停在距底部边缘 50pt 处的问题 ([#8823](https://github.com/getpaseo/paseo/pull/8823),贡献者:[@zeyugao](https://github.com/zeyugao))
- 修复从侧边栏和“新建工作区”点击“添加主机”会跳转到“设置”的问题 ([#8512](https://github.com/getpaseo/paseo/pull/8512))
- 修复打开失败的 Agent 或选择 Mark as read 后,其红点和“失败”分组仍留在侧边栏的问题 ([#8831](https://github.com/getpaseo/paseo/pull/8831))
- 修复在 Agent 运行时已关闭的情况下清除未读后,工作区的未读指示仍然亮着的问题 ([#9087](https://github.com/getpaseo/paseo/pull/9087))
- 修复取消归档工作区时未恢复随之归档的 Agent 的问题 ([#9210](https://github.com/getpaseo/paseo/pull/9210))
- 修复流式回复期间聊天一滚动上下文窗口浮层就自行关闭的问题 ([#8742](https://github.com/getpaseo/paseo/pull/8742),贡献者:[@3ae3ae](https://github.com/3ae3ae))
- 修复侧边栏用量摘要只在打开“使用情况”时才更新的问题 ([#7806](https://github.com/getpaseo/paseo/pull/7806),贡献者:[@ragokan](https://github.com/ragokan))
- 修复 Android 上位于触发元素上方的提示和菜单在打开后内容变多时短暂盖住触发元素的问题 ([#9247](https://github.com/getpaseo/paseo/pull/9247))
- 修复在“历史”页面刷新网页版后显示“无法加载历史”的问题 ([#9029](https://github.com/getpaseo/paseo/pull/9029))
- 修复 HTML 文件预览中的章节链接把预览替换成 Paseo 应用、而不是在文件内滚动的问题 ([#8559](https://github.com/getpaseo/paseo/pull/8559),贡献者:[@3ae3ae](https://github.com/3ae3ae))
- 修复“文件”刷新期间文件夹处于折叠状态时,新建的文件一直不显示的问题 ([#8582](https://github.com/getpaseo/paseo/pull/8582),贡献者:[@hadan8977](https://github.com/hadan8977))
- 修复分支仍在加载或请求失败时,分支切换器显示“没有找到分支。”的问题 ([#8938](https://github.com/getpaseo/paseo/pull/8938))
- 修复文件被移到上一级目录时,提交历史显示双斜杠、没有重命名状态也没有 diff 的问题 ([#8509](https://github.com/getpaseo/paseo/pull/8509),贡献者:[@hadan8977](https://github.com/hadan8977))
- 修复检出落后于 PR 头部时,已合并的 PR 从其工作区中消失的问题
- 修复工作区 Git 监视器在设置超时后一直停留在回退轮询的问题
- 修复网页版或桌面端重连后,被放弃的连接最多保持打开 45 秒的问题 ([#9067](https://github.com/getpaseo/paseo/pull/9067))
- 修复通过另一台主机路由的连接在获取超大时间线时以“The receiving client cannot keep up with host output”关闭的问题 ([#9109](https://github.com/getpaseo/paseo/pull/9109))
- 修复已连接的主机在更新到受支持的版本后仍停留在错误状态的问题 ([#8423](https://github.com/getpaseo/paseo/pull/8423),贡献者:[@DAnaeto](https://github.com/DAnaeto))
@@ -123,16 +190,21 @@
- 修复 daemon 因无效消息终止插件后,该插件仍留在列表中且未报告退出的问题 ([#9285](https://github.com/getpaseo/paseo/pull/9285),贡献者:[@Brandon168](https://github.com/Brandon168))
- 修复 ACP Provider 插件丢弃 Agent 在提示词响应中报告的 token 用量的问题 ([#9396](https://github.com/getpaseo/paseo/pull/9396),贡献者:[@Myasuka](https://github.com/Myasuka))
- 修复已发布的 `@getpaseo/*` npm 包未声明许可证的问题;现在声明为 Apache-2.0 ([#7816](https://github.com/getpaseo/paseo/pull/7816),贡献者:[@mdlawson](https://github.com/mdlawson)、[@ragokan](https://github.com/ragokan))
- 修复插件更新了自己的某张时间线卡片后,从较早的回复分叉因“This checkpoint changed after it was created”失败的问题 ([#8746](https://github.com/getpaseo/paseo/pull/8746),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
- 修复由插件渲染最终回复时,“折叠轮次”让轮次保持展开或折叠到较早回复的问题 ([#8811](https://github.com/getpaseo/paseo/pull/8811),贡献者:[@geoqiao](https://github.com/geoqiao))
- 修复应用刷新后插件目录仍在加载时,插件页面显示“This plugin surface is unavailable”的问题 ([#8123](https://github.com/getpaseo/paseo/pull/8123),贡献者:[@vs-tahir](https://github.com/vs-tahir))
- 修复插件添加了许多导航项时,矮屏上的工作区列表被挤出移动端侧边栏的问题 ([#8727](https://github.com/getpaseo/paseo/pull/8727),贡献者:[@jaredwang](https://github.com/jaredwang))
- 修复时间线插件在 Agent 消息工具调用上收不到发送方、事件和原始文本的问题 ([#8492](https://github.com/getpaseo/paseo/pull/8492),贡献者:[@RRD-dev](https://github.com/RRD-dev)、[@luoph](https://github.com/luoph))
- 修复输入或输出 schema 使用 transform 时插件 RPC 失败的问题 ([#8550](https://github.com/getpaseo/paseo/pull/8550))
### 破坏性变更
- 移除已弃用且始终返回空列表的 `agent.turn.after.timeline` SDK 字段 ([#9573](https://github.com/getpaseo/paseo/pull/9573),贡献者:[@jtomaszewski](https://github.com/jtomaszewski))
### 说明
- 后台任务、基准分支选择器、归档撤销、后台 Agent、插件订阅和 fx 需要主机和应用都更新到此版本
- 使用插件库、后台任务、Change base、归档撤销、后台 Agent、插件订阅和 fx 时,请同时更新主机和应用
- 读取 `agent.turn.after.timeline` 的插件作者必须改用 `timeline.refetch({ direction: "tail", limit: 1, wholeTurns: true })`,并按 `event.turnId` 筛选条目
- 归档撤销会恢复工作区,但不会恢复随 worktree 一起移除的未提交文件
## 0.15.4 - 2026-11-10
+3 -2
View File
@@ -150,12 +150,13 @@ Users can also detach an existing subagent from the subagents track. Detach is d
`notifyOnFinish` defaults to `true` for agent-scoped creation and prompt follow-ups because most delegated work needs to report back to the creating agent. Set it to `false` for explicit reporting or no completion callback.
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch, allowing a child to report and finish in the same two-second quiet window. Human prompts dispatch directly. Conflicting explicit interruption or session-mode choices retain separate ordered dispatches.
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch. Idle recipients retain the two-second quiet window. While a recipient has a running or starting turn (including compaction), messages stay queued across quiet windows and are delivered together after that turn settles, including failure or cancellation. A ready batch is released when the daemon observes the recipient settle; the two-second timer also retries it. Agent callers using `steer`, including the default, wait for the turn to end; only explicit `interrupt` replaces a running turn. An explicit interrupt or a command the provider accepts out of band runs before earlier queued messages. Those messages stay queued and are delivered after the running or replacement turn ends. Human prompts dispatch directly with their existing behavior. Conflicting session-mode choices retain separate ordered dispatches.
The pending message window is in memory. Clean shutdown flushes it before closing agents; an abrupt
crash can lose queued prompts. A durable send receipt remains pending until actual dispatch
acknowledgment, so a lost window never becomes a completed receipt. Completion waits cover queued
admission within their original timeout and cancellation scope.
admission within their original timeout and cancellation scope, and return permission checkpoints
while messages are waiting.
Finish notification intent has a separate daemon-owned lifetime. The finish-subscriptions module
persists caller, child, host, and ownership policy through an injectable store; its JSON adapter uses
+4 -2
View File
@@ -156,8 +156,10 @@ keeps following.
Following resumes only for a gesture that ends within 1 px of the end, either when the finger lifts
or when momentum stops. A release past the end counts: iOS bounces back to the end, and lines that
land during the bounce must keep scrolling in. A release anywhere short of the end stays detached
with the scroll-to-bottom pill, so the rows the user let go of never move.
land during the bounce must keep scrolling in. A release short of the end stays detached with the scroll-to-bottom pill unless you submitted
another prompt during that gesture. That submit requests the end after the gesture finishes;
a new drag after submitting takes ownership again. Rewind and tail-fetch completions do not
override a scroll away because they can arrive after the action that requested them.
### Draw distance
+10
View File
@@ -590,6 +590,16 @@ bookkeeping may scan opaque row sizes during a deferred write, never during host
before a requested cache row can paint. The row store is not encrypted. A cached timeline can contain
source code, prompts, and tool output; encrypted-at-rest storage is a separate security decision.
### Saved hosts
**AsyncStorage key:** `@paseo:daemon-registry`, an array of host profiles.
Every app build on a device shares this key, including an older build after a downgrade and a newer
one that saves a connection kind this build doesn't know. The key holds every saved host and its
password, so never remove it. Read each host and connection on its own, skip the ones this build
can't read, and write them back on every save. A value that isn't a JSON array is copied to
`@paseo:daemon-registry:unreadable` before the next save overwrites it.
### Draft Store
**AsyncStorage key:** `paseo-drafts` (version 2)
+1 -1
View File
@@ -76,7 +76,7 @@ Dense toolbar rows, such as the composer's, are the exception to the 44pt contro
In the composer, the first glyph's ink starts on the text column's edge, and the trailing control is always a disc, so the row does not shift as it changes between voice mode, send and stop. The disc nests into the corner, as far from the right edge as from the bottom, and touch-sized the composer's corner radius is concentric with it (`packages/app/src/composer/input/toolbar-rails.ts`). Touch-sized the disc keeps a 6pt clearance from its neighbour, because it is always painted and a pressed neighbour would merge with it. The attach button sits 2pt closer to the picker than its highlight would put it: the plus is all thin arms, so the full gap reads wide. That offset is set by eye.
One gate, `resolveControlSizing`, picks touch or pointer sizing: touch when the layout is compact or the device has a touch screen. An iPad with the sidebar docked is wide and touch-sized; a desktop is pointer-sized; a phone is both compact and touch. The touch-screen fact is read once at startup (`hasTouchScreen` in `hooks/use-fine-pointer.ts`), so attaching a mouse or keyboard to a tablet never shrinks its controls. Stylesheets take sizes from `bySizing({ touch, pointer })`, which resolves to a breakpoint value, so a caller never sees which sizing it got. Rows, icon buttons and icon slots take theirs from `styles/density.ts`, which uses the same gate. An `{ xs, md }` literal for a hit target or glyph is wrong: on an iPad it yields the pointer size.
One gate, `resolveControlSizing`, picks touch or pointer sizing: touch when the layout is compact or touch is the primary input. An iPad with the sidebar docked is wide and touch-sized; a desktop is pointer-sized; a phone is both compact and touch. The primary input comes from `(pointer: coarse)` (`hasTouchPrimaryPointer` in `hooks/pointer-capabilities.ts`), not from whether a touch screen exists: WebKit keeps touch primary on an iPad with a trackpad attached, and Chromium reports a fine primary pointer for a laptop with a touch screen that its trackpad drives. The fact is read once at startup: attaching a pointer to a tablet does not shrink its controls, and a 2-in-1 launched with a pointer keeps pointer sizes after it switches to tablet mode until the app reloads. Stylesheets take sizes from `bySizing({ touch, pointer })`, which resolves to a breakpoint value, so a caller never sees which sizing it got. Rows, icon buttons and icon slots take theirs from `styles/density.ts`, which uses the same gate. An `{ xs, md }` literal for a hit target or glyph is wrong: on an iPad it yields the pointer size.
Buttons are pills (`borderRadius.full`) with medium-weight labels; an icon-only button is a circle. `<Switch>` follows the same two sizes: a 34×20 track by default and in `sm`, 44×26 where controls are touch-sized, and it reserves its size's control height so a row holding one lines up with a row holding a button. Buttons, text fields, dropdown triggers, and `<SegmentedControl>` (`packages/app/src/components/ui/segmented-control.tsx`) share the size contract — the same size name means the same height and label size on every control kind, so controls in one row line up. Segments run tighter than a button, because the gap between segments already reads as padding. The selected segment is a `surface3` fill with `foreground` text, not an inverted one — inverting it inside thin chrome puts a white slab in the toolbar. A settings row sizes the controls in its trailing slot itself, default in a card and `sm` when nested (`packages/app/src/components/ui/control-size.tsx`), so don't pass a size to a button, dropdown or field placed in a row. Code that computes with a control's height outside a stylesheet uses `controlHeightForLayout`. Never shrink a control's font or padding locally to fit a context — if the context needs a smaller control, the size tier is missing or the wrong one is in use.
+1 -1
View File
@@ -6,7 +6,7 @@ Do not replace the Linux implementation with `fs.watch({ recursive: true })`. No
Closing an observation must remain safe after its root is renamed or removed. Workspace archive removes owned worktrees while releasing observation references, so teardown cannot assume the watched path still exists.
`unsubscribe()` is an awaited barrier. Once it resolves, no scan, reconciliation, queued event, native handle, or callback may remain. `updateIgnore()` is the equivalent barrier for excluded paths: events queued below a newly excluded root cannot be delivered after it resolves. Treat path disappearance while scanning, attaching, or receiving a watcher error as rename/archive churn. Surface permission and resource errors so WorkspaceGit can enter bounded polling.
`unsubscribe()` is an awaited barrier. Once it resolves, no scan, reconciliation, queued event, native handle, or callback may remain. `updateIgnore()` is the equivalent barrier for excluded paths: events queued below a newly excluded root cannot be delivered after it resolves. Treat path disappearance while scanning, attaching, or receiving a watcher error as rename/archive churn. Surface permission and resource errors so WorkspaceGit can enter bounded polling. `subscribe()` accepts an abort signal; aborting it before it resolves stops the startup scan and rejects. WorkspaceGit aborts every subscription that misses its setup deadline, because an abandoned scan otherwise keeps walking the tree. A timed-out directory retries on the recovery ladder (30 seconds doubling to five minutes), and each consecutive timeout keeps doubling the delay up to one hour. Under sustained CPU load the next scan misses the deadline too, and each attempt repeats the full scan. An accepted subscription resets the timeout streak. Degraded polling keeps its own cadence throughout.
Linux topology repair is trailing-debounced and scoped to the renamed path. A file rename needs one classification stat; a new or moved directory scans only its subtree. Full-tree scans are reserved for startup and ignore-set replacement. A subscription reports changes after `subscribe()` resolves, not the files that already existed. macOS FSEvents can still replay writes made moments before the stream started. Consumers read their initial state after `subscribe()` resolves; WorkspaceGit re-reads its checkout once observation setup completes, because its first refresh runs in parallel with setup. The Linux startup scan therefore emits nothing; only a scoped reconciliation of new topology reports files found before their directory's watcher was installed. Startup creates made every cold diff compute and discard a first revision. Benchmark startup cost with pre-populated trees.
+2
View File
@@ -12,6 +12,8 @@ Every block is separated by one gap, `density.blockGap`: 12 on compact layouts,
Workspace file links use the shared file-link resolver. The workspace supplies its client, root and open-file action once; chat can supply the agent's more specific context. URLs use the same link press path. Recognized inline-code paths stay tappable. The library callback carries the tapped occurrence’s syntax context. Preserve it when opening files: explicit Markdown links decode URL escapes, while recognized inline-code paths preserve literal percent characters and use suffix lookup. Identical URL strings in different occurrences must stay distinct. Explicit absolute workspace links receive a relative hover title; existing authored titles remain intact. Inside a workspace, forge references such as `#12` and `owner/repo#12` are recognized in prose (not code) and open the workspace forge; the reference pattern comes before path recognition so `group/project#12` is not read as a path. See [forge providers](forge-providers.md#gotchas).
Pass `external` for author-controlled Markdown from outside the host, such as a plugin README. It follows the registry's overview contract in `packages/protocol/src/plugin-overview.ts`, which the website also uses: only absolute https links and images work, and any other destination renders as its label or alt text. The parser still autolinks bare `http://`, `www.` and email text, so a link press checks the URL again and opens only https. None of the workspace recognition above applies, so `Node.js` is prose, not a file. The lines of a paragraph join, as they do on the README's forge.
Resolve workspace image paths over the existing session RPC, then give the library a cached native file URL or web blob URL. HTTP(S) images pass through unchanged. This preserves relay, SSH and local socket connections, which do not expose a daemon HTTP endpoint. Each mounted renderer owns its image acquisition identity, so a later reply reads a rewritten path again while the earlier mounted reply retains its snapshot. Image taps open the attachment lightbox. File previews resolve relative images against the Markdown file's directory. An image alone on its line becomes its own paragraph before the library sees it, so it renders as a block on every platform; the library only treats sole-child paragraph images as blocks, and with hard soft breaks every newline is a break node, which left own-line images inline on iOS and web. Images that share a line with text stay inline at line height and keep their aspect ratio. A linked image counts as an image, so review-bot badges such as `[![Retrigger](badge.svg)](url) Confidence` stay inline on web; the library's web renderer only checked direct paragraph children, so it rendered them as full-width block images (local patch in `patches/react-native-enriched-markdown+*.patch`).
## Engine constraints
+4 -3
View File
@@ -873,9 +873,10 @@ await paseo.agents.ref(agentId).timeline.append({
The daemon stamps the runtime `pluginId`; plugin code never supplies it. Reusing the same `id`
replaces the previous row from that plugin on live clients and fresh timeline fetches. Rows live in
the daemon's in-memory timeline and survive scroll, refetch, and reconnect, but not a daemon
restart. A row without an installed renderer shows an unavailable placeholder. Serialized `data`
must be at most 64 KiB; the daemon rejects a larger append instead of storing a payload that cannot
be rendered intact. The daemon advertises this RPC through
restart. A row without an installed renderer shows an unavailable placeholder. `kind` must match
`/^[a-z][a-z0-9-]*$/`, the rule `addTimelineRenderer` enforces; the daemon rejects any other kind.
Serialized `data` must be at most 64 KiB; the daemon rejects a larger append instead of storing a
payload that cannot be rendered intact. The daemon advertises this RPC through
`server_info.features.pluginTimelineItems`.
## Contribute client slash commands
+1
View File
@@ -29,6 +29,7 @@ The worker writes `$PASEO_HOME/terminal-worker/<pid>.json` (owner-only) with its
- Workers never query their own birth time or command line. Readers accept legacy identity fields but ignore them. Daemons through 0.15.1 report new records unreadable and cannot adopt them.
- Windows terminal programs have no recorded birth time and terminal lifecycle operations never launch PowerShell. Linux and macOS retain program birth-time checks through `ps` with `LC_ALL=C`; Linux also walks sessions to find surviving jobs.
- Unix socket paths have a byte budget (103 on macOS, 107 on Linux). Long dev homes use an owner-only fallback under `$TMPDIR/paseo-<uid>/` or `/tmp/paseo-<uid>/`. An existing directory must be a real `0700` directory owned by you; a shared root is never chmodded.
- A home on a filesystem that refuses Unix sockets (AFS, some network mounts) passes those checks and then fails the bind with `EPERM`, `EACCES`, `EOPNOTSUPP` or `ENOTSUP`. The worker moves on to the next directory on those codes only; any other listen error fails the start. The record carries the path the worker bound, so nothing else recomputes it.
- A kill cleanup that cannot confirm every process gone writes `closing-<recordId>.json` beside the worker record. The worker rewrites its own record whenever a terminal starts or exits, so the kill intent has to live in a file it never writes. A closing record is never adopted; the next stop or start retries it.
- An unreadable record of either kind makes `daemon status` and a kill restart fail with its path: a kill cleanup that met it could not check what it names, and leaves nothing else behind. A read that fails with `EPERM`, `EBUSY` or `EACCES` is retried for 250ms first: on Windows, opening a record while the worker renames its new copy over it fails that way for a moment.
@@ -0,0 +1,5 @@
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,5 @@
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,5 @@
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,5 @@
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,6 @@
Fixed
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,6 @@
Fixed
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,6 @@
Fixed
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
Full notes: https://paseo.sh/changelog
@@ -0,0 +1,6 @@
Fixed
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
Full notes: https://paseo.sh/changelog
+1 -1
View File
@@ -1 +1 @@
sha256-e6BNeOJvy1uyDe/XW9hdr7NBgJ+t9tlNum5oLNefREI=
sha256-k7+5S/4tyAmHdZmUdhpuZ7GOc7hp9cG8wUBFdJI32ng=
+65 -65
View File
@@ -1,12 +1,12 @@
{
"name": "paseo",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"hasInstallScript": true,
"license": "Apache-2.0",
"workspaces": [
@@ -130,22 +130,22 @@
}
},
"node_modules/@anthropic-ai/claude-agent-sdk": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.246.tgz",
"integrity": "sha512-FtR0HoHHNqeqJWjZN8qLUAzZVFUI9ztXYNPPwv98Ecmv9qq2QTauI8IzkY26CC0mleWAqb9RQEW2C0OtiUliug==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.326.tgz",
"integrity": "sha512-BUTSky/4YWfL/MxC+4kV0NDbJFjbJPoQMFEk/s9G6hV9LUfYPMbsWz94bFQ7ZIo2ubj2xwJ2c2NVxkNlQhVw+Q==",
"license": "SEE LICENSE IN README.md",
"engines": {
"node": ">=18.0.0"
"node": ">=18.14.0"
},
"optionalDependencies": {
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.246",
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.246",
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.246",
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.246",
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.246",
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.246",
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.246",
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.246"
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.326",
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.326"
},
"peerDependencies": {
"@anthropic-ai/sdk": ">=0.93.0",
@@ -154,9 +154,9 @@
}
},
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.246.tgz",
"integrity": "sha512-pYDv2RT+UVOvEapMEWKf7Gm5a87Si1Zf+XR23IMGYbG5mESatNJ8Gz2PmkrwfTezZknb0ljWZe8zgcTFITM3dA==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.326.tgz",
"integrity": "sha512-D3ZbowCMdKNet0YPZlsJxdJUW1t1Q8KLy1BwNd+5eilf18TlCRtWZlm8DrewFLmu/gxBK7gcsq6uysrIVbPyQg==",
"cpu": [
"arm64"
],
@@ -167,9 +167,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.246.tgz",
"integrity": "sha512-yl+gMMFUQ8++SBaxUe2JxBqU0LOJO4HZTsWWTOrH5kRlTRhdQDF/lESsoNXCHgfF/+77YNKgef0h+rl/D12Jfg==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.326.tgz",
"integrity": "sha512-m8K3Im2S8STdAVBrriuDZyJcnjsu/Vc3476wIOqTAefnCCdtdZ4AHcOcWxt+4KIHE5Vx1qT2qacTRrQBaVVweA==",
"cpu": [
"x64"
],
@@ -180,9 +180,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.246.tgz",
"integrity": "sha512-t7AEewD7bcjZYMmrfFLjsUSxPo4z+5J5O5cC9V2zOvAhNkefdMeGWI2/1cdqZxuaOiFVt46byjlZuiNNunF+bQ==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.326.tgz",
"integrity": "sha512-nYVN8jCcH490DCXIvby7rllzQFxLzKeKClfo2u/yv7mx3ipZQv344caULL/amwZ8w8GUzYyZ8hnS6pI9goSq+A==",
"cpu": [
"arm64"
],
@@ -193,9 +193,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.246.tgz",
"integrity": "sha512-AeiDXveuA9dVRDouSRiQzL40P3dOuJPfZOlwwsFNbVUN0D+06WtwgmeWYnyRG4dxsM67Pf4lYcRZ0x9pfEZUwQ==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.326.tgz",
"integrity": "sha512-baSsuP2/wuWujRpHjKT4WkJB5lhttqKq9jcTfY2KRtQpylbk8E5PWcct/pmwJfNCKIUoE8CD+JpmoWzsdd5Ajw==",
"cpu": [
"arm64"
],
@@ -206,9 +206,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.246.tgz",
"integrity": "sha512-BIbBlJ6x7Cys6UFvahUfce26H+U+Q4tLWjKRD39AaV7JvRav8/vfdFytzWq6E+h9hT1OOWYuPYx2gMn5vDhZhQ==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.326.tgz",
"integrity": "sha512-WMhDY07gk2O0E8FXTbrVYmPjSLFaYPDCPwsNueVxm6vZ7ek+lPaKuOMAxTb1K07TzSmTOexoWeX2Y9VrbVDMpw==",
"cpu": [
"x64"
],
@@ -219,9 +219,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.246.tgz",
"integrity": "sha512-+3PrWX3qXgakO3tZImr7keKFry5XIkbHBEaUxgi3/RtPmxGwS+JdVAr0xxzOoC2F6Y66Kn0lUnztRnZHORBc+Q==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.326.tgz",
"integrity": "sha512-kK9VO3uFqNd4wgeU0Cefluam5AdPu6mvF1nn6aboGy8TA5NoxlWTmA4/AwMhK39zK1S9Q2OjeX0JtAahYlIchw==",
"cpu": [
"x64"
],
@@ -232,9 +232,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.246.tgz",
"integrity": "sha512-JV8b28OJ8d+EMVEVIWlN3aEkT8uSehO3ZN/PJzXFG7Jgn56oVYUew4aY9vK4jao/4E4mdfzvs358w4HcTBUzVw==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.326.tgz",
"integrity": "sha512-S+Ai+HhGRVFfTDmYWRfTrdWF3b4KMsfLSThZCqRJ0WCOKOXrRShMKV1hqqHBljx/wkMDPCpY0V/9S/e6w57eGQ==",
"cpu": [
"arm64"
],
@@ -245,9 +245,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
"version": "0.3.246",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.246.tgz",
"integrity": "sha512-omI65bYGynLpE1Ybijk56K1wBnt0H6WujNwlg1LzIdeHrYmpUxoqncK92xKH5kb9XWUz3byHqArbv7wsT+M/2A==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.326.tgz",
"integrity": "sha512-Yn1gZXYFuHmjHz7SpHx4TqDcRDsC8TfwWcntJdYjFzMWm+caPAp6QRqr/aTvirjqVA1D+D8Rd29xhuytpE3xTQ==",
"cpu": [
"x64"
],
@@ -37468,7 +37468,7 @@
},
"packages/app": {
"name": "@getpaseo/app",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"dependencies": {
"@codemirror/commands": "6.10.4",
"@codemirror/language": "6.12.4",
@@ -39637,13 +39637,13 @@
},
"packages/cli": {
"name": "@getpaseo/cli",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.16.0-beta.2",
"@getpaseo/protocol": "0.16.0-beta.2",
"@getpaseo/server": "0.16.0-beta.2",
"@getpaseo/client": "0.16.1",
"@getpaseo/protocol": "0.16.1",
"@getpaseo/server": "0.16.1",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
@@ -39890,11 +39890,11 @@
},
"packages/client": {
"name": "@getpaseo/client",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/protocol": "0.16.0-beta.2",
"@getpaseo/relay": "0.16.0-beta.2",
"@getpaseo/protocol": "0.16.1",
"@getpaseo/relay": "0.16.1",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
@@ -39906,7 +39906,7 @@
},
"packages/desktop": {
"name": "@getpaseo/desktop",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/cli": "*",
@@ -40149,7 +40149,7 @@
},
"packages/expo-two-way-audio": {
"name": "@getpaseo/expo-two-way-audio",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.14",
@@ -40195,7 +40195,7 @@
},
"packages/highlight": {
"name": "@getpaseo/highlight",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@codemirror/language": "6.12.4",
@@ -40225,7 +40225,7 @@
},
"packages/plugin": {
"name": "@getpaseo/plugin",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^1.4.0",
@@ -40233,8 +40233,8 @@
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.16.0-beta.2",
"@getpaseo/protocol": "0.16.0-beta.2",
"@getpaseo/client": "0.16.1",
"@getpaseo/protocol": "0.16.1",
"@types/node": "^20.9.0",
"@types/react": "~19.2.0",
"react": "19.2.3",
@@ -40244,8 +40244,8 @@
"zod": "^4.4.3"
},
"peerDependencies": {
"@getpaseo/client": "0.16.0-beta.2",
"@getpaseo/protocol": "0.16.0-beta.2",
"@getpaseo/client": "0.16.1",
"@getpaseo/protocol": "0.16.1",
"react": ">=19.1.0 <20",
"react-native": ">=0.81.5",
"zod": "^4.4.3"
@@ -40267,7 +40267,7 @@
},
"packages/protocol": {
"name": "@getpaseo/protocol",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"semver": "^7.8.5",
@@ -40295,7 +40295,7 @@
},
"packages/relay": {
"name": "@getpaseo/relay",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@noble/ciphers": "^2.4.0",
@@ -40517,17 +40517,17 @@
},
"packages/server": {
"name": "@getpaseo/server",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^0.17.1",
"@anthropic-ai/claude-agent-sdk": "0.3.246",
"@anthropic-ai/claude-agent-sdk": "0.3.326",
"@anthropic-ai/sdk": "^0.104.2",
"@getpaseo/client": "0.16.0-beta.2",
"@getpaseo/highlight": "0.16.0-beta.2",
"@getpaseo/plugin": "0.16.0-beta.2",
"@getpaseo/protocol": "0.16.0-beta.2",
"@getpaseo/relay": "0.16.0-beta.2",
"@getpaseo/client": "0.16.1",
"@getpaseo/highlight": "0.16.1",
"@getpaseo/plugin": "0.16.1",
"@getpaseo/protocol": "0.16.1",
"@getpaseo/relay": "0.16.1",
"@isaacs/ttlcache": "^2.1.4",
"@modelcontextprotocol/sdk": "1.29.0",
"@opencode-ai/sdk": "1.14.46",
@@ -41474,7 +41474,7 @@
},
"packages/website": {
"name": "@getpaseo/website",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"dependencies": {
"@cloudflare/vite-plugin": "^1.29.1",
"@cloudflare/workers-types": "^4.20260317.1",
@@ -43084,7 +43084,7 @@
},
"plugins": {
"name": "@getpaseo/builtin-plugins",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -0,0 +1,105 @@
import { existsSync } from "node:fs";
import { expect, test } from "../support/fixtures";
import { gotoAppShell } from "../support/helpers/app";
import { openCommandCenter } from "../support/helpers/command-center";
import { openWorkspaceFromCommandCenter } from "../support/helpers/command-center-workspace-actions";
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
import { projectEquivalenceViewKey } from "../support/helpers/project-view-key";
import { getServerId } from "../support/helpers/server-id";
import { expectWorkspaceAbsentFromSidebar } from "../support/helpers/sidebar";
async function isWorkspaceListed(seeded: SeededWorkspace): Promise<boolean> {
const result = await seeded.client.fetchWorkspaces();
return result.entries.some((entry) => entry.id === seeded.workspaceId);
}
async function expectWorkspaceArchivedOnDaemon(seeded: SeededWorkspace): Promise<void> {
await expect.poll(() => isWorkspaceListed(seeded), { timeout: 30_000 }).toBe(false);
}
test.describe("Command center archive for a non-Git workspace", () => {
test("archives a plain directory workspace from the command center", async ({ page }) => {
const title = "Command Center Directory Archive";
const seeded = await seedWorkspace({ repoPrefix: "cc-archive-dir-", title, git: false });
try {
await gotoAppShell(page);
await openWorkspaceFromCommandCenter(page, seeded, title);
const panel = await openCommandCenter(page);
await panel.getByTestId("command-center-input").fill("archive");
const archive = panel.getByRole("button", { name: /^Archive(?: workspace)?(?:\s|$)/ });
await expect(archive).toBeVisible({ timeout: 30_000 });
await archive.click();
await expectWorkspaceAbsentFromSidebar(page, seeded.workspaceId);
expect(existsSync(seeded.repoPath)).toBe(true);
} finally {
await seeded.cleanup();
}
});
test("archives a plain directory workspace from the command center with the sidebar closed", async ({
page,
}) => {
const title = "Command Center Directory Archive Closed Sidebar";
const seeded = await seedWorkspace({ repoPrefix: "cc-archive-dir-closed-", title, git: false });
try {
await gotoAppShell(page);
await openWorkspaceFromCommandCenter(page, seeded, title);
await page.getByTestId("menu-button").click();
await expect(page.getByTestId("sidebar-search")).toBeHidden({ timeout: 10_000 });
const modifier = process.platform === "darwin" ? "Meta" : "Control";
await page.keyboard.press(`${modifier}+k`);
const panel = page.getByTestId("command-center-panel");
await expect(panel).toBeVisible({ timeout: 30_000 });
await panel.getByTestId("command-center-input").fill("archive");
const archive = panel.getByRole("button", { name: /^Archive(?: workspace)?(?:\s|$)/ });
await expect(archive).toBeVisible({ timeout: 30_000 });
await archive.click();
await expectWorkspaceArchivedOnDaemon(seeded);
} finally {
await seeded.cleanup();
}
});
test("archives a plain directory workspace from the command center with its project collapsed", async ({
page,
}) => {
const title = "Command Center Directory Archive Collapsed Project";
const seeded = await seedWorkspace({
repoPrefix: "cc-archive-dir-collapsed-",
title,
git: false,
});
try {
await gotoAppShell(page);
await openWorkspaceFromCommandCenter(page, seeded, title);
const workspaceRow = page.getByTestId(
`sidebar-workspace-row-${getServerId()}:${seeded.workspaceId}`,
);
await expect(workspaceRow).toBeVisible({ timeout: 30_000 });
await page
.getByTestId(`sidebar-project-row-${projectEquivalenceViewKey(seeded.projectKey)}`)
.first()
.click();
await expect(workspaceRow).toHaveCount(0, { timeout: 10_000 });
const panel = await openCommandCenter(page);
await panel.getByTestId("command-center-input").fill("archive");
const archive = panel.getByRole("button", { name: /^Archive(?: workspace)?(?:\s|$)/ });
await expect(archive).toBeVisible({ timeout: 30_000 });
await archive.click();
await expectWorkspaceArchivedOnDaemon(seeded);
} finally {
await seeded.cleanup();
}
});
});
@@ -788,11 +788,20 @@ test.describe("Composer autocomplete", () => {
await input.press("ArrowDown");
await input.press("h");
// On web the search reads the cursor after paint, so the input's value runs ahead of
// the list. Wait on the list itself: /tdd is hidden only while the search is "h", and
// back only once the search is "" again.
await expect(popover.getByText("/tdd", { exact: true })).toHaveCount(0);
// the list. Wait on the list itself. The list mounts only the rows near its scroll
// position, so one missing row proves nothing: right after the arrows wrap to the top,
// /tdd at the bottom is unmounted while the search is still "". With the search at "",
// the list always mounts the bottom row (/tdd) or the chosen one (/exit); only the
// search "h" leaves both out. Check them in one query so no frame falls between them.
await expect(
popover.filter({
has: page.getByText("/help", { exact: true }),
hasNot: page.getByText(/^\/(tdd|exit)$/),
}),
).toBeVisible();
await input.press("Backspace");
await expect(input).toHaveValue("/");
// /tdd is back only once the search is "" again.
await expect(popover.getByText("/tdd", { exact: true }).first()).toBeVisible();
await input.press("Enter");
@@ -20,6 +20,21 @@ function explorerSidebar(page: Parameters<typeof ensureExplorerSidebar>[0]) {
return page.getByTestId("workspace-explorer-sidebar").filter({ visible: true });
}
const LAYOUT_VIEWPORTS = {
compact: { width: 390, height: 844 },
wide: { width: 1280, height: 900 },
};
// The previous layout stays on screen for a few renders after the resize. Wait for the shell to
// switch so the next step reads the layout it resized to.
async function resizeToLayout(
page: Parameters<typeof ensureExplorerSidebar>[0],
layout: keyof typeof LAYOUT_VIEWPORTS,
) {
await page.setViewportSize(LAYOUT_VIEWPORTS[layout]);
await expect(page.getByTestId(`${layout}-shell`)).toBeVisible();
}
async function expectExplorerActiveTabForeground(
page: Parameters<typeof ensureExplorerSidebar>[0],
) {
@@ -244,7 +259,7 @@ test("tablet prototype keeps Explorer tabs when resizing down to a phone", async
await page.screenshot({ path: testInfo.outputPath("tablet-951.png") });
await openExplorerAgentDraft(page);
await page.screenshot({ path: testInfo.outputPath("tablet-agent-draft.png") });
await page.setViewportSize({ width: 390, height: 844 });
await resizeToLayout(page, "compact");
await revealPhoneExplorer(page);
await expect(
explorerSidebar(page).getByRole("button", { name: "New tab", exact: true }),
@@ -289,10 +304,10 @@ test("retains the Explorer host through appearance changes and folding", async (
.poll(() => explorer.evaluate((element) => getComputedStyle(element).backgroundColor))
.not.toBe(previousColor);
expect(await host.evaluate((element) => element.isConnected)).toBe(true);
await page.setViewportSize({ width: 390, height: 844 });
await resizeToLayout(page, "compact");
await ensureExplorerSidebar(page);
expect(await host.evaluate((element) => element.isConnected)).toBe(true);
await page.setViewportSize({ width: 1280, height: 900 });
await resizeToLayout(page, "wide");
await expect(explorer).toBeVisible();
expect(await host.evaluate((element) => element.isConnected)).toBe(true);
} finally {
@@ -327,7 +342,7 @@ test("reorders compact Explorer tabs with a pointer without changing selection",
const workspace = await seedWorkspace({ repoPrefix: "explorer-compact-drag-" });
try {
await gotoWorkspace(page, workspace.workspaceId);
await page.setViewportSize({ width: 390, height: 844 });
await resizeToLayout(page, "compact");
await openFilesPanel(page);
await reorderCompactExplorerTabs(page);
await expect(
@@ -394,9 +409,9 @@ test("updates populated code and diff appearance without losing the editor insta
.getByTestId("file-source-editor")
.elementHandle();
await text.fill(`${source}\n// retained Explorer edit`);
await page.setViewportSize({ width: 390, height: 844 });
await resizeToLayout(page, "compact");
await ensureExplorerSidebar(page);
await page.setViewportSize({ width: 1280, height: 900 });
await resizeToLayout(page, "wide");
expect(await explorerEditor!.evaluate((node) => node.isConnected)).toBe(true);
await expect(text).toContainText("retained Explorer edit");
} finally {
@@ -461,9 +476,9 @@ test("retains populated Explorer chat and terminal attachments through appearanc
const terminalNode = await terminal.elementHandle();
await page.getByTestId("workspace-explorer-toggle").first().click();
await ensureExplorerSidebar(page);
await page.setViewportSize({ width: 390, height: 844 });
await resizeToLayout(page, "compact");
await ensureExplorerSidebar(page);
await page.setViewportSize({ width: 1280, height: 900 });
await resizeToLayout(page, "wide");
await cycleWorkspaceTheme(page);
expect(await terminalNode!.evaluate((node) => node.isConnected)).toBe(true);
expect(attaches).toHaveLength(1);
@@ -483,7 +498,7 @@ test("compact file sheets cover Explorer and return to its retained file list",
try {
await writeFile(`${workspace.repoPath}/sheet-marker.txt`, "Explorer sheet marker\n");
await gotoWorkspace(page, workspace.workspaceId);
await page.setViewportSize({ width: 390, height: 844 });
await resizeToLayout(page, "compact");
const explorer = await ensureExplorerSidebar(page);
await openFilesPanel(page);
const host = await explorer.elementHandle();
@@ -0,0 +1,56 @@
import { expect, type Locator, type Page } from "@playwright/test";
import { test } from "../support/fixtures";
import { gotoWorkspace } from "../support/helpers/launcher";
import { seedWorkspace } from "../support/helpers/seed-client";
import { waitForWorkspaceTabsVisible } from "../support/helpers/workspace-tabs";
const HEADER_ICON_BUTTONS = ["workspace-header-menu-trigger", "workspace-explorer-toggle"];
function visible(page: Page, testId: string): Locator {
return page.getByTestId(testId).filter({ visible: true }).first();
}
function matchesFocusVisible(target: Locator): Promise<boolean> {
return target.evaluate((el) => el.matches(":focus-visible"));
}
async function expectKeyboardFocusRing(page: Page, testId: string): Promise<void> {
const button = visible(page, testId);
// Chromium matches :focus-visible on a programmatic focus that follows keyboard input.
await page.keyboard.press("Shift");
await button.focus();
await expect(button).toBeFocused();
expect(await matchesFocusVisible(button)).toBe(true);
await expect(button).toHaveCSS("outline-style", "solid");
await expect(button).toHaveCSS("outline-width", "2px");
// Header rows clip overflow; an outset ring would lose its top and bottom edges.
await expect(button).toHaveCSS("outline-offset", "-2px");
}
async function expectNoPointerFocusRing(page: Page, testId: string): Promise<void> {
const button = visible(page, testId);
await button.blur();
// Toggle twice so the layout ends where it started.
await button.click();
await button.click();
await expect(button).toBeFocused();
expect(await matchesFocusVisible(button)).toBe(false);
await expect(button).toHaveCSS("outline-style", "none");
}
test.describe("Icon button focus ring", () => {
test("header icon buttons show the focus ring for keyboard focus only", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
const workspace = await seedWorkspace({ repoPrefix: "icon-button-focus-" });
try {
await gotoWorkspace(page, workspace.workspaceId);
await waitForWorkspaceTabsVisible(page);
for (const testId of HEADER_ICON_BUTTONS) {
await expectKeyboardFocusRing(page, testId);
}
await expectNoPointerFocusRing(page, "workspace-explorer-toggle");
} finally {
await workspace.cleanup();
}
});
});
@@ -0,0 +1,24 @@
import {
test,
expectStillBrowsing,
installFromPage,
installListingFromRow,
openDirectory,
openFromInstalledTab,
openListingPage,
uninstallFromPage,
} from "../support/helpers/plugin-directory";
test("installs a listed plugin from Browse and uninstalls it from either of its pages", async ({
page,
directoryHost,
}) => {
await openDirectory(page, directoryHost);
await installListingFromRow(page);
await expectStillBrowsing(page);
await openListingPage(page);
await uninstallFromPage(page);
await installFromPage(page);
await openFromInstalledTab(page);
await uninstallFromPage(page);
});
+202 -138
View File
@@ -14,6 +14,44 @@ import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
import { getServerId } from "../support/helpers/server-id";
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
import { waitForSettledPosition } from "../support/helpers/sheet-layout";
import {
backToPlugins,
clearSearch,
closePluginLogs,
expectGalleryMenuWithoutSourceInstall,
expectPluginActionPending,
expectPluginFailed,
expectPluginHealthy,
expectPluginOff,
expectPluginOn,
expectPluginRemoved,
expectPluginsOff,
expectPluginsOn,
expectPluginsRoute,
expectSourceInstallFailed,
expectSourceInstallTurnsPluginsOn,
expectSourceInstalled,
expectToast,
expectUpdateAvailable,
installFromSource,
openPluginLogs,
openPluginPage,
openPluginPageActions,
openSourceInstall,
pluginRow,
reloadPluginFromPage,
removePluginFromPage,
searchInstalled,
selectInstalledTab,
selectPluginPageAction,
submitSourceInstall,
turnOffPluginsFromMenu,
turnOnPluginsFromAlert,
turnOnPluginsFromMenu,
turnPluginOff,
turnPluginOn,
updatePlugin,
} from "../support/helpers/plugin-gallery";
import {
expectSettingsHeader,
openCompactSettings,
@@ -170,22 +208,12 @@ async function openCompactPluginSettings(page: Page): Promise<void> {
const serverId = getServerId();
await openCompactSettings(page, buildOpenProjectRoute());
await openHostSection(page, serverId, "plugins");
await expect(page.getByRole("textbox", { name: "Plugin source", exact: true })).toBeVisible();
await expect(page.getByRole("button", { name: /^Installed/ })).toBeVisible();
}
async function reloadPlugin(page: Page): Promise<void> {
await selectPluginAction(page, "e2e-plugin", "Reload");
await expect(page.getByText("Reloaded e2e-plugin", { exact: true })).toBeVisible();
}
async function openPluginActions(page: Page, pluginId: string): Promise<void> {
await page.getByRole("button", { name: `Actions for ${pluginId}`, exact: true }).click();
await expect(page.getByRole("menuitem").first()).toBeVisible();
}
async function selectPluginAction(page: Page, pluginId: string, action: string): Promise<void> {
await openPluginActions(page, pluginId);
await page.getByRole("menuitem", { name: action, exact: true }).click();
async function openPluginPageFromSettings(page: Page, name: string): Promise<void> {
await openPluginSettings(page);
await openPluginPage(page, name);
}
async function expectContributionBody(page: Page, expectedBody: string): Promise<void> {
@@ -238,11 +266,6 @@ async function capturePluginInstallForm(
});
}
async function installPlugin(page: Page, source: string): Promise<void> {
await page.getByLabel("Plugin source").fill(source);
await page.getByRole("button", { name: "Install plugin" }).click();
}
async function expectPluginSourceDocsOpen(page: Page): Promise<void> {
const requestedPage = page
.context()
@@ -266,6 +289,17 @@ async function expectPluginSourceDocsOpen(page: Page): Promise<void> {
}
}
function commitAll(repository: string, message: string): void {
execFileSync("git", ["add", "-A"], { cwd: repository, stdio: "ignore" });
execFileSync("git", ["commit", "-m", message], { cwd: repository, stdio: "ignore" });
}
/** A new commit on the remote is an update for a plugin installed from that Git repository. */
async function publishGitPluginChange(repository: string, title: string): Promise<void> {
await writeFile(path.join(repository, "index.client.tsx"), pluginSource(title));
commitAll(repository, title);
}
async function createGitPluginRepository(root: string): Promise<string> {
const repository = path.join(root, "repository");
await mkdir(repository);
@@ -359,14 +393,12 @@ async function createGatedBuildRepository(
}
async function installFailedPlugin(
page: Page,
client: Awaited<ReturnType<typeof connectNewWorkspaceDaemonClient>>,
directory: string,
): Promise<void> {
await client.installPluginSource({ source: directory });
await writeFile(path.join(directory, "index.client.tsx"), "export default broken !!!");
await client.reloadPlugin("failed-preview-plugin");
await expect(page.getByLabel("failed-preview-plugin failed")).toBeVisible();
}
test("installs, reloads, recovers, disables, and removes a trusted local plugin", async ({
@@ -378,12 +410,15 @@ test("installs, reloads, recovers, disables, and removes a trusted local plugin"
await toggleRemoveAndReinstallLocalPlugin(page, directory);
});
test("installs a Git source after a failed source remains editable", async ({
test("installs a Git source after a failed source remains editable, then updates it", async ({
page,
pluginEnvironment,
}, testInfo) => {
const source = await prepareCompactGitInstall(page, pluginEnvironment);
await retryGitInstallAndInspectRows(page, source, testInfo);
await updateGitPlugin(page, source.repository);
await expectCompactPluginMenuFits(page, testInfo);
await failUpdateFromPluginPage(page, source.repository);
});
for (const sourceSupport of [undefined, false]) {
@@ -400,7 +435,7 @@ for (const viewport of [
{ width: 1280, height: 900 },
{ width: 390, height: 844 },
]) {
test(`installs an npm source and manages its row at ${viewport.width}px`, async ({
test(`installs an npm source and manages it at ${viewport.width}px`, async ({
page,
pluginEnvironment,
}, testInfo) => {
@@ -415,18 +450,19 @@ async function openNpmPluginSettings(page: Page, width: number) {
else await openPluginSettings(page);
}
async function expectSourceHierarchy(page: Page, description: string, source: string) {
const descriptionText = page.getByText(description, { exact: false });
const sourceText = page.getByText(source, { exact: false });
const descriptionSize = await descriptionText.evaluate((element) =>
Number.parseFloat(getComputedStyle(element).fontSize),
/** The row's description reads before where the plugin was installed from. */
async function expectSourceHierarchy(
page: Page,
pluginId: string,
description: string,
source: string,
) {
const row = pluginRow(page, pluginId);
await expect(row.getByText(description, { exact: true })).toHaveCSS(
"color",
"rgb(113, 113, 122)",
);
const sourceSize = await sourceText.evaluate((element) =>
Number.parseFloat(getComputedStyle(element).fontSize),
);
expect(sourceSize).toBeLessThan(descriptionSize);
await expect(sourceText).toHaveCSS("color", "rgb(161, 161, 170)");
await expect(descriptionText).toHaveCSS("color", "rgb(113, 113, 122)");
await expect(row.getByText(source, { exact: true })).toHaveCSS("color", "rgb(161, 161, 170)");
}
async function installLocalPluginWithStatusExamples(
@@ -457,36 +493,51 @@ async function installLocalPluginWithStatusExamples(
}),
);
await writeFile(path.join(directory, "index.client.tsx"), pluginSource("Plugin v1"));
await client.patchDaemonConfig({ pluginsEnabled: true });
await client.installPluginSource({ source: disabledDirectory });
await client.disablePlugin("disabled-preview-plugin-with-a-long-name");
await installFailedPlugin(client, failedDirectory);
const catalog = observePluginCatalog(page);
await gotoAppShell(page);
await openPluginSettings(page);
await catalog.waitForInitialFetch();
await expect(page.getByRole("textbox", { name: "Plugin installation ID" })).toHaveCount(0);
await expectPluginSourceDocsOpen(page);
await expectPluginFailed(page, "failed-preview-plugin");
// Plugins off on the host: the Installed tab says so and turns them back on.
await client.patchDaemonConfig({ pluginsEnabled: false });
await page.getByRole("switch", { name: "Enable plugins" }).click();
await expect(page.getByText("Plugins enabled", { exact: true })).toBeVisible();
await client.installPluginSource({ source: disabledDirectory });
await client.disablePlugin("disabled-preview-plugin-with-a-long-name");
await installFailedPlugin(page, client, failedDirectory);
await page.getByLabel("Plugin source").fill(directory);
await page.getByRole("button", { name: "Install plugin" }).click();
await expect(page.getByText("Installed e2e-plugin", { exact: true })).toBeVisible();
await expect(page.getByLabel("e2e-plugin running")).toBeVisible();
await expectPluginsOff(page);
await turnOnPluginsFromAlert(page);
await turnOffPluginsFromMenu(page);
await turnOnPluginsFromMenu(page);
await openSourceInstall(page);
await expectPluginSourceDocsOpen(page);
await submitSourceInstall(page, directory);
await expectSourceInstalled(page, "e2e-plugin");
await expectPluginOn(page, "e2e-plugin");
await expectPluginHealthy(page, "e2e-plugin");
await expect(page.getByText("Exercises the complete local plugin lifecycle")).toBeVisible();
await expect(
page.getByText("Keeps optional previews off until this plugin is enabled"),
).toBeVisible();
await expect(page.getByText("Demonstrates a plugin that needs attention")).toBeVisible();
await expect(page.getByLabel("disabled-preview-plugin-with-a-long-name disabled")).toBeVisible();
await expect(page.getByLabel("failed-preview-plugin failed")).toBeVisible();
await expectPluginOff(page, "disabled-preview-plugin-with-a-long-name");
await expectPluginFailed(page, "failed-preview-plugin");
await searchInstalled(page, "needs attention");
await expect(pluginRow(page, "failed-preview-plugin")).toBeVisible();
await expect(pluginRow(page, "e2e-plugin")).toHaveCount(0);
await clearSearch(page);
await expect(pluginRow(page, "e2e-plugin")).toBeVisible();
await capturePluginInstallForm(page, testInfo, "wide");
await openPluginActions(page, "e2e-plugin");
await openPluginPage(page, "e2e-plugin");
await openPluginPageActions(page, "e2e-plugin");
await capturePluginInstallForm(page, testInfo, "wide-menu");
await page.getByRole("menuitem", { name: "Logs", exact: true }).click();
await expect(page.getByRole("dialog")).toContainText("Logs: e2e-plugin");
await page.getByRole("button", { name: "Close", exact: true }).click();
await page.keyboard.press("Escape");
await openPluginLogs(page, "e2e-plugin");
await closePluginLogs(page);
await openContributionFromSettings(page, "Plugin v1", "Plugin v1 cleanup 0");
return directory;
@@ -497,13 +548,13 @@ async function reloadAndRecoverLocalPlugin(
client: PluginEnvironment["client"],
directory: string,
) {
await openPluginSettings(page);
await reloadPlugin(page);
await openPluginPageFromSettings(page, "e2e-plugin");
await reloadPluginFromPage(page, "e2e-plugin");
await openContributionFromSettings(page, "Plugin v1", "Plugin v1 cleanup 1");
await writeFile(path.join(directory, "index.client.tsx"), pluginSource("Plugin v2"));
await openPluginSettings(page);
await reloadPlugin(page);
await openPluginPageFromSettings(page, "e2e-plugin");
await reloadPluginFromPage(page, "e2e-plugin");
await openContributionFromSettings(page, "Plugin v2", "Plugin v2 cleanup 2");
await expect(page.getByRole("button", { name: "Plugin v1", exact: true })).not.toBeVisible();
@@ -511,8 +562,8 @@ async function reloadAndRecoverLocalPlugin(
path.join(directory, "index.client.tsx"),
pluginSource("Broken surface", "render exploded"),
);
await openPluginSettings(page);
await reloadPlugin(page);
await openPluginPageFromSettings(page, "e2e-plugin");
await reloadPluginFromPage(page, "e2e-plugin");
await openContributionFromSettings(page, "Broken surface", "Plugin failed: render exploded");
await openContribution(page, "Healthy surface", "Healthy contribution");
await openContribution(page, "Broken surface", "Plugin failed: render exploded");
@@ -522,39 +573,39 @@ async function reloadAndRecoverLocalPlugin(
await expect(page.getByRole("button", { name: "Broken surface", exact: true })).not.toBeVisible();
await writeFile(path.join(directory, "index.client.tsx"), "export default broken syntax !!!");
await openPluginSettings(page);
await selectPluginAction(page, "e2e-plugin", "Reload");
await expect(page.getByTestId("plugin-management-feedback")).toContainText("Request failed");
await expect(page.getByLabel("e2e-plugin failed")).toBeVisible();
await openPluginPageFromSettings(page, "e2e-plugin");
await selectPluginPageAction(page, "e2e-plugin", "Reload");
await expectToast(page, "Request failed");
await backToPlugins(page, "e2e-plugin");
await expectPluginFailed(page, "e2e-plugin");
await leavePluginSettings(page);
await expectContributionRemoved(page, "Recovered surface");
await writeFile(path.join(directory, "index.client.tsx"), pluginSource("Plugin v3"));
await openPluginSettings(page);
await selectPluginAction(page, "e2e-plugin", "Reload");
await expect(page.getByLabel("e2e-plugin running")).toBeVisible();
await openPluginPageFromSettings(page, "e2e-plugin");
await reloadPluginFromPage(page, "e2e-plugin");
await backToPlugins(page, "e2e-plugin");
await expectPluginHealthy(page, "e2e-plugin");
await openContributionFromSettings(page, "Plugin v3", "Plugin v3 cleanup 5");
}
async function toggleRemoveAndReinstallLocalPlugin(page: Page, directory: string) {
await openPluginSettings(page);
await page.getByRole("switch", { name: "e2e-plugin: Disable", exact: true }).click();
await expect(page.getByLabel("e2e-plugin disabled")).toBeVisible();
await turnPluginOff(page, "e2e-plugin");
await leavePluginSettings(page);
await expectContributionRemoved(page, "Plugin v3");
await openPluginSettings(page);
await page.getByRole("switch", { name: "e2e-plugin: Enable", exact: true }).click();
await expect(page.getByLabel("e2e-plugin running")).toBeVisible();
await turnPluginOn(page, "e2e-plugin");
await openContributionFromSettings(page, "Plugin v3", "Plugin v3 cleanup 6");
await openPluginSettings(page);
page.once("dialog", (dialog) => dialog.accept());
await selectPluginAction(page, "e2e-plugin", "Remove");
await expect(page.getByTestId("plugin-row-e2e-plugin")).toHaveCount(0);
await openPluginPageFromSettings(page, "e2e-plugin");
await removePluginFromPage(page, "e2e-plugin");
await expectPluginsRoute(page);
await expectPluginRemoved(page, "e2e-plugin");
await installPlugin(page, directory);
await expect(page.getByLabel("e2e-plugin running")).toBeVisible();
await installFromSource(page, directory, "e2e-plugin");
await expectPluginOn(page, "e2e-plugin");
await gotoAppShell(page);
await openContribution(page, "Plugin v3", "Plugin v3 cleanup 7");
}
@@ -583,10 +634,8 @@ async function prepareCompactGitInstall(page: Page, pluginEnvironment: PluginEnv
await client.disablePlugin("compact-disabled-plugin");
await gotoAppShell(page);
await openCompactPluginSettings(page);
await expect(page.getByRole("textbox", { name: "Plugin installation ID" })).toHaveCount(0);
await client.patchDaemonConfig({ pluginsEnabled: false });
await page.getByRole("switch", { name: "Enable plugins" }).click();
await expect(page.getByText("Plugins enabled", { exact: true })).toBeVisible();
await expectPluginsOff(page);
return { repository, missingSource };
}
@@ -598,24 +647,58 @@ async function retryGitInstallAndInspectRows(
) {
const { repository, missingSource } = source;
await installPlugin(page, missingSource);
await expect(page.getByTestId("plugin-management-feedback")).toContainText(
await openSourceInstall(page);
// Plugins are off, so the confirmation says installing turns them on.
await expectSourceInstallTurnsPluginsOn(page);
await submitSourceInstall(page, missingSource);
await expectSourceInstallFailed(
page,
missingSource,
`Plugin directory does not exist: ${missingSource}`,
);
await expect(page.getByLabel("Plugin source")).toHaveValue(missingSource);
await capturePluginInstallForm(page, testInfo, "compact-error");
await installPlugin(page, pathToFileURL(repository).href);
await expect(page.getByText("Installed git-e2e-plugin", { exact: true })).toBeVisible();
await expect(page.getByLabel("git-e2e-plugin running")).toBeVisible();
await submitSourceInstall(page, pathToFileURL(repository).href);
await expectSourceInstalled(page, "git-e2e-plugin");
await expectPluginsOn(page);
await expectPluginOn(page, "git-e2e-plugin");
await expect(
page.getByText("Shows how a realistically long plugin description wraps on a compact screen"),
).toBeVisible();
await expect(page.getByLabel("compact-disabled-plugin disabled")).toBeVisible();
await expect(page.getByLabel("Plugin source")).toHaveValue("");
await expectPluginOff(page, "compact-disabled-plugin");
await capturePluginInstallForm(page, testInfo, "compact-success");
await openPluginActions(page, "git-e2e-plugin");
const removeAction = page.getByRole("menuitem", { name: "Remove", exact: true });
}
async function updateGitPlugin(page: Page, repository: string) {
await publishGitPluginChange(repository, "Git plugin v2");
// Updates are checked when Plugins opens.
await page.reload();
await expectUpdateAvailable(page, "git-e2e-plugin");
await updatePlugin(page, "git-e2e-plugin");
await expectPluginOn(page, "git-e2e-plugin");
}
/** An update that fails on the plugin's page says why there, and offers Retry. */
async function failUpdateFromPluginPage(page: Page, repository: string) {
await publishGitPluginChange(repository, "Git plugin v3");
await page.reload();
const update = page.getByTestId("plugin-update").filter({ visible: true });
await expect(update).toHaveText("Update");
// Rewriting the commit the page checked leaves its update pointing at a commit the remote no
// longer serves. The next check offers the rewritten commit.
execFileSync("git", ["commit", "--amend", "-m", "Git plugin v3, amended"], {
cwd: repository,
stdio: "ignore",
});
await update.click();
await expect(update).toHaveText("Retry");
await expect(page.getByText(/Git command failed/)).toBeVisible();
}
async function expectCompactPluginMenuFits(page: Page, testInfo: TestInfo) {
await openPluginPage(page, "git-e2e-plugin");
await openPluginPageActions(page, "git-e2e-plugin");
const removeAction = page.getByRole("menuitem", { name: "Uninstall", exact: true });
await expect(removeAction).toBeInViewport({ ratio: 1 });
await waitForSettledPosition(removeAction);
await capturePluginInstallForm(page, testInfo, "compact-menu");
@@ -648,12 +731,11 @@ async function prepareLegacyPluginHost(
async function verifyLegacyPluginManagement(page: Page, directory: string) {
await expect(
page.getByText("Update this host to install plugins", { exact: true }),
pluginRow(page, "legacy-source-plugin").getByText(directory, { exact: true }),
).toBeVisible();
await expect(page.getByRole("textbox", { name: "Plugin source", exact: true })).toHaveCount(0);
await expect(page.getByText(directory, { exact: true })).toBeVisible();
await selectPluginAction(page, "legacy-source-plugin", "Reload");
await expect(page.getByText("Reloaded legacy-source-plugin", { exact: true })).toBeVisible();
await expectGalleryMenuWithoutSourceInstall(page);
await openPluginPage(page, "legacy-source-plugin");
await reloadPluginFromPage(page, "legacy-source-plugin");
}
async function prepareNpmPluginHost(
@@ -667,23 +749,22 @@ async function prepareNpmPluginHost(
await client.patchDaemonConfig({ pluginsEnabled: true });
await gotoAppShell(page);
await openNpmPluginSettings(page, viewport.width);
await selectInstalledTab(page);
}
async function retryNpmInstallAndInspectRow(page: Page, width: number, testInfo: TestInfo) {
await installPlugin(page, "npm:missing-plugin");
await expect(page.getByTestId("plugin-management-feedback")).toContainText("404");
await expect(page.getByLabel("Plugin source")).toHaveValue("npm:missing-plugin");
await installPlugin(page, "npm:@paseo-fixture/review@^2.0.0");
await expect(page.getByText("Installed npm-review", { exact: true })).toBeVisible();
await expect(page.getByLabel("npm-review running")).toBeVisible();
await openSourceInstall(page);
await submitSourceInstall(page, "npm:missing-plugin");
await expectSourceInstallFailed(page, "npm:missing-plugin", "404");
await submitSourceInstall(page, "npm:@paseo-fixture/review@^2.0.0");
await expectSourceInstalled(page, "npm-review");
await expectPluginOn(page, "npm-review");
await expectSourceHierarchy(
page,
"npm-review",
"Installed from the npm fixture registry",
"npm:@paseo-fixture/review · 2.0.0",
);
await expect(
page.getByText("Installed from the npm fixture registry", { exact: true }),
).toBeVisible();
await page.screenshot({
path: testInfo.outputPath(`npm-plugin-${width}.png`),
animations: "disabled",
@@ -691,12 +772,11 @@ async function retryNpmInstallAndInspectRow(page: Page, width: number, testInfo:
}
async function reloadAndRemoveNpmPlugin(page: Page) {
await selectPluginAction(page, "npm-review", "Reload");
await expect(page.getByText("Reloaded npm-review", { exact: true })).toBeVisible();
page.once("dialog", (dialog) => dialog.accept());
await selectPluginAction(page, "npm-review", "Remove");
await expect(page.getByText("Removed npm-review", { exact: true })).toBeVisible();
await expect(page.getByLabel("npm-review running")).toHaveCount(0);
await openPluginPage(page, "npm-review");
await reloadPluginFromPage(page, "npm-review");
await removePluginFromPage(page, "npm-review");
await expectPluginsRoute(page);
await expectPluginRemoved(page, "npm-review");
}
test("renders installed-plugin descriptions as plain text", async ({ page, pluginEnvironment }) => {
@@ -793,19 +873,6 @@ async function holdPluginLifecycleQueue(
};
}
function pluginRowActions(page: Page, pluginId: string) {
return page.getByRole("button", { name: `Actions for ${pluginId}`, exact: true });
}
async function expectPluginRowPending(page: Page, pluginId: string): Promise<void> {
await expect(pluginRowActions(page, pluginId)).toBeDisabled();
}
async function expectPluginRowSettled(page: Page, pluginId: string): Promise<void> {
await expect(pluginRowActions(page, pluginId)).toBeEnabled();
await expect(page.getByLabel(`${pluginId} running`)).toBeVisible();
}
async function capturePluginSurface(page: Page, testInfo: TestInfo, name: string): Promise<void> {
await page.screenshot({
path: testInfo.outputPath(name),
@@ -836,39 +903,36 @@ test("keeps Reload pending past a minute while the plugin queue is busy", async
// Observe before the app loads: its daemon socket comes up with the page.
const reload = observePluginReload(page);
await gotoAppShell(page);
await openPluginSettings(page);
// Plugins on is a precondition here, not the subject: set it through the daemon instead of the
// switch, whose transient "Plugins enabled" confirmation this scenario must not depend on.
// Plugins on is a precondition here, not the subject: set it through the daemon.
await client.patchDaemonConfig({ pluginsEnabled: true });
await client.installPluginSource({ source: pluginDirectory });
await expectPluginRowSettled(page, "e2e-plugin");
// Installed before Plugins opens, so it opens on the Installed tab.
await openPluginSettings(page);
await expectPluginOn(page, "e2e-plugin");
await openPluginPage(page, "e2e-plugin");
const queue = await holdPluginLifecycleQueue(client, directory);
try {
await selectPluginAction(page, "e2e-plugin", "Reload");
await selectPluginPageAction(page, "e2e-plugin", "Reload");
await reload.waitForRequest();
// Pending: the row's actions stay disabled, so a second reload cannot be submitted.
await expectPluginRowPending(page, "e2e-plugin");
// Pending: the plugin's controls stay disabled, so a second action cannot be submitted.
await expectPluginActionPending(page, "e2e-plugin");
await capturePluginSurface(page, testInfo, "plugin-reload-pending.png");
await waitPastFormerReloadDeadline(page, reload.requestedAt());
// Past the former deadline the reload is still pending, the row shows its previous state, and
// no timeout error reached the surface.
await expectPluginRowPending(page, "e2e-plugin");
await expect(page.getByLabel("e2e-plugin running")).toBeVisible();
await expect(page.getByTestId("plugin-management-feedback")).toHaveCount(0);
// Past the former deadline the reload is still pending; a request timeout would have settled
// it and released the switch.
await expectPluginActionPending(page, "e2e-plugin");
await expect(page.getByTestId("app-toast-message")).toHaveCount(0);
await capturePluginSurface(page, testInfo, "plugin-reload-past-deadline.png");
await queue.release();
// The daemon's answer only arrives once the plugin really started again; a request timeout
// would have shown up as feedback during the wait above.
// The daemon's answer only arrives once the plugin really started again.
await reload.waitForResponse();
expect(reload.requestCount()).toBe(1);
await expect(page.getByTestId("plugin-management-feedback")).toContainText(
"Reloaded e2e-plugin",
);
await expectPluginRowSettled(page, "e2e-plugin");
await expectToast(page, "Reloaded e2e-plugin");
await expectPluginOn(page, "e2e-plugin");
await capturePluginSurface(page, testInfo, "plugin-reload-completed.png");
} finally {
await queue.settle();
@@ -2,10 +2,16 @@ import { copyPluginExample } from "../support/helpers/plugin-fixture";
import { expect, test as base, type Page } from "../support/fixtures";
import { gotoAppShell } from "../support/helpers/app";
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
import { waitForSettledPosition } from "../support/helpers/sheet-layout";
async function openExample(page: Page, example: string) {
await page.getByRole("button", { name: `Open ${example}`, exact: true }).click();
await expect(page.getByText(`Modal example: ${example}`, { exact: true })).toBeVisible();
const title = page.getByText(`Modal example: ${example}`, { exact: true });
// A compact sheet holds below the viewport and then slides up, so a pointer placed before it
// stops lands on whatever slides under it. The settle check starts once the slide has begun;
// two equal reads during the hold would otherwise count as settled.
await expect(title).toBeInViewport();
await waitForSettledPosition(title);
}
async function closeExample(page: Page) {
@@ -18,11 +18,12 @@ import {
expectSettingsUnavailable,
openPluginsPage,
expectActionsMenuWithoutSettings,
expectNoSettingsCogWithoutScreens,
expectSettingsFollowPluginSwitch,
expectSettingsHidden,
expectSettingsTab,
openTabbedSettings,
selectSettingsTab,
openTabbedSettingsLink,
expectSettingsTooltip,
expectNamedPluginRow,
} from "../support/helpers/plugin-settings";
@@ -52,35 +53,41 @@ test("another client's save preserves a conflicting draft", async ({ page }) =>
await discardTitle(page);
});
test("Back to plugins returns from a plugin settings screen", async ({ page }) => {
test("Back to plugins returns from a plugin page", async ({ page }) => {
await openDisplaySettings(page);
await returnToPluginsPage(page);
});
test("plugin settings open from the cog and show a tab per screen", async ({ page }) => {
test("plugin pages open from their row and show a tab per settings screen", async ({ page }) => {
await openPluginsPage(page);
await test.step("plugin rows show the display name", async () => {
await expectNamedPluginRow(page);
});
await test.step("the cog explains itself", async () => {
await expectSettingsTooltip(page);
await test.step("the row opens the plugin's page", async () => {
await openTabbedSettings(page);
});
await test.step("the actions menu keeps only plugin actions", async () => {
await test.step("the page's menu keeps only plugin actions", async () => {
await expectActionsMenuWithoutSettings(page);
});
await test.step("tabs switch between the plugin's settings screens", async () => {
await openTabbedSettings(page);
await selectSettingsTab(page, "Advanced");
await selectSettingsTab(page, "General");
await returnToPluginsPage(page);
});
await test.step("a plugin without settings screens shows no cog", async () => {
await expectNoSettingsCogWithoutScreens(page);
await test.step("turning a plugin off removes its settings from its page", async () => {
await expectSettingsFollowPluginSwitch(page);
});
});
test("a settings screen link opens its tab", async ({ page }) => {
test("a settings screen link opens its tab, unavailable while the plugin is off", async ({
page,
settingsPlugin,
}) => {
await openTabbedSettingsLink(page, "Advanced");
await settingsPlugin.disablePlugin("settings-tabs");
await expectSettingsUnavailable(page);
await settingsPlugin.enablePlugin("settings-tabs");
await expectSettingsTab(page, "Advanced");
});
test.describe("compact plugin settings", () => {
@@ -95,7 +102,7 @@ test.describe("compact plugin settings", () => {
await hideMetadata(page);
await returnAndReopenSettings(page);
await settingsPlugin.disablePlugin("settings-example");
await expectSettingsUnavailable(page);
await expectSettingsHidden(page);
await settingsPlugin.enablePlugin("settings-example");
await reloadSavedDisplaySettings(page);
});
@@ -208,6 +208,35 @@ test.describe("Plugin sidebar items", () => {
});
});
test("a short desktop sidebar keeps workspaces usable while navigation scrolls", async ({
page,
}) => {
await page.setViewportSize({ width: 1280, height: 480 });
await gotoAppShell(page);
await expect(botRow(page, "status")).toBeAttached();
const workspace = visibleTestId(page, `sidebar-workspace-row-${getServerId()}:${workspaceId}`);
await expect(workspace).toBeInViewport({ ratio: 1 });
await expect(botRow(page, "status")).not.toBeInViewport();
await test.step("navigation stays within half the sidebar", async () => {
const nav = await boxOf(visibleTestId(page, "sidebar-nav-scroll"));
expect(nav.height).toBeLessThanOrEqual(480 / 2 + 1);
});
await test.step("scrolling navigation reaches its last row without moving workspaces", async () => {
const before = await boxOf(workspace);
await visibleTestId(page, "sidebar-global-new-workspace").hover();
await page.mouse.wheel(0, 800);
await expect(botRow(page, "status")).toBeInViewport({ ratio: 1 });
await expect(workspace).toBeInViewport({ ratio: 1 });
expect((await boxOf(workspace)).y).toBe(before.y);
await qaScreenshot(page, "desktop-short-sidebar-nav-scrolled");
await botRow(page, "status").click();
await expect(page.getByText("Bot status details", { exact: true })).toBeVisible();
await page.getByRole("button", { name: "Close bot status", exact: true }).click();
});
});
test("a restored plugin screen waits for its catalog before rendering", async ({ page }) => {
await page.setViewportSize(WIDE);
await gotoWorkspace(page, workspaceId);
@@ -0,0 +1,106 @@
import { expect, type Page } from "@playwright/test";
import { test } from "../support/fixtures";
import { gotoAppShell, openSettings } from "../support/helpers/app";
import { renameHostFromSettings } from "../support/helpers/hosts";
import { getServerId } from "../support/helpers/server-id";
import { openHostSection, selectSettingsHost } from "../support/helpers/settings";
const REGISTRY_KEY = "@paseo:daemon-registry";
const SEED_NONCE_KEY = "@paseo:e2e-seed-nonce";
const DISABLE_DEFAULT_SEED_ONCE_KEY = "@paseo:e2e-disable-default-seed-once";
// What a build with a connection kind this one doesn't know leaves in the registry: an extra
// connection on a host this build can reach, and a host reached only through it.
const UNKNOWN_CONNECTION = { id: "future:garage", type: "futureKind", address: "garage" };
const UNKNOWN_HOST = {
serverId: "srv_e2e_unknown_connection_host",
label: "Unknown connection host",
connections: [{ id: "future:roof", type: "futureKind", address: "roof" }],
preferredConnectionId: "future:roof",
};
const OFFLINE_HOST = {
serverId: "srv_e2e_saved_offline_host",
label: "Saved offline host",
password: "e2e-fake-password",
connections: [{ id: "direct:127.0.0.1:59999", type: "directTcp", endpoint: "127.0.0.1:59999" }],
preferredConnectionId: "direct:127.0.0.1:59999",
};
interface StoredHost {
serverId: string;
label?: string;
password?: string;
connections: unknown[];
}
async function addUnreadableEntriesAndReload(page: Page): Promise<void> {
await page.evaluate(
({ keys, primaryServerId, unknownConnection, offlineHost, unknownHost }) => {
const nonce = localStorage.getItem(keys.nonce);
if (!nonce) {
throw new Error("Expected the e2e seed nonce before overriding the host registry.");
}
const registry: StoredHost[] = JSON.parse(localStorage.getItem(keys.registry) ?? "[]");
registry
.find((host) => host.serverId === primaryServerId)
?.connections.push(unknownConnection);
registry.push(offlineHost, unknownHost);
localStorage.setItem(keys.registry, JSON.stringify(registry));
localStorage.setItem(keys.disableSeedOnce, nonce);
},
{
keys: {
registry: REGISTRY_KEY,
nonce: SEED_NONCE_KEY,
disableSeedOnce: DISABLE_DEFAULT_SEED_ONCE_KEY,
},
primaryServerId: getServerId(),
unknownConnection: UNKNOWN_CONNECTION,
offlineHost: OFFLINE_HOST,
unknownHost: UNKNOWN_HOST,
},
);
await page.reload();
}
async function readStoredRegistry(page: Page): Promise<StoredHost[] | null> {
return page.evaluate((key) => JSON.parse(localStorage.getItem(key) ?? "null"), REGISTRY_KEY);
}
async function readStoredHost(page: Page, serverId: string): Promise<StoredHost | undefined> {
return (await readStoredRegistry(page))?.find((host) => host.serverId === serverId);
}
test("saved hosts survive a registry entry this build can't read, and saving keeps it", async ({
page,
}) => {
await gotoAppShell(page);
await addUnreadableEntriesAndReload(page);
await test.step("both readable hosts are listed", async () => {
await page.getByTestId("sidebar-hosts-trigger").click();
await expect(page.getByTestId(`sidebar-host-row-${getServerId()}`)).toBeVisible();
await expect(page.getByTestId(`sidebar-host-row-${OFFLINE_HOST.serverId}`)).toBeVisible();
await expect(page.getByTestId(`sidebar-host-row-${UNKNOWN_HOST.serverId}`)).toHaveCount(0);
await page.keyboard.press("Escape");
});
await test.step("renaming a host keeps its password and the entries it can't read", async () => {
await openSettings(page);
await selectSettingsHost(page, OFFLINE_HOST.serverId);
await openHostSection(page, OFFLINE_HOST.serverId, "host");
await renameHostFromSettings(page, "Renamed offline host");
await expect
.poll(() => readStoredHost(page, OFFLINE_HOST.serverId))
.toMatchObject({ label: "Renamed offline host", password: OFFLINE_HOST.password });
const stored = await readStoredRegistry(page);
expect(stored?.map((host) => host.serverId)).toEqual([
getServerId(),
OFFLINE_HOST.serverId,
UNKNOWN_HOST.serverId,
]);
expect(stored?.[0]?.connections).toContainEqual(UNKNOWN_CONNECTION);
expect(stored?.[2]).toEqual(UNKNOWN_HOST);
});
});
@@ -33,6 +33,8 @@ import {
expectNoHostPasswordControls,
removeHostFromHostPage,
addDirectHostFromSettings,
expectAddHostFieldDrawnAsInput,
selectHostConnectionType,
expectHostOnlineWithoutError,
expectIdleAgentRelease,
editRestartRecoveryPrompt,
@@ -307,6 +309,24 @@ async function closeAddHostAndChangeTheme(page: import("@playwright/test").Page)
await page.keyboard.press("Control+Alt+t");
}
test("Add host draws its text fields as bordered inputs", async ({ page }) => {
await gotoAppShell(page);
await test.step("the pairing link field", async () => {
await openSidebarAddHost(page);
await selectHostConnectionType(page, "relay");
await expectAddHostFieldDrawnAsInput(page, "pair-link-input");
await page.getByTestId("pair-link-cancel").click();
});
await test.step("the direct connection fields", async () => {
await selectHostConnectionType(page, "direct");
await expectAddHostFieldDrawnAsInput(page, "direct-host-input");
await expectAddHostFieldDrawnAsInput(page, "direct-port-input");
await expectAddHostFieldDrawnAsInput(page, "direct-password-input");
});
});
test("sidebar Add host completes without navigating", async ({ page }) => {
await gotoAppShell(page);
await expect(page).toHaveURL(/\/open-project$/);
@@ -110,6 +110,7 @@ test.describe("Sidebar items in Appearance settings", () => {
await test.step("the sidebar starts in the default order", async () => {
await expectSidebarOrder(page, ["new-workspace", "history", "search", "schedules"]);
await expect(page.locator('[data-testid="sidebar-nav-separator"]:visible')).toHaveCount(1);
});
await test.step("the Sidebar section lists every item in the same order", async () => {
@@ -195,6 +196,9 @@ test.describe("Sidebar items in Appearance settings", () => {
await expectSidebarItemHidden(page, "history");
await expectSidebarItemHidden(page, "search");
await expectSidebarItemHidden(page, "schedules");
// Nothing is left above the Workspaces section: no drag strip, no empty divider.
await expect(page.locator('[data-testid="sidebar-nav-drag-strip"]:visible')).toHaveCount(0);
await expect(page.locator('[data-testid="sidebar-nav-separator"]:visible')).toHaveCount(0);
});
});
@@ -0,0 +1,36 @@
import { expect, test } from "../support/fixtures";
import { gotoAppShell } from "../support/helpers/app";
import {
expectFooterActionsInline,
seedDockedSidebarWidth,
} from "../support/helpers/sidebar-footer-overflow";
// Chromium's pointer bitmasks expose both inputs while the mouse is primary.
test.use({
viewport: { width: 1280, height: 800 },
launchOptions: {
args: [
"--blink-settings=primaryPointerType=4,availablePointerTypes=6,primaryHoverType=2,availableHoverTypes=3",
],
},
});
test("a touchscreen laptop keeps sidebar actions visible with a fine primary pointer", async ({
page,
}) => {
await seedDockedSidebarWidth(page, 200);
await gotoAppShell(page);
expect(
await page.evaluate(() => ({
finePrimary: matchMedia("(pointer: fine)").matches,
touchScreen: matchMedia("(any-pointer: coarse)").matches,
})),
).toEqual({ finePrimary: true, touchScreen: true });
await expectFooterActionsInline(page, [
"sidebar-add-project",
"sidebar-usage-icon",
"sidebar-hosts-trigger",
"sidebar-help",
"sidebar-settings",
]);
});
@@ -153,21 +153,29 @@ async function holdStreamAfterFirstCompletedToolCall(page: Page, agentId: string
type OverviewChatDisplay = "collapseToolCalls" | "collapseTurns";
// Expand thinking keeps reasoning out of tool call runs, so the first tool call starts alone.
async function configureOverviewToolCalls(page: Page, chatDisplay: OverviewChatDisplay) {
await page.addInitScript((display) => {
localStorage.setItem(
"@paseo:app-settings",
JSON.stringify({ chatDisplay: display, autoExpandReasoning: true }),
);
}, chatDisplay);
async function configureOverviewToolCalls(
page: Page,
chatDisplay: OverviewChatDisplay,
autoExpandReasoning: boolean,
) {
await page.addInitScript(
({ display, expandReasoning }) => {
localStorage.setItem(
"@paseo:app-settings",
JSON.stringify({ chatDisplay: display, autoExpandReasoning: expandReasoning }),
);
},
{ display: chatDisplay, expandReasoning: autoExpandReasoning },
);
}
async function createOverviewAgent(
page: Page,
title: string,
chatDisplay: OverviewChatDisplay = "collapseToolCalls",
autoExpandReasoning = true,
) {
await configureOverviewToolCalls(page, chatDisplay);
await configureOverviewToolCalls(page, chatDisplay, autoExpandReasoning);
return seedMockAgentWorkspace({
repoPrefix: "tool-call-overview-sheet-",
title,
@@ -401,3 +409,211 @@ test("forms a closed group when the lone tool call was left closed", async ({ pa
await agent.cleanup();
}
});
const longGroupedDetail = {
type: "unknown",
input: Array.from({ length: 80 }, (_, i) => `Long input ${i}`),
output: Array.from({ length: 80 }, (_, i) => `Long output ${i}`),
};
function provideLongReadDetail(item: Record<string, unknown> | undefined) {
if (item?.type === "tool_call" && item.name === "read") item.detail = longGroupedDetail;
}
function provideLongReasoningDetail(item: Record<string, unknown> | undefined) {
if (item?.type === "reasoning") {
item.text = Array.from({ length: 80 }, (_, i) => `Long reasoning ${i}`).join("\n");
}
}
async function provideLongToolDetails(page: Page, transformItem = provideLongReadDetail) {
await page.routeWebSocket(daemonWsRoutePattern(), (ws) => {
const server = ws.connectToServer();
ws.onMessage((message) => server.send(message));
server.onMessage((message) => {
const raw = typeof message === "string" ? message : message.toString("utf8");
const envelope = JSON.parse(raw);
const item = envelope.message?.payload?.event?.item;
transformItem(item);
if (envelope.message?.type === "fetch_agent_timeline_response") {
for (const entry of envelope.message.payload.entries) transformItem(entry.item);
}
ws.send(JSON.stringify(envelope));
});
});
}
async function toggleAndMeasureTool(badge: Locator) {
await badge.scrollIntoViewIfNeeded();
await badge.evaluate((node) => {
// Inline groups own a bounded viewport; opened turns use the chat viewport.
const container =
node.closest('[data-testid="tool-call-group"]') ??
node.closest('[data-testid="agent-chat-scroll"]');
if (!container) throw new Error("Expected a tool inside a group or chat viewport");
const frames: { top: number; height: number; containerHeight: number }[] = [];
(node as HTMLElement & { disclosureFrames: typeof frames }).disclosureFrames = frames;
node.querySelector("button")!.addEventListener(
"click",
() => {
const measure = () => {
const bounds = node.getBoundingClientRect();
frames.push({
top: bounds.top,
height: bounds.height,
containerHeight: container.getBoundingClientRect().height,
});
if (frames.length < 20) requestAnimationFrame(measure);
};
requestAnimationFrame(measure);
},
{ once: true },
);
});
await openToolDetails(badge);
await expect
.poll(() =>
badge.evaluate(
(node) => (node as HTMLElement & { disclosureFrames: unknown[] }).disclosureFrames.length,
),
)
.toBe(20);
return badge.evaluate(
(node) =>
(
node as HTMLElement & {
disclosureFrames: { top: number; height: number; containerHeight: number }[];
}
).disclosureFrames,
);
}
for (const display of ["collapseToolCalls", "collapseTurns"] as const) {
test(`keeps multi-section tool details within the group (${display})`, async ({ page }) => {
test.setTimeout(120_000);
const agent = await createOverviewAgent(page, "Bounded grouped tool details", display);
try {
await provideLongToolDetails(page);
await openOverviewAgent(page, agent);
await agent.client.sendAgentMessage(agent.agentId, "Exercise bounded grouped details.");
await agent.client.waitForAgentUpsert(
agent.agentId,
(snapshot) => snapshot.status === "idle",
30_000,
);
// A fresh mount of a finished conversation starts with its disclosures closed.
await page.reload();
await expectComposerVisible(page);
if (display === "collapseToolCalls") {
await scrollChatAwayFromBottom(page, { deltaY: -10_000, minDistanceFromBottom: 1 });
}
const group = page.getByTestId("tool-call-group").first();
if (display === "collapseTurns") {
await expect(page.getByTestId("tool-call-badge")).toHaveCount(0);
await openToolDetails(page.getByTestId("turn-summary").first());
} else {
await expect(group).toBeVisible();
await expect(group.getByTestId("tool-call-badge")).toHaveCount(0);
await openToolDetails(group);
}
const scope = display === "collapseTurns" ? page : group;
const badge = scope.getByTestId("tool-call-badge").filter({ hasText: "Read" }).first();
await expect(badge).toBeVisible();
const expandedFrames = await toggleAndMeasureTool(badge);
for (const frame of expandedFrames)
expect(frame.height).toBeLessThanOrEqual(frame.containerHeight);
expect(
Math.max(...expandedFrames.map((frame) => frame.top)) -
Math.min(...expandedFrames.map((frame) => frame.top)),
).toBeLessThanOrEqual(1);
await expect(badge).toContainText("Long output");
const collapsedFrames = await toggleAndMeasureTool(badge);
expect(
Math.max(...collapsedFrames.map((frame) => frame.top)) -
Math.min(...collapsedFrames.map((frame) => frame.top)),
).toBeLessThanOrEqual(1);
await expect(badge).not.toContainText("Long output");
} finally {
await agent.cleanup();
}
});
}
test("keeps tool headers reachable in an overflowing group", async ({ page }) => {
test.setTimeout(120_000);
const agent = await createOverviewAgent(page, "Overflowing overview tool group");
try {
const gate = await holdStreamAfterFirstCompletedToolCall(page, agent.agentId);
await openOverviewAgent(page, agent);
await agent.client.sendAgentMessage(agent.agentId, "Inspect a large tool group.");
await gate.waitForFirstCompleted();
gate.appendCompletedCalls(15);
const group = page.getByTestId("tool-call-group").first();
await openToolDetails(group);
const badges = group.getByTestId("tool-call-badge");
await expect(badges).toHaveCount(16);
await expect.poll(() => group.evaluate(hasScrolledToLatest)).toBe(true);
const first = badges.first();
for (const action of ["expand", "collapse"]) {
await test.step(`${action} the first tool without moving its header`, async () => {
await first.scrollIntoViewIfNeeded();
const headerTop = await topOf(first);
const frames = await toggleAndMeasureTool(first);
for (const frame of frames) expect(Math.abs(frame.top - headerTop)).toBeLessThanOrEqual(1);
});
}
await test.step("follow the next appended tool", async () => {
gate.appendCompletedCalls(1);
await expect(badges).toHaveCount(17);
await expect.poll(() => group.evaluate(hasScrolledToLatest)).toBe(true);
});
await test.step("reopen the group at its latest tool", async () => {
await openToolDetails(group);
await expect(badges).toHaveCount(0);
await openToolDetails(group);
await expect(badges).toHaveCount(17);
await expect.poll(() => group.evaluate(hasScrolledToLatest)).toBe(true);
});
} finally {
await agent.cleanup();
}
});
test("keeps expanded reasoning within the group viewport", async ({ page }) => {
test.setTimeout(120_000);
const agent = await createOverviewAgent(
page,
"Bounded grouped reasoning",
"collapseToolCalls",
false,
);
try {
// Seed before opening so the fixture transforms complete snapshots, not token deltas.
await agent.client.sendAgentMessage(agent.agentId, "Inspect grouped reasoning.");
await agent.client.waitForAgentUpsert(
agent.agentId,
(snapshot) => snapshot.status === "idle",
30_000,
);
await provideLongToolDetails(page, provideLongReasoningDetail);
await openOverviewAgent(page, agent);
await scrollChatAwayFromBottom(page, { deltaY: -10_000, minDistanceFromBottom: 1 });
const group = page.getByTestId("tool-call-group").first();
await openToolDetails(group);
const thought = group.getByTestId("tool-call-badge").filter({ hasText: "Thinking" }).first();
const frames = await toggleAndMeasureTool(thought);
const viewportHeight = await group.evaluate((node) => {
const scroll = Array.from(node.querySelectorAll<HTMLElement>("*")).find((child) =>
["auto", "scroll"].includes(getComputedStyle(child).overflowY),
);
if (!scroll) throw new Error("Expected the group's scroll viewport");
return scroll.getBoundingClientRect().height;
});
for (const frame of frames) expect(frame.height).toBeLessThanOrEqual(viewportHeight);
await expect(thought).toContainText("Long reasoning 79");
await openToolDetails(thought);
await expect(thought).not.toContainText("Long reasoning 79");
} finally {
await agent.cleanup();
}
});
@@ -37,6 +37,7 @@ import {
pickUsageHost,
usageModalHost,
dragUsageCardAbove,
recordUsageCardPositionsAfterRelease,
expectUsageCardOrder,
expectUsageOptionsFitContent,
setUsageCardOn,
@@ -254,9 +255,15 @@ test.describe("usage modal", () => {
await expect(work.getByText("work", { exact: true })).toBeVisible();
await expectPinnedUsage(page, ["31% Weekly", "20% Weekly"]);
const stopRecording = await recordUsageCardPositionsAfterRelease(page);
await dragUsageCardAbove(page, "beta:home", "alpha:a");
await expectUsageCardOrder(page, ["beta:home", "alpha:a", "beta:work"]);
await expectPinnedUsage(page, ["20% Weekly", "31% Weekly"]);
// The cards are in their new slots from the first frame after the drop.
const framesAfterDrop = await stopRecording();
const settled = framesAfterDrop.at(-1);
expect(settled).toBeDefined();
expect(framesAfterDrop.filter((frame) => frame !== settled)).toEqual([]);
await page.reload();
await expectPinnedUsage(page, ["20% Weekly", "31% Weekly"]);
@@ -73,35 +73,36 @@ function labelRow(page: import("@playwright/test").Page, name: string) {
return page.getByTestId(`workspace-label-picker-row-${name}`);
}
async function box(locator: import("@playwright/test").Locator) {
const measured = await locator.boundingBox();
if (!measured) throw new Error("expected a visible element to measure");
return measured;
}
async function size(locator: import("@playwright/test").Locator) {
await settled(locator);
const { width, height } = await box(locator);
const { width, height } = await settled(locator);
return { width, height };
}
/**
* Waits until an element stops moving.
* Waits until an element is on screen and stops moving, and returns where it settled.
*
* The flyout scales in and the sidebar behind it re-lays out as the filter changes, so a rail
* measured mid-animation is not a rail — and a measurement built from two `boundingBox()` calls
* would take its two halves from two different frames.
* would take its two halves from two different frames. A row that has not been laid out yet has
* no box at all; that is not settled either, so the poll keeps waiting instead of failing.
*/
async function settled(locator: import("@playwright/test").Locator) {
let previous = "";
const last: { box: Awaited<ReturnType<typeof locator.boundingBox>>; key: string | null } = {
box: null,
key: null,
};
await expect
.poll(async () => {
const current = JSON.stringify(await box(locator));
const stable = current === previous;
previous = current;
const current = await locator.boundingBox();
const key = current ? JSON.stringify(current) : null;
const stable = key !== null && key === last.key;
last.box = current;
last.key = key;
return stable;
})
.toBe(true);
if (!last.box) throw new Error("a settled element has a box");
return last.box;
}
async function expectAssigned(
@@ -0,0 +1,13 @@
context platform=ios timeout=60000 retries=0
# Start in an empty, connected composer with the Claude provider selected.
# COMMAND_ROW must name an inserting command, not an immediate client action.
env COMMAND_ROW="/advisor, Let Claude consult a stronger model at key moments"
env COMMAND_TEXT="/advisor "
open sh.paseo.debug
wait "editable=true" 60000
fill "editable=true" "/"
wait "label=\"${COMMAND_ROW}\"" 15000
press "label=\"${COMMAND_ROW}\""
# Do not type or move the caret: replacement itself must close autocomplete.
wait absent "label=\"${COMMAND_ROW}\"" 3000
wait "editable=true value=\"${COMMAND_TEXT}\"" 3000
@@ -0,0 +1,28 @@
# Inline tool detail scrolling on iPad
Use a task-owned iPad Pro 11-inch (M5) simulator in portrait (834×1210 points),
with the development bundle already loaded and a connected isolated mock host.
Set Chat display to Collapse turns. Prepare a finished turn containing a tool
named `scroll_probe`, with unknown detail: `input` is 80 newline-separated
`input-line-N` lines (N=0…79), and `output` is `SCROLL_REACHED_OUTPUT`.
Expand the turn, scroll chat to its start, and expand Scroll probe. The tool's
header must be at y=613…644 and its 400-point body below it. The fixed pan path
starts inside that body and stays inside it. Output starts below the cap.
These are replay preconditions, not asserted pixel sizes. Close other expanded
tools so the Scroll probe selector identifies this disclosure.
Replay `native-inline-tool-scroll.ios.yaml --maestro` on that explicit simulator
through the existing mobile runner or agent-device. In Expo's development menu,
turn off Tools button, then dismiss the known notification entitlement toast
with its bottom-right close button. Their transparent accessibility windows
otherwise mark app text covered. Another overlay must fail the visibility
assertions. Pass `--platform ios` and the prepared session's `--state-dir` when
replaying in that session.
The flow first asserts Input is visible and the output marker is not. After
panning it requires Output and its marker to be visible, then requires closing
the tool to hide its contents and reopening it to show Input again. Presence in
the accessibility tree is insufficient. A negative control with the passive
wrapper retained and only the detail's scrolling disabled must fail at Output
visibility. The browser disclosure suite checks tab navigation.
@@ -0,0 +1,28 @@
appId: sh.paseo.debug
---
- assertVisible:
id: workspace-tabs-scroll
- assertVisible: Scroll probe
- assertVisible: Input
- assertNotVisible: SCROLL_REACHED_OUTPUT
- repeat:
times: 7
commands:
- swipe:
start: "600,850"
end: "600,670"
duration: 600
- swipe:
start: "600,850"
end: "600,700"
duration: 600
- assertVisible: Output
- assertVisible: SCROLL_REACHED_OUTPUT
- tapOn:
point: "600,628"
- assertNotVisible: Output
- assertNotVisible: Input
- tapOn:
point: "600,628"
- assertVisible: Input
- stopApp
@@ -111,11 +111,13 @@ try {
"android",
"--no-test-ime",
);
ad("wait", "text", "Plugin source", "5000");
const plugins = JSON.parse(ad("snapshot", "-i", "--json"));
const source = plugins.data.nodes.find((node) => node.type === "android.widget.EditText");
assert(source, "The connected host must support installing plugins from source");
ad("press", `@${source.ref}`);
// The source field lives in the Install from source sheet, behind the page's menu.
ad("wait", 'label="More plugin actions"', "5000");
ad("press", 'label="More plugin actions"');
ad("wait", 'text="Install from source"', "5000");
ad("press", 'text="Install from source"');
ad("wait", 'id="plugin-source-input"', "5000");
ad("press", 'id="plugin-source-input"');
ad("type", "qa-source");
const pluginMeasurement = await waitForFocusedInput();
// A FormTextInput draws its border and padding on the native input's parent.
@@ -0,0 +1,27 @@
# Android Usage drop regressions
Use a device you own and fixed reports from an isolated daemon. Keep recordings in `.artifacts/`. Do not upload recordings containing account details.
## Same-slot drop
Open Usage with two cards that fit without scrolling. Run:
```sh
ANDROID_SERIAL=emulator-5580 node packages/app/e2e/mobile/usage-drag/android.mjs
```
Set `PASEO_DEVICE_SESSION` to reuse your Agent Device session. The test holds the first handle, moves within its slot, drops it, then swipes the sheet body. It asserts sheet movement while the finger is still down: after release, the sheet can snap back to its starting position.
## Old-order frame
Record a drop with Android `screenrecord`. Include the original order, the held arrangement, the release, and at least five seconds after release. Take a reference screenshot before recording. Use fixed labels that stay visible throughout the drop.
Create a JSON map of label names to screenshot rectangles `[x, y, width, height]`, in physical pixels. Crop each label tightly, without changing text or the pointer. Install `opencv-python-headless` in a local virtual environment under `.artifacts/`, then run:
```sh
.artifacts/frames-venv/bin/python packages/app/e2e/mobile/usage-drag/frames.py \
--reference .artifacts/before.png --labels .artifacts/labels.json \
.artifacts/drop-up.mp4 .artifacts/drop-down.mp4
```
The check requires recognized labels in the first and last frames and a changed final order. After every label first reaches its final slot, it fails on any frame showing all original slots again. It prints the offending frame numbers for each recording. This exercises the Android compositor; a JavaScript render test cannot establish which intermediate commit reached the screen.
@@ -0,0 +1,71 @@
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import { mkdirSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";
import { setTimeout } from "node:timers/promises";
// Open Usage with a fixture whose cards fit without scrolling before running.
// A same-slot drop must release the list's recognizer so a body swipe moves the sheet.
const serial = process.env.ANDROID_SERIAL;
assert.ok(serial, "Set ANDROID_SERIAL to the device owned by this test");
const session = process.env.PASEO_DEVICE_SESSION ?? "usage-drag-regression";
const artifacts = resolve(".artifacts/usage-drag-regression");
mkdirSync(artifacts, { recursive: true });
function ad(...args) {
return execFileSync(
"agent-device",
[...args, "--platform", "android", "--serial", serial, "--session", session],
{ encoding: "utf8", timeout: 30_000 },
);
}
function adb(...args) {
return execFileSync("adb", ["-s", serial, ...args], { timeout: 30_000 });
}
function snapshot() {
return JSON.parse(ad("snapshot", "--json")).data.nodes;
}
function touch(kind, x, y) {
adb("shell", "input", "motionevent", kind, String(Math.round(x)), String(Math.round(y)));
}
try {
ad("open", process.env.PASEO_MOBILE_APP_ID ?? "sh.paseo.debug");
const nodes = snapshot();
writeFileSync(resolve(artifacts, "before.json"), JSON.stringify(nodes));
const handle = nodes.find((node) => node.identifier === "usage-card-drag-handle");
const list = nodes.find((node) => node.identifier === "usage-list");
assert.ok(handle?.rect && list?.rect, "Open Usage with a visible card handle");
const x = handle.rect.x + handle.rect.width / 2;
const y = handle.rect.y + handle.rect.height / 2;
touch("DOWN", x, y);
await setTimeout(600);
touch("MOVE", x, y + 60);
await setTimeout(200);
touch("MOVE", x, y + 90);
touch("MOVE", x, y + 60);
ad("screenshot", resolve(artifacts, "dragging.png"));
touch("UP", x, y + 60);
await setTimeout(2000);
ad("screenshot", resolve(artifacts, "dropped.png"));
const swipeX = list.rect.x + list.rect.width / 2;
touch("DOWN", swipeX, y + 80);
for (let offset = 90; offset <= 500; offset += 10) {
touch("MOVE", swipeX, y + offset);
}
const during = snapshot();
writeFileSync(resolve(artifacts, "during.json"), JSON.stringify(during));
ad("screenshot", resolve(artifacts, "during.png"));
touch("UP", swipeX, y + 500);
await setTimeout(1500);
const after = snapshot();
writeFileSync(resolve(artifacts, "after.json"), JSON.stringify(after));
ad("screenshot", resolve(artifacts, "after.png"));
const beforeSheet = nodes.find((node) => node.label === "Bottom sheet handle");
const afterSheet = during.find((node) => node.label === "Bottom sheet handle");
assert.ok(beforeSheet?.rect, "Usage must start as a sheet");
assert.ok(
!afterSheet || afterSheet.rect.y > beforeSheet.rect.y + 50,
"A body swipe after a same-slot drop must move the sheet",
);
} finally {
ad("close");
}
@@ -0,0 +1,59 @@
"""Check native drop recordings against visible row labels (requires opencv-python-headless).
Supply a before screenshot and a JSON map of label names to [x, y, width, height].
A recording must start in the original order and end in a different order. Once
all labels reach their final slots, any frame returning to the original slots fails.
Keep the pointer clear of the labels and use fixed fixture data.
"""
import argparse
import json
from pathlib import Path
import cv2
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--reference", required=True)
parser.add_argument("--labels", required=True)
parser.add_argument("--top", type=int, default=0)
parser.add_argument("--bottom", type=int)
parser.add_argument("videos", nargs="+")
args = parser.parse_args()
reference = cv2.imread(args.reference, cv2.IMREAD_GRAYSCALE)
assert reference is not None, "Cannot read reference image"
labels = json.loads(Path(args.labels).read_text())
results = []
for video in args.videos:
capture = cv2.VideoCapture(video)
frames = []
while True:
ok, image = capture.read()
if not ok:
break
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
positions = {}
for label, (x, y, width, height) in labels.items():
template = reference[y:y + height, x:x + width]
matches = cv2.matchTemplate(gray[args.top:args.bottom, x:x + width], template, cv2.TM_CCOEFF_NORMED)
_, confidence, _, point = cv2.minMaxLoc(matches)
positions[label] = (point[1] + args.top, confidence)
frames.append(positions)
capture.release()
assert frames, f"No frames in {video}"
initial, final = frames[0], frames[-1]
assert all(confidence >= 0.95 for _, confidence in initial.values()), f"Unrecognized initial labels: {video}"
assert all(confidence >= 0.95 for _, confidence in final.values()), f"Unrecognized final labels: {video}"
assert sorted(initial, key=lambda key: initial[key][0]) != sorted(final, key=lambda key: final[key][0]), f"Drop did not reorder: {video}"
def matches_slots(frame, target):
return all(confidence >= 0.95 and abs(y - target[label][0]) <= 2
for label, (y, confidence) in frame.items())
reached_final = False
wrong = []
for number, frame in enumerate(frames, start=1):
reached_final = reached_final or matches_slots(frame, final)
if reached_final and matches_slots(frame, initial):
wrong.append(number)
results.append({"recording": video, "oldOrderFrames": wrong, "count": len(wrong)})
print(json.dumps(results, indent=2))
raise SystemExit(1 if any(result["count"] for result in results) else 0)
@@ -170,6 +170,11 @@ export interface ModelTriggerLabelState {
modelShown: boolean;
modelText: string;
modelTruncated: boolean;
/**
* The model label shows what its box fits right now: the full text when it fits, otherwise a
* truncation that fits. False while the control has yet to catch up with a reflow.
*/
modelFitsBox: boolean;
}
declare global {
@@ -194,12 +199,18 @@ function readModelTriggerLabelStateInPage(): ModelTriggerLabelState {
};
const modelShown = model !== undefined && shown(model);
const modelText = model?.textContent ?? "";
const overflows = (node: Element) => node.scrollWidth > node.clientWidth;
const modelOverflows = model !== undefined && overflows(model);
// The label's box is sized by an invisible copy of the full text, its first child, so the box
// follows a reflow at once while the shown text waits for the control's next layout event.
const fullTextSizer = model?.parentElement?.parentElement?.firstElementChild;
const fullTextFits = fullTextSizer ? !overflows(fullTextSizer) : true;
return {
modelShown,
modelText,
thinkingShown: modelShown && thinking !== undefined,
modelTruncated:
model !== undefined && (modelText.endsWith("…") || model.scrollWidth > model.clientWidth),
modelTruncated: modelText.endsWith("…") || modelOverflows,
modelFitsBox: !modelOverflows && modelText.endsWith("…") !== fullTextFits,
};
}
@@ -217,13 +228,26 @@ export async function recordModelTriggerFramesFromLoad(page: Page): Promise<void
})()`);
}
/** The model control's labels once two reads 100ms apart agree. */
/**
* The model control's labels once it has caught up with its width: two reads 100ms apart agree
* and the model label shows what its box fits. A resize reflows the page at once, but the control
* chooses its labels again only when its layout events arrive, and on a slow runner that takes
* longer than 100ms. Until then the label can be clipped by the browser beside the thinking
* label, or truncated in a box that has since widened.
*/
export async function readSettledModelTriggerLabels(page: Page): Promise<ModelTriggerLabelState> {
const deadline = Date.now() + 10_000;
let previous = await page.evaluate(readModelTriggerLabelStateInPage);
for (;;) {
await page.waitForTimeout(100);
const next = await page.evaluate(readModelTriggerLabelStateInPage);
if (JSON.stringify(next) === JSON.stringify(previous)) return next;
const agrees = JSON.stringify(next) === JSON.stringify(previous);
if (agrees && next.modelFitsBox) return next;
if (Date.now() > deadline) {
throw new Error(
`the model control never settled on a label that fits its box: ${JSON.stringify(next)}`,
);
}
previous = next;
}
}
@@ -96,7 +96,7 @@ export async function listTerminalIds(daemon: IsolatedHostDaemon): Promise<strin
const execFileAsync = promisify(execFile);
async function psField(pid: number, field: "stat" | "lstart"): Promise<string> {
async function psField(pid: number, field: "stat" | "lstart" | "comm"): Promise<string> {
const { stdout } = await execFileAsync("ps", ["-o", `${field}=`, "-p", String(pid)], {
env: { ...process.env, LC_ALL: "C" },
});
@@ -117,17 +117,22 @@ export interface UnclosableTerminalProgram {
export async function plantUnclosableTerminalProgram(
daemon: IsolatedHostDaemon,
): Promise<UnclosableTerminalProgram> {
const parent = spawn("/bin/sh", ["-c", "sleep 0 & echo $!; exec sleep 600"], {
stdio: ["ignore", "pipe", "ignore"],
// The shell reaps any child that has exited whenever it finishes a builtin, so the program
// reads fd 3 until we close it, which happens only once the shell has become `sleep`.
const parent = spawn("/bin/sh", ["-c", "cat <&3 >/dev/null & echo $!; exec sleep 600 3<&-"], {
stdio: ["ignore", "pipe", "ignore", "pipe"],
});
parent.unref();
const release = () => {
parent.stdio[3]?.destroy();
if (parent.exitCode === null && parent.signalCode === null) parent.kill("SIGKILL");
};
try {
const pid = await new Promise<number>((resolve) => {
parent.stdout!.once("data", (chunk: Buffer) => resolve(Number(chunk.toString().trim())));
});
await expect.poll(() => psField(parent.pid!, "comm")).toMatch(/(^|\/)sleep$/);
parent.stdio[3]!.destroy();
await expect.poll(async () => (await psField(pid, "stat")).startsWith("Z")).toBe(true);
const gone = spawn(process.execPath, ["-e", ""], { stdio: "ignore" });
await new Promise((resolve) => gone.once("exit", resolve));
@@ -6,7 +6,7 @@ import {
type ChildProcess,
type SpawnOptions,
} from "node:child_process";
import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import net from "node:net";
import { tmpdir } from "node:os";
import path from "node:path";
@@ -59,7 +59,17 @@ export async function getAvailableHostDaemonPort(): Promise<number> {
return port;
}
async function waitForServer(port: number, child: ChildProcess): Promise<void> {
/**
* Resolves once this daemon answers on its port. An open TCP port is not
* enough: the port is released before the daemon binds it, and whatever takes
* it in between also accepts connections while the daemon exits with
* EADDRINUSE. Only the daemon's own status reports its server id.
*/
async function waitForServer(
port: number,
child: ChildProcess,
identity: { serverId: string; paseoHome: string },
): Promise<void> {
const deadline = Date.now() + 90_000;
let lastError: unknown = null;
@@ -70,22 +80,13 @@ async function waitForServer(port: number, child: ChildProcess): Promise<void> {
);
}
try {
await new Promise<void>((resolve, reject) => {
const socket = net.connect(port, "127.0.0.1", () => {
socket.end();
resolve();
});
socket.setTimeout(1_000, () => {
socket.destroy();
reject(new Error(`Connection timed out to isolated daemon port ${port}`));
});
socket.on("error", reject);
});
return;
const serverId = await readServerId(port, identity.paseoHome);
if (serverId === identity.serverId) return;
lastError = new Error(`Port ${port} is served by ${serverId}, not ${identity.serverId}`);
} catch (error) {
lastError = error;
await new Promise((resolve) => setTimeout(resolve, 100));
}
await new Promise((resolve) => setTimeout(resolve, 100));
}
throw new Error(
@@ -95,6 +96,25 @@ async function waitForServer(port: number, child: ChildProcess): Promise<void> {
);
}
/**
* Reads the server id from the daemon's status route. The route needs a bearer
* on a password-protected daemon; the daemon accepts the local credential it
* writes into its home before listening, as the CLI does for local status.
*/
async function readServerId(port: number, paseoHome: string): Promise<string> {
const localCredential = await readFile(path.join(paseoHome, "local-credential"), "utf8").then(
(token) => token.trim(),
() => null,
);
const response = await fetch(`http://127.0.0.1:${port}/api/status`, {
headers: localCredential ? { authorization: `Bearer ${localCredential}` } : {},
signal: AbortSignal.timeout(1_000),
});
if (!response.ok) throw new Error(`Status request to port ${port} returned ${response.status}`);
const status = (await response.json()) as { serverId?: unknown };
return String(status.serverId);
}
function withMutableRelay(
config: NonNullable<IsolatedHostDaemonOptions["config"]>,
relay: NonNullable<IsolatedHostDaemonOptions["mutableRelay"]>,
@@ -121,7 +141,7 @@ export async function startIsolatedHostDaemon(
serverId: string,
options: IsolatedHostDaemonOptions = {},
): Promise<IsolatedHostDaemon> {
const port = await getAvailableHostDaemonPort();
let port = await getAvailableHostDaemonPort();
const metroPort = process.env.E2E_METRO_PORT;
if (!metroPort) throw new Error("E2E_METRO_PORT is required to start an isolated host daemon");
@@ -221,7 +241,7 @@ export async function startIsolatedHostDaemon(
});
try {
await waitForServer(port, spawned);
await waitForServer(port, spawned, { serverId, paseoHome });
return spawned;
} catch (error) {
throw new Error(
@@ -231,8 +251,25 @@ export async function startIsolatedHostDaemon(
}
};
// The reserved port is released before the daemon binds it, so another
// process can take it in between. Only the first start picks a new port:
// restart() keeps the endpoint the app already knows.
const startOnFreePort = async (): Promise<void> => {
for (let attempt = 1; ; attempt += 1) {
try {
await spawnDaemon();
return;
} catch (error) {
const lostPort = error instanceof Error && error.message.includes("EADDRINUSE");
if (!lostPort || attempt === 3) throw error;
await stopDaemon();
port = await getAvailableHostDaemonPort();
}
}
};
try {
await spawnDaemon();
await startOnFreePort();
} catch (error) {
await stopDaemon();
if (!options.preserveHome) {
@@ -0,0 +1,205 @@
import { execFileSync } from "node:child_process";
import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { createServer } from "node:http";
import { tmpdir } from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { expect, test as base, type Page } from "../fixtures";
import appPackage from "../../../package.json";
import { gotoAppShell, openSettings } from "./app";
import { addConnectedHostAndReload } from "./hosts";
import { pluginRequirements } from "./plugin-fixture";
import {
expectToast,
openPluginPage,
pluginPageName,
selectInstalledTab,
selectPluginPageAction,
} from "./plugin-gallery";
import { openHostSection, selectSettingsHost } from "./settings";
import { startHostDaemon } from "./versioned-host-daemon";
/**
* Settings → Plugins → Browse against a host whose registry is a local server. The one listing
* installs from a local Git repository, so installing needs no network.
*/
export const LISTING = {
id: "acme/directory-example",
name: "Directory example",
description: "Adds a review checklist to every workspace",
overview: "Directory example keeps a checklist beside your agents.",
};
export const test = base.extend<{ directoryHost: { serverId: string; port: number } }>({
directoryHost: async ({ e2eWorker }, provide) => {
void e2eWorker;
const root = await mkdtemp(path.join(tmpdir(), "paseo-plugin-directory-"));
const registry = await startRegistry(await createListedPlugin(root));
try {
const host = await startHostDaemon({
version: appPackage.version,
pluginRegistryUrl: registry.url,
});
try {
await provide({ serverId: host.serverId, port: host.port });
} finally {
await host.dispose();
}
} finally {
await registry.close();
await rm(root, { recursive: true, force: true });
}
},
});
async function createListedPlugin(root: string) {
const repository = path.join(root, "repository");
execFileSync("git", ["init", "-b", "main", repository], { stdio: "ignore" });
await writeFile(
path.join(repository, "paseo-plugin.json"),
JSON.stringify({
id: "directory-example",
name: LISTING.name,
requirements: pluginRequirements,
}),
);
await writeFile(
path.join(repository, "index.client.ts"),
"export default function () { return () => {}; }",
);
const git = (...args: string[]) =>
execFileSync(
"git",
["-c", "user.name=Paseo Tests", "-c", "user.email=e2e@paseo.test", ...args],
{
cwd: repository,
encoding: "utf8",
},
).trim();
git("add", "-A");
git("commit", "-m", "initial");
const date = "2026-10-03T00:00:00.000Z";
return {
id: LISTING.id,
name: LISTING.name,
description: LISTING.description,
categories: ["tools"],
author: { github: "acme", name: "Acme" },
repository: { url: "https://github.com/acme/directory-example" },
artifact: {
kind: "git",
remote: pathToFileURL(repository).href,
commit: git("rev-parse", "HEAD"),
},
media: [],
submittedAt: date,
reviewedAt: date,
updatedAt: date,
publishedAt: date,
installs: 1200,
};
}
async function startRegistry(listing: Record<string, unknown>) {
const documents: Record<string, unknown> = {
"/index.json": {
schemaVersion: 1,
registry: { name: "Local", url: "http://127.0.0.1" },
categories: [{ slug: "tools", label: "Tools" }],
plugins: [listing],
featured: [],
generatedAt: "2026-10-03T00:00:00.000Z",
},
[`/plugins/${LISTING.id}.json`]: {
...listing,
readme: `# ${LISTING.name}\n\n${LISTING.overview}`,
},
};
const server = createServer((request, response) => {
const document = request.url ? documents[request.url] : undefined;
if (!document) {
response.writeHead(404).end();
return;
}
response.setHeader("Content-Type", "application/json");
response.end(JSON.stringify(document));
});
await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
const address = server.address();
if (!address || typeof address === "string") throw new Error("Missing registry address");
return {
url: `http://127.0.0.1:${address.port}`,
close: () => new Promise<void>((resolve) => server.close(() => resolve())),
};
}
function listingRow(page: Page) {
return page.getByTestId(`plugin-listing-${LISTING.id}`).filter({ visible: true });
}
function browseTab(page: Page) {
return page.getByRole("button", { name: "Browse", exact: true });
}
/** A host with no plugins opens Plugins on Browse. */
export async function openDirectory(page: Page, host: { serverId: string; port: number }) {
await gotoAppShell(page);
await addConnectedHostAndReload(page, { ...host, label: "Plugin directory" });
await openSettings(page);
await selectSettingsHost(page, host.serverId);
await openHostSection(page, host.serverId, "plugins");
await expect(browseTab(page)).toHaveAttribute("aria-selected", "true");
await expect(listingRow(page)).toContainText(LISTING.description);
}
/** Install asks first, naming the author and version, then the row offers Uninstall. */
export async function installListingFromRow(page: Page) {
await listingRow(page).getByTestId(`plugin-install-${LISTING.id}`).click();
const sheet = page.getByTestId("plugin-install-sheet");
await expect(sheet).toContainText("Acme");
await sheet.getByTestId("plugin-install-confirm").click();
await expect(listingRow(page).getByTestId(`plugin-uninstall-${LISTING.id}`)).toBeVisible({
timeout: 60_000,
});
}
/** Installing the first plugin keeps the user on Browse. */
export async function expectStillBrowsing(page: Page) {
await expect(browseTab(page)).toHaveAttribute("aria-selected", "true");
await expect(page.getByRole("button", { name: /^Installed · 1/ })).toBeVisible();
}
export async function openListingPage(page: Page) {
await listingRow(page).getByText(LISTING.name, { exact: true }).click();
await expect(pluginPageName(page)).toHaveText(LISTING.name);
await expect(page.getByText(LISTING.overview, { exact: true })).toBeVisible();
}
/**
* Uninstalling keeps the plugin's page open on its listing, back on Install, whether the page was
* opened from Browse or from the Installed tab.
*/
export async function uninstallFromPage(page: Page) {
page.once("dialog", (dialog) => dialog.accept());
await selectPluginPageAction(page, LISTING.name, "Uninstall");
await expectToast(page, `Uninstalled ${LISTING.name}`);
await expect(pluginPageName(page)).toHaveText(LISTING.name);
await expect(
page.getByTestId(`plugin-install-${LISTING.id}`).filter({ visible: true }),
).toBeVisible();
}
export async function installFromPage(page: Page) {
await page.getByTestId(`plugin-install-${LISTING.id}`).filter({ visible: true }).click();
await page.getByTestId("plugin-install-confirm").click();
await expect(
page.getByRole("button", { name: `Actions for ${LISTING.name}`, exact: true }),
).toBeVisible({ timeout: 60_000 });
}
export async function openFromInstalledTab(page: Page) {
await page.getByRole("button", { name: "Back to plugins", exact: true }).click();
await selectInstalledTab(page);
await openPluginPage(page, LISTING.name, "directory-example");
}
@@ -0,0 +1,269 @@
import { buildSettingsHostSectionRoute } from "@/utils/host-routes";
import { expect, type Page } from "../fixtures";
import { getServerId } from "./server-id";
import { expectAppRoute } from "./route-assertions";
/**
* Settings → Host → Plugins: the Installed and Browse tabs, the page menu, the install sheet and a
* plugin's own page. Helpers that take a plugin name expect the manifest name, which is the plugin
* ID when the manifest has none.
*/
export function pluginsRoute(serverId = getServerId()): string {
return buildSettingsHostSectionRoute(serverId, "plugins");
}
export function pluginPageRoute(pluginId: string, serverId = getServerId()): string {
return `${pluginsRoute(serverId)}/${encodeURIComponent(pluginId)}`;
}
/** Settings keeps the Plugins page mounted beneath a plugin's page, so read visible rows only. */
export function pluginRow(page: Page, pluginId: string) {
return page.getByTestId(`plugin-row-${pluginId}`).filter({ visible: true });
}
function pluginSwitch(page: Page, name: string, action: "Disable" | "Enable") {
return page.getByRole("switch", { name: `${name}: ${action}`, exact: true }).filter({
visible: true,
});
}
export async function expectToast(page: Page, message: string): Promise<void> {
await expect(page.getByTestId("app-toast-message")).toContainText(message);
}
// Tabs and search
export async function selectInstalledTab(page: Page): Promise<void> {
const tab = page.getByRole("button", { name: /^Installed/ });
await tab.click();
await expect(tab).toHaveAttribute("aria-selected", "true");
}
export async function searchInstalled(page: Page, query: string): Promise<void> {
await page.getByRole("textbox", { name: "Search installed", exact: true }).fill(query);
}
export async function clearSearch(page: Page): Promise<void> {
await page.getByRole("button", { name: "Clear search", exact: true }).click();
await expect(page.getByRole("textbox", { name: "Search installed", exact: true })).toHaveValue(
"",
);
}
// Installed rows
export async function expectPluginOn(page: Page, name: string): Promise<void> {
await expect(pluginSwitch(page, name, "Disable")).toBeVisible();
await expect(pluginSwitch(page, name, "Disable")).toBeEnabled();
}
export async function expectPluginOff(page: Page, name: string): Promise<void> {
await expect(pluginSwitch(page, name, "Enable")).toBeVisible();
}
export async function turnPluginOff(page: Page, name: string): Promise<void> {
await pluginSwitch(page, name, "Disable").click();
await expectPluginOff(page, name);
}
export async function turnPluginOn(page: Page, name: string): Promise<void> {
await pluginSwitch(page, name, "Enable").click();
await expectPluginOn(page, name);
}
/** The switch stays disabled while an action on the plugin runs, so a second one cannot start. */
export async function expectPluginActionPending(page: Page, name: string): Promise<void> {
await expect(pluginSwitch(page, name, "Disable")).toBeDisabled();
}
export async function expectPluginFailed(page: Page, pluginId: string): Promise<void> {
await expect(pluginRow(page, pluginId).getByText("failed", { exact: true })).toBeVisible();
}
export async function expectPluginHealthy(page: Page, pluginId: string): Promise<void> {
await expect(pluginRow(page, pluginId)).toBeVisible();
await expect(pluginRow(page, pluginId).getByText("failed", { exact: true })).toHaveCount(0);
}
export async function expectPluginRemoved(page: Page, pluginId: string): Promise<void> {
await expect(page.getByTestId(`plugin-row-${pluginId}`)).toHaveCount(0);
}
// Plugins on the host
function pluginsOffAlert(page: Page) {
return page.getByRole("alert").filter({ hasText: "Plugins are off on" });
}
export async function expectPluginsOff(page: Page): Promise<void> {
await expect(pluginsOffAlert(page)).toBeVisible();
}
export async function expectPluginsOn(page: Page): Promise<void> {
await expect(pluginsOffAlert(page)).toHaveCount(0);
}
export async function turnOnPluginsFromAlert(page: Page): Promise<void> {
await pluginsOffAlert(page).getByRole("button", { name: "Turn on", exact: true }).click();
await expectPluginsOn(page);
}
// The page menu
function galleryMenu(page: Page) {
return page.getByRole("button", { name: "More plugin actions", exact: true }).filter({
visible: true,
});
}
async function openGalleryMenu(page: Page): Promise<void> {
await galleryMenu(page).click();
await expect(page.getByRole("menuitem").first()).toBeVisible();
}
export async function expectGalleryMenuWithoutSourceInstall(page: Page): Promise<void> {
await openGalleryMenu(page);
await expect(page.getByRole("menuitem", { name: "Turn off plugins", exact: true })).toBeVisible();
await expect(
page.getByRole("menuitem", { name: "Install from source", exact: true }),
).toHaveCount(0);
await page.keyboard.press("Escape");
}
export async function turnOffPluginsFromMenu(page: Page): Promise<void> {
await openGalleryMenu(page);
await page.getByRole("menuitem", { name: "Turn off plugins", exact: true }).click();
await expectToast(page, "Plugins disabled");
await expectPluginsOff(page);
}
export async function turnOnPluginsFromMenu(page: Page): Promise<void> {
await openGalleryMenu(page);
await page.getByRole("menuitem", { name: "Turn on plugins", exact: true }).click();
await expectToast(page, "Plugins enabled");
await expectPluginsOn(page);
}
// Install from source
function sourceField(page: Page) {
return page.getByRole("textbox", { name: "Plugin source", exact: true });
}
export async function openSourceInstall(page: Page): Promise<void> {
await openGalleryMenu(page);
await page.getByRole("menuitem", { name: "Install from source", exact: true }).click();
await expect(sourceField(page)).toBeVisible();
}
export async function expectSourceInstallTurnsPluginsOn(page: Page): Promise<void> {
await expect(
page.getByText("Plugins are not sandboxed. Installing also turns plugins on.", {
exact: true,
}),
).toBeVisible();
}
export async function submitSourceInstall(page: Page, source: string): Promise<void> {
await sourceField(page).fill(source);
await page.getByRole("button", { name: "Install", exact: true }).click();
}
/** A failed install keeps the sheet open with the source, so the user can correct it. */
export async function expectSourceInstallFailed(
page: Page,
source: string,
message: string,
): Promise<void> {
await expect(page.getByRole("alert").filter({ hasText: message })).toBeVisible();
await expect(sourceField(page)).toHaveValue(source);
}
export async function expectSourceInstalled(page: Page, name: string): Promise<void> {
await expectToast(page, `Installed ${name}`);
await expect(sourceField(page)).toHaveCount(0);
}
export async function installFromSource(page: Page, source: string, name: string): Promise<void> {
await openSourceInstall(page);
await submitSourceInstall(page, source);
await expectSourceInstalled(page, name);
}
// Updates
function updateRow(page: Page, pluginId: string) {
return page.getByTestId(`plugin-update-${pluginId}`).filter({ visible: true });
}
export async function updatePlugin(page: Page, pluginId: string): Promise<void> {
await updateRow(page, pluginId).getByRole("button", { name: "Update", exact: true }).click();
await expectToast(page, `${pluginId} updated`);
await expect(page.getByTestId(`plugin-update-${pluginId}`)).toHaveCount(0);
}
export async function expectUpdateAvailable(page: Page, pluginId: string): Promise<void> {
await expect(updateRow(page, pluginId)).toBeVisible();
}
// A plugin's page
export function pluginPageName(page: Page) {
return page.getByTestId("plugin-page-name").filter({ visible: true });
}
/** Opens the plugin's page from its row on the Installed tab. */
export async function openPluginPage(page: Page, name: string, pluginId = name): Promise<void> {
await pluginRow(page, pluginId).getByText(name, { exact: true }).click();
await expect(pluginPageName(page)).toHaveText(name);
}
export async function backToPlugins(page: Page, pluginId: string): Promise<void> {
await page.getByRole("button", { name: "Back to plugins", exact: true }).click();
await expect(pluginRow(page, pluginId)).toBeVisible();
}
export async function openPluginPageActions(page: Page, name: string): Promise<void> {
await page
.getByRole("button", { name: `Actions for ${name}`, exact: true })
.filter({ visible: true })
.click();
await expect(page.getByRole("menuitem").first()).toBeVisible();
}
export async function selectPluginPageAction(
page: Page,
name: string,
action: "Reload" | "Logs" | "Uninstall",
): Promise<void> {
await openPluginPageActions(page, name);
await page.getByRole("menuitem", { name: action, exact: true }).click();
}
export async function reloadPluginFromPage(page: Page, name: string): Promise<void> {
await selectPluginPageAction(page, name, "Reload");
await expectToast(page, `Reloaded ${name}`);
}
export async function openPluginLogs(page: Page, name: string): Promise<void> {
await selectPluginPageAction(page, name, "Logs");
await expect(page.getByRole("dialog")).toContainText(`Logs: ${name}`);
}
export async function closePluginLogs(page: Page): Promise<void> {
await page.getByRole("button", { name: "Close", exact: true }).click();
await expect(page.getByRole("dialog")).toHaveCount(0);
}
/** Uninstall confirms first; uninstalling a plugin that is not in the directory returns to Plugins. */
export async function removePluginFromPage(page: Page, name: string): Promise<void> {
page.once("dialog", (dialog) => dialog.accept());
await selectPluginPageAction(page, name, "Uninstall");
await expectToast(page, `Uninstalled ${name}`);
await expect(pluginPageName(page)).toHaveCount(0);
}
export async function expectPluginsRoute(page: Page): Promise<void> {
await expectAppRoute(page, pluginsRoute());
}
@@ -9,6 +9,15 @@ import { addConnectedHostAndReload } from "./hosts";
import { gotoAppShell, openSettings } from "./app";
import { openHostSection, selectSettingsHost } from "./settings";
import { pluginRequirements } from "./plugin-fixture";
import {
backToPlugins,
expectPluginFailed,
expectPluginHealthy,
openPluginPage,
selectPluginPageAction,
} from "./plugin-gallery";
const PLUGIN_ID = "requirements-example";
export const test = base.extend<{
requirementHost: { serverId: string; port: number; directory: string; client: DaemonClient };
@@ -80,7 +89,7 @@ export const test = base.extend<{
async function writeRequirements(directory: string, paseo: string) {
await writeFile(
path.join(directory, "paseo-plugin.json"),
JSON.stringify({ id: "requirements-example", requirements: { paseo } }),
JSON.stringify({ id: PLUGIN_ID, requirements: { paseo } }),
);
}
@@ -93,7 +102,7 @@ export async function openRequirementHost(page: Page, host: { serverId: string;
}
export async function expectAppMismatch(page: Page) {
await expect(page.getByLabel("requirements-example failed", { exact: true })).toBeVisible();
await expectPluginFailed(page, PLUGIN_ID);
await expect(
page.getByText(/Plugin "requirements-example" requires Paseo \^99.0.0. Your app is/),
).toBeVisible();
@@ -102,18 +111,21 @@ export async function expectAppMismatch(page: Page) {
export async function correctRequirementAndReload(page: Page, directory: string) {
await writeRequirements(directory, pluginRequirements.paseo);
await reloadRequirementsPlugin(page);
await expect(page.getByLabel("requirements-example running", { exact: true })).toBeVisible();
await backToPlugins(page, PLUGIN_ID);
await expectPluginHealthy(page, PLUGIN_ID);
await expect(page.getByText(/Your app is/)).toHaveCount(0);
}
export async function rejectDaemonMismatch(page: Page, directory: string) {
await writeRequirements(directory, ">=100.0.0");
await reloadRequirementsPlugin(page);
await expect(page.getByLabel("requirements-example failed", { exact: true })).toBeVisible();
await backToPlugins(page, PLUGIN_ID);
await expectPluginFailed(page, PLUGIN_ID);
await expect(page.getByText(/Your daemon is 99.0.0/).first()).toBeVisible();
}
/** Reload lives on the plugin's page. */
async function reloadRequirementsPlugin(page: Page) {
await page.getByRole("button", { name: "Actions for requirements-example", exact: true }).click();
await page.getByRole("menuitem", { name: "Reload", exact: true }).click();
await openPluginPage(page, PLUGIN_ID);
await selectPluginPageAction(page, PLUGIN_ID, "Reload");
}
@@ -7,8 +7,18 @@ import { gotoAppShell, openSettings } from "./app";
import { goBackInSettings, openCompactSettings, openHostSection } from "./settings";
import { getServerId } from "./server-id";
import { expectAppRoute } from "./route-assertions";
import { buildSettingsHostSectionRoute } from "@/utils/host-routes";
import { connectNewWorkspaceDaemonClient } from "./new-workspace";
import {
backToPlugins,
openPluginPage,
openPluginPageActions,
pluginPageName,
pluginPageRoute,
pluginRow,
pluginsRoute,
turnPluginOff,
turnPluginOn,
} from "./plugin-gallery";
type SettingsClient = Awaited<ReturnType<typeof connectNewWorkspaceDaemonClient>>;
@@ -90,68 +100,64 @@ export const test = base.extend<{ settingsPlugin: SettingsClient }>({
export async function openDisplaySettings(page: Page) {
await gotoAppShell(page);
await openSettings(page);
await openPluginScreen(page);
await openSettingsExamplePage(page);
}
export async function openCompactDisplaySettings(page: Page) {
await gotoAppShell(page);
await openCompactSettings(page, new URL(page.url()).pathname);
await openPluginScreen(page);
await openSettingsExamplePage(page);
}
async function openPluginScreen(page: Page) {
async function openSettingsExamplePage(page: Page) {
await openHostSection(page, getServerId(), "plugins");
await openSettingsFromCog(page);
await openPluginPage(page, "settings-example");
await expectSettingsExampleScreen(page);
}
/** The cog on a plugin's row. Its label is "Settings"; the row tells plugins apart. */
function settingsButton(page: Page, pluginId: string) {
return page
.getByTestId(`plugin-row-${pluginId}`)
.filter({ visible: true })
.getByRole("button", { name: "Settings", exact: true });
}
async function openSettingsFromCog(page: Page) {
await settingsButton(page, "settings-example").click();
/** A plugin's page shows its settings inline. With one screen there are no tabs. */
async function expectSettingsExampleScreen(page: Page) {
await expect(page.getByRole("switch", { name: "Show metadata" })).toBeVisible();
// A plugin with one settings screen shows no tabs, and the header names only the plugin.
await expect(page.getByTestId("plugin-settings-tabs")).toHaveCount(0);
await expectSettingsHeader(page, "settings-example");
await expectAppRoute(page, pluginPageRoute("settings-example"));
}
export async function openPluginsPage(page: Page) {
await gotoAppShell(page);
await openSettings(page);
await openHostSection(page, getServerId(), "plugins");
}
/** The page's menu holds plugin actions only; its settings screens are on the page itself. */
export async function expectActionsMenuWithoutSettings(page: Page) {
await page.getByRole("button", { name: "Actions for settings-example", exact: true }).click();
await openPluginPageActions(page, TABBED_PLUGIN_NAME);
await expect(page.getByRole("menuitem", { name: "Reload", exact: true })).toBeVisible();
await expect(page.getByRole("menuitem", { name: "Display", exact: true })).toHaveCount(0);
await expect(page.getByRole("menuitem", { name: "General", exact: true })).toHaveCount(0);
await expect(page.getByRole("menuitem", { name: "Advanced", exact: true })).toHaveCount(0);
await page.keyboard.press("Escape");
}
export async function expectNoSettingsCogWithoutScreens(page: Page) {
await page.getByRole("switch", { name: "settings-example: Disable" }).click();
await expect(page.getByRole("switch", { name: "settings-example: Enable" })).toBeVisible();
await expect(settingsButton(page, "settings-example")).toHaveCount(0);
await page.getByRole("switch", { name: "settings-example: Enable" }).click();
await expect(settingsButton(page, "settings-example")).toBeVisible();
/** Turning a plugin off unloads its settings screens, so its page no longer shows them. */
export async function expectSettingsFollowPluginSwitch(page: Page) {
await openPluginPage(page, "settings-example");
await turnPluginOff(page, "settings-example");
await expectSettingsHidden(page);
await turnPluginOn(page, "settings-example");
await expect(page.getByRole("switch", { name: "Show metadata" })).toBeVisible();
}
export async function expectSettingsTooltip(page: Page) {
await settingsButton(page, "settings-example").hover();
await expect(page.getByRole("tooltip")).toHaveText("Settings");
await page.mouse.move(0, 0);
export async function expectSettingsHidden(page: Page) {
await expect(page.getByRole("switch", { name: "Show metadata" })).toHaveCount(0);
}
/** A manifest `name` titles the row and its controls; the id stays visible beneath it. */
/** A manifest `name` titles the row and its switch, and opens the plugin's page. */
export async function expectNamedPluginRow(page: Page) {
const row = page.getByTestId(`plugin-row-${TABBED_PLUGIN_ID}`).filter({ visible: true });
const row = pluginRow(page, TABBED_PLUGIN_ID);
await expect(row.getByText(TABBED_PLUGIN_NAME, { exact: true })).toBeVisible();
await expect(row.getByText(TABBED_PLUGIN_ID, { exact: true })).toBeVisible();
await expect(
page.getByRole("switch", { name: `${TABBED_PLUGIN_NAME}: Disable`, exact: true }),
).toBeVisible();
await expect(
page.getByRole("button", { name: `Actions for ${TABBED_PLUGIN_NAME}`, exact: true }),
).toBeVisible();
await expect(row).toHaveAccessibleName(TABBED_PLUGIN_NAME);
}
/** The page names the plugin by its manifest name, with the ID beneath it. */
export async function openTabbedSettings(page: Page) {
await settingsButton(page, TABBED_PLUGIN_ID).click();
await openPluginPage(page, TABBED_PLUGIN_NAME, TABBED_PLUGIN_ID);
await expect(
page.getByText(TABBED_PLUGIN_ID, { exact: true }).filter({ visible: true }),
).toBeVisible();
await expectAppRoute(page, pluginPageRoute(TABBED_PLUGIN_ID));
await expectSettingsTab(page, "General");
// The Advanced icon reads the plugin's translations; the General icon throws and is dropped.
await expect(page.getByTestId("advanced-tab-icon")).toBeVisible();
@@ -159,27 +165,25 @@ export async function openTabbedSettings(page: Page) {
function settingsTab(page: Page, title: string) {
return page.getByTestId("plugin-settings-tabs").getByRole("button", { name: title, exact: true });
}
/** Tabs swap the screen in place on the plugin's page, so Back still returns to Plugins. */
export async function selectSettingsTab(page: Page, title: "General" | "Advanced") {
await settingsTab(page, title).click();
await expectSettingsTab(page, title);
await expectAppRoute(
page,
`${pluginPageRoute(TABBED_PLUGIN_ID)}?screenId=${title.toLowerCase()}`,
);
}
export async function expectSettingsTab(page: Page, title: "General" | "Advanced") {
const other = title === "General" ? "Advanced" : "General";
await expect(settingsTab(page, title)).toHaveAttribute("aria-selected", "true");
await expect(page.getByText(`${title} settings body`, { exact: true })).toBeVisible();
await expect(page.getByText(`${other} settings body`, { exact: true })).toHaveCount(0);
// The header names the plugin by its manifest name; the tab names the screen.
await expectSettingsHeader(page, TABBED_PLUGIN_NAME);
await expectAppRoute(
page,
`${buildSettingsHostSectionRoute(getServerId(), "plugins")}/${TABBED_PLUGIN_ID}/${title.toLowerCase()}`,
);
await expect(pluginPageName(page)).toHaveText(TABBED_PLUGIN_NAME);
}
export async function openTabbedSettingsLink(page: Page, title: "General" | "Advanced") {
await gotoAppShell(page);
await page.goto(
`${buildSettingsHostSectionRoute(getServerId(), "plugins")}/${TABBED_PLUGIN_ID}/${title.toLowerCase()}`,
);
await page.goto(`${pluginPageRoute(TABBED_PLUGIN_ID)}/${title.toLowerCase()}`);
await expectSettingsTab(page, title);
}
export async function groupByWorkspace(page: Page) {
@@ -235,18 +239,13 @@ export async function discardTitle(page: Page) {
}
export async function returnAndReopenSettings(page: Page) {
await goBackInSettings(page);
await openSettingsFromCog(page);
await expectAppRoute(page, pluginsRoute());
await openPluginPage(page, "settings-example");
await expectSettingsExampleScreen(page);
}
export async function returnToPluginsPage(page: Page) {
await page.getByRole("button", { name: "Back to plugins", exact: true }).click();
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "plugins"));
await expect(
page.getByRole("button", { name: "Actions for settings-example", exact: true }),
).toBeVisible();
}
async function expectSettingsHeader(page: Page, title: string) {
// Settings keeps the Plugins page mounted beneath, so read the visible title only.
await expect(page.getByText(title, { exact: true }).filter({ visible: true })).toHaveCount(1);
await backToPlugins(page, "settings-example");
await expectAppRoute(page, pluginsRoute());
}
export async function expectSettingsUnavailable(page: Page) {
await expect(
@@ -223,6 +223,14 @@ export async function addDirectHostFromSettings(
await expect(page.getByTestId("add-host-modal")).toHaveCount(0, { timeout: 30_000 });
}
export async function expectAddHostFieldDrawnAsInput(page: Page, testId: string): Promise<void> {
const field = page.getByTestId(testId);
await expect(field).toBeVisible();
await expect(field).toHaveCSS("border-top-width", "1px");
await expect(field).not.toHaveCSS("padding-left", "0px");
await expect(field).not.toHaveCSS("background-color", "rgba(0, 0, 0, 0)");
}
export async function toggleHostAdvanced(page: Page): Promise<void> {
await page.getByTestId("direct-host-advanced-toggle").click();
}
@@ -60,14 +60,8 @@ export function footerOverflowMenu(page: Page): Locator {
return page.getByTestId("sidebar-footer-overflow-menu");
}
/**
* The icon line shows exactly `testIDs`, in order, each `controlSize` square and wholly inside the
* line's box, so no button is cut off by the sidebar's edge.
*/
export async function expectFooterLine(
page: Page,
input: { testIDs: string[]; controlSize: number },
): Promise<void> {
/** The icon line shows exactly `testIDs`, in order. */
export async function expectFooterActionsInline(page: Page, testIDs: string[]): Promise<void> {
const line = footerLine(page);
await expect(line).toHaveCount(1);
await expect
@@ -76,7 +70,16 @@ export async function expectFooterLine(
.locator(FOOTER_LINE_TEST_IDS.map((testID) => `[data-testid="${testID}"]`).join(","))
.evaluateAll((elements) => elements.map((element) => element.getAttribute("data-testid"))),
)
.toEqual(input.testIDs);
.toEqual(testIDs);
}
/** The actions are square and fit inside the line. */
export async function expectFooterLine(
page: Page,
input: { testIDs: string[]; controlSize: number },
): Promise<void> {
await expectFooterActionsInline(page, input.testIDs);
const line = footerLine(page);
const { row, buttons } = await line.evaluate((element, testIDs) => {
const rect = (node: Element) => {
const { x, width, height } = node.getBoundingClientRect();
@@ -187,6 +187,44 @@ export async function dragUsageCardAbove(
await page.mouse.up();
}
/**
* Starts recording where the cards are painted on every frame after the next mouse release.
* Call the returned function to stop and read the frames, each as "id@top" for every card.
*/
export async function recordUsageCardPositionsAfterRelease(
page: Page,
): Promise<() => Promise<string[]>> {
const recording = await usageModal(page).evaluateHandle((modal) => {
const state = { released: false, stopped: false, frames: [] as string[] };
const markReleased = () => {
state.released = true;
};
window.addEventListener("mouseup", markReleased, { capture: true, once: true });
const recordFrame = () => {
if (state.stopped) return;
if (state.released) {
const cards = Array.from(modal.querySelectorAll('[data-testid^="usage-report-"]'));
state.frames.push(
cards
.map((card) => {
const id = card.getAttribute("data-testid")?.slice("usage-report-".length);
return `${id}@${Math.round(card.getBoundingClientRect().top)}`;
})
.join(" "),
);
}
requestAnimationFrame(recordFrame);
};
requestAnimationFrame(recordFrame);
return state;
});
return () =>
recording.evaluate((state) => {
state.stopped = true;
return state.frames;
});
}
/** Each pinned window as it reads: its percent and short label, "31% 5h". */
export async function expectPinnedUsage(page: Page, windows: string[]): Promise<void> {
const pinned = usageItem(page).getByTestId("sidebar-usage-pinned-window");
@@ -62,6 +62,38 @@ export async function startRestartableHostDaemon(version: string): Promise<Resta
};
}
export interface HostDaemon {
serverId: string;
port: number;
dispose(): Promise<void>;
}
/** A host daemon of its own, for tests that need host configuration the worker daemon lacks. */
export async function startHostDaemon(options: {
version: string;
pluginRegistryUrl?: string;
}): Promise<HostDaemon> {
const paseoHomeRoot = await mkdtemp(path.join(tmpdir(), "paseo-e2e-host-"));
try {
const daemon = await startVersionedHostDaemon({
...options,
port: await getAvailableHostDaemonPort(),
paseoHomeRoot,
});
return {
serverId: daemon.serverId,
port: daemon.port,
async dispose() {
await daemon.stop();
await rm(paseoHomeRoot, { recursive: true, force: true });
},
};
} catch (error) {
await rm(paseoHomeRoot, { recursive: true, force: true });
throw error;
}
}
interface VersionedHostDaemon {
serverId: string;
port: number;
@@ -73,6 +105,7 @@ interface VersionedHostDaemonOptions {
version: string;
port: number;
paseoHomeRoot: string;
pluginRegistryUrl?: string;
}
// Starts the versioned test daemon on an explicit port with a caller-owned PASEO_HOME. The caller
@@ -83,7 +116,12 @@ async function startVersionedHostDaemon(
const child = spawnTsx(
VERSIONED_DAEMON_ENTRYPOINT,
[options.version, String(options.port), options.paseoHomeRoot],
{ stdio: ["ignore", "pipe", "pipe", "ipc"] },
{
stdio: ["ignore", "pipe", "pipe", "ipc"],
env: options.pluginRegistryUrl
? { ...process.env, PASEO_PLUGIN_REGISTRY: options.pluginRegistryUrl }
: process.env,
},
);
const ready = Promise.withResolvers<{ port: number; serverId: string }>();
let output = "";
@@ -91,10 +91,13 @@ async function selectWorkspaceTab(tab: Locator): Promise<void> {
export async function ensureExplorerSidebar(page: Page): Promise<Locator> {
const toggle = page.getByTestId("workspace-explorer-toggle").first();
await expect(toggle).toBeVisible({ timeout: 30_000 });
const explorer = explorerSidebar(page);
if ((await explorer.count()) === 0) {
// Decide from the toggle, which reports the open state. The sidebar's own visibility lags it:
// a compact layout draws its closed Explorer for a frame before hiding it.
if ((await toggle.getAttribute("aria-expanded")) !== "true") {
await toggle.click();
}
await expect(toggle).toHaveAttribute("aria-expanded", "true");
const explorer = explorerSidebar(page);
await expect(explorer).toBeVisible({ timeout: 30_000 });
return explorer;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.16.0-beta.2",
"version": "0.16.1",
"private": true,
"main": "index.ts",
"scripts": {
@@ -394,6 +394,56 @@ describe("bottom anchor controller driver", () => {
expect(harness.scrollAttempts).toHaveLength(0);
});
it("honors a submit made during a gesture when that gesture ends away", () => {
const harness = createDriverHarness({ isNearBottom: false });
harness.driver.beginUserScroll();
harness.driver.requestLocalAnchor({ agentId: "agent-1", reason: "message-sent" });
harness.scheduler.flushAll();
expect(harness.scrollAttempts).toEqual([]);
harness.driver.endUserScroll({ isAtEnd: false });
harness.scheduler.flushAll();
expect(harness.context.measurementState.offsetY).toBe(
harness.context.measurementState.contentHeight -
harness.context.measurementState.viewportHeight,
);
expect(harness.driver.getSnapshot()).toMatchObject({
mode: "sticky-bottom",
pendingRequest: null,
});
});
it.each(["rewind", "jump-to-bottom"] as const)(
"lets scrolling away supersede a late %s request",
(reason) => {
const harness = createDriverHarness({ isNearBottom: false });
harness.driver.beginUserScroll();
harness.driver.requestLocalAnchor({ agentId: "agent-1", reason });
harness.driver.endUserScroll({ isAtEnd: false });
harness.scheduler.flushAll();
expect(harness.scrollAttempts).toEqual([]);
expect(harness.driver.getSnapshot()).toMatchObject({
mode: "detached",
pendingRequest: null,
});
},
);
it("lets a new gesture supersede a submit requested during the previous gesture", () => {
const harness = createDriverHarness({ isNearBottom: false });
harness.driver.beginUserScroll();
harness.driver.requestLocalAnchor({ agentId: "agent-1", reason: "message-sent" });
harness.driver.endUserScroll({ isAtEnd: false });
harness.driver.beginUserScroll();
harness.driver.endUserScroll({ isAtEnd: false });
harness.scheduler.flushAll();
expect(harness.scrollAttempts).toEqual([]);
expect(harness.driver.getSnapshot()).toMatchObject({ mode: "detached", pendingRequest: null });
});
it("resumes following when a user scroll ends at the end", () => {
const harness = createDriverHarness({
transportBehavior: {
@@ -499,11 +499,16 @@ function createBottomAnchorControllerDriver(
cancelPendingAttempt();
setModeInternal("detached");
},
// Following resumes only for a gesture that ends at the end. Resuming from short of it would
// scroll the rows the finger just let go of, so a release above the end, or with output that
// arrived below it during the gesture, stays detached with the pill.
// A gesture ending short stays detached unless a newer prompt submission requested the end.
// Passive output must not move the rows the finger just let go of.
endUserScroll(params) {
isUserScrollActive = false;
// Submit arrives with the user's action; rewind and tail jumps can arrive after a fetch.
// A newer gesture would have detached again, so only a still-sticky submit owns release.
if (pendingRequest?.reason === "message-sent" && mode === "sticky-bottom") {
evaluate(false, "user_scroll_end");
return;
}
if (params.isAtEnd) {
if (mode === "detached") {
setModeInternal("sticky-bottom");
@@ -4,6 +4,7 @@ import { within } from "@testing-library/dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { i18n as testI18n } from "@/i18n/i18next";
import { ToolCallDetailsContent } from "@/components/tool-call-details";
import { ExpandableBadge } from "@/components/message";
import { page, userEvent } from "vitest/browser";
import { PlanCard } from "@/components/plan-card";
@@ -202,3 +203,87 @@ describe("tool badge file action", () => {
expect(view().queryByText("File contents")).toBeNull();
});
});
const longDetail = {
type: "unknown" as const,
input: { text: "input\n".repeat(80) },
output: { text: "output\n".repeat(80) },
};
describe("inline tool detail height", () => {
it("caps the complete detail, including input, output and error, to its allowance", () => {
act(() =>
root.render(
<QueryClientProvider client={queryClient}>
<ToolCallDetailsContent
detail={longDetail}
errorText={"error\n".repeat(80)}
maxHeight={200}
/>
</QueryClientProvider>,
),
);
expect(container.getBoundingClientRect().height).toBeLessThanOrEqual(200);
expect(container.textContent).toContain("output");
expect(container.textContent).toContain("error");
});
});
const longShellDetail = {
type: "shell" as const,
command: "echo command\n".repeat(80),
output: "output\n".repeat(80),
};
const longEditDetail = {
type: "edit" as const,
filePath: "example.txt",
oldString: "old line\n".repeat(80),
newString: "new line\n".repeat(80),
};
describe("capped tool scrolling", () => {
it.each([longShellDetail, longEditDetail])(
"gives a capped $type detail one vertical scroll owner",
(detail) => {
act(() =>
root.render(
<QueryClientProvider client={queryClient}>
<ToolCallDetailsContent detail={detail} maxHeight={200} />
</QueryClientProvider>,
),
);
const verticalScrollers = Array.from(container.querySelectorAll("*")).filter((node) =>
["auto", "scroll"].includes(getComputedStyle(node).overflowY),
);
expect(verticalScrollers).toHaveLength(1);
expect(container.getBoundingClientRect().height).toBeLessThanOrEqual(200);
},
);
});
function renderCopyOutput() {
return <button type="button">Copy output</button>;
}
describe("tool detail interaction", () => {
it("keeps detail controls in the tab order", async () => {
function Badge() {
const [expanded, setExpanded] = React.useState(true);
const toggle = React.useCallback(() => setExpanded(!expanded), [expanded]);
return (
<ExpandableBadge
label="Probe"
isExpanded={expanded}
onToggle={toggle}
renderDetails={renderCopyOutput}
/>
);
}
act(() => root.render(<Badge />));
const header = view().getByRole("button", { name: "Probe" });
act(() => header.focus());
await userEvent.keyboard("{Tab}");
expect(document.activeElement).toBe(view().getByRole("button", { name: "Copy output" }));
});
});
+4
View File
@@ -883,6 +883,7 @@ const AgentStreamViewComponent = forwardRef<AgentStreamViewHandle, AgentStreamVi
status={call.status}
isLastInSequence={index === group.run.calls.length - 1}
defaultExpanded={false}
maxDetailHeight={GROUPED_TOOL_CALL_DETAIL_MAX_HEIGHT}
standalone={false}
onInlineDetailsExpandedChangeByItemId={setInlineDetailsExpanded}
/>
@@ -1375,6 +1376,7 @@ interface ThoughtSlotProps {
isLastInSequence: boolean;
defaultExpanded: boolean;
standalone?: boolean;
maxDetailHeight?: number;
}
// Reasoning text is paced the same way assistant text is; see @/hooks/use-revealed-text.
@@ -1386,6 +1388,7 @@ function ThoughtSlot({
isLastInSequence,
defaultExpanded,
standalone,
maxDetailHeight,
}: ThoughtSlotProps) {
const revealedText = useRevealedText(text, status === "ready" ? "complete" : "streaming");
return (
@@ -1398,6 +1401,7 @@ function ThoughtSlot({
isLastInSequence={isLastInSequence}
defaultExpanded={defaultExpanded}
standalone={standalone}
maxDetailHeight={maxDetailHeight}
forceInline={defaultExpanded}
/>
);
+2
View File
@@ -931,7 +931,9 @@ function RootStack() {
<Stack.Screen name="h/[serverId]" />
<Stack.Screen name="settings/hosts/[serverId]/index" />
<Stack.Screen name="settings/hosts/[serverId]/[hostSection]" />
<Stack.Screen name="settings/hosts/[serverId]/plugins/[pluginId]/index" />
<Stack.Screen name="settings/hosts/[serverId]/plugins/[pluginId]/[screenId]" />
<Stack.Screen name="settings/hosts/[serverId]/plugin-directory/[owner]/[slug]" />
<Stack.Screen name="settings/hosts/[serverId]/projects/index" />
<Stack.Screen name="settings/hosts/[serverId]/projects/[projectId]" />
</ThemedStack>
@@ -0,0 +1,23 @@
import { useMemo } from "react";
import { useLocalSearchParams } from "expo-router";
import { HostRouteBootstrapBoundary } from "@/components/host-route-bootstrap-boundary";
import SettingsScreen from "@/screens/settings-screen";
/** A plugin directory listing's page, by its `owner/slug` ID. */
export default function PluginListingRoute() {
const { serverId, owner, slug } = useLocalSearchParams<{
serverId: string;
owner: string;
slug: string;
}>();
const view = useMemo(
() => ({ kind: "pluginListing" as const, serverId, listingId: `${owner}/${slug}` }),
[serverId, owner, slug],
);
return (
<HostRouteBootstrapBoundary>
<SettingsScreen view={view} />
</HostRouteBootstrapBoundary>
);
}
@@ -0,0 +1,23 @@
import { useMemo } from "react";
import { useLocalSearchParams } from "expo-router";
import { HostRouteBootstrapBoundary } from "@/components/host-route-bootstrap-boundary";
import SettingsScreen from "@/screens/settings-screen";
/** An installed plugin's page. A settings tab chosen on it arrives as `screenId`. */
export default function PluginPageRoute() {
const { serverId, pluginId, screenId } = useLocalSearchParams<{
serverId: string;
pluginId: string;
screenId?: string;
}>();
const view = useMemo(
() => ({ kind: "plugin" as const, serverId, pluginId, screenId }),
[serverId, pluginId, screenId],
);
return (
<HostRouteBootstrapBoundary>
<SettingsScreen view={view} />
</HostRouteBootstrapBoundary>
);
}
@@ -25,12 +25,13 @@ function source(gitActions: GitActions): {
dispatched: KeyboardActionDefinition[];
copiedPaths: number;
copiedBranchNames: number;
archivedWorkspaces: number;
toggledLabels: Array<{ name: string; assigned: boolean }>;
} {
const runGitActions: GitAction[] = [];
const dispatched: KeyboardActionDefinition[] = [];
const toggledLabels: Array<{ name: string; assigned: boolean }> = [];
const counters = { copiedPaths: 0, copiedBranchNames: 0 };
const counters = { copiedPaths: 0, copiedBranchNames: 0, archivedWorkspaces: 0 };
return {
value: {
gitActions,
@@ -68,6 +69,7 @@ function source(gitActions: GitActions): {
closePane: "Close pane",
toggleFocusMode: "Toggle focus mode",
toggleExplorerSidebar: "Toggle Explorer sidebar",
archiveWorkspace: "Archive workspace",
rename: "Rename workspace",
copyPath: "Copy workspace path",
copyBranchName: "Copy branch name",
@@ -93,6 +95,9 @@ function source(gitActions: GitActions): {
labelCatalog: null,
dispatch: (action) => dispatched.push(action),
runGitAction: (action) => runGitActions.push(action),
archiveWorkspace: () => {
counters.archivedWorkspaces += 1;
},
copyPath: () => {
counters.copiedPaths += 1;
},
@@ -112,10 +117,48 @@ function source(gitActions: GitActions): {
get copiedBranchNames() {
return counters.copiedBranchNames;
},
get archivedWorkspaces() {
return counters.archivedWorkspaces;
},
};
}
describe("workspace command center contributions", () => {
it("offers archive in a non-Git workspace and runs the workspace's archive", () => {
const fixture = source({ primary: null, secondary: [], menu: [] });
const archive = buildWorkspaceCommandCenterContributions(fixture.value).find(
(item) => item.id === "workspace:archive",
);
expect(archive?.visibility).toBe("query");
expect(archive?.presentation).toMatchObject({ title: "Archive workspace" });
archive?.run();
expect(fixture.archivedWorkspaces).toBe(1);
expect(fixture.dispatched).toEqual([]);
});
it("omits archive while the workspace cannot be archived", () => {
const fixture = source({ primary: null, secondary: [], menu: [] });
fixture.value.archiveWorkspace = null;
const contributions = buildWorkspaceCommandCenterContributions(fixture.value);
expect(contributions.some((item) => item.id === "workspace:archive")).toBe(false);
});
it("lists archive once in a Git workspace, through its Git action", () => {
const archive = gitAction("archive-workspace", "Archive workspace");
const fixture = source({ primary: null, secondary: [archive], menu: [] });
fixture.value.capabilities.isGit = true;
const contributions = buildWorkspaceCommandCenterContributions(fixture.value);
expect(
contributions.filter((item) => item.id.includes("archive")).map((item) => item.id),
).toEqual(["git:archive-workspace"]);
});
it("makes only the policy-selected primary Git action default-visible and runs it", () => {
const primary = gitAction("commit", "Commit");
const fixture = source({
@@ -50,6 +50,7 @@ export interface WorkspaceCommandCenterLabels {
toggleFocusMode: string;
toggleExplorerSidebar: string;
// Workspace management actions
archiveWorkspace: string;
rename: string;
copyPath: string;
copyBranchName: string;
@@ -79,6 +80,7 @@ export interface WorkspaceCommandCenterIcons {
focusMode?: CommandCenterIcon;
explorerSidebar?: CommandCenterIcon;
// Workspace management action icons
archiveWorkspace?: CommandCenterIcon;
copyPath?: CommandCenterIcon;
copyBranchName?: CommandCenterIcon;
pin?: CommandCenterIcon;
@@ -131,6 +133,8 @@ export interface WorkspaceCommandCenterSource {
labelCatalog: readonly WorkspaceCommandCenterLabelChoice[] | null;
dispatch(action: KeyboardActionDefinition): void;
runGitAction(action: GitAction): void;
/** Null while the workspace cannot be archived. A Git workspace archives through `gitActions`. */
archiveWorkspace: (() => void) | null;
copyPath(): void;
copyBranchName(): void;
toggleLabel(name: string, assigned: boolean): void | Promise<void>;
@@ -585,6 +589,23 @@ export function buildWorkspaceCommandCenterContributions(
contributions.push(buildGitContribution(source, action, 100 + index, "query"));
}
// A Git workspace lists archive among its Git actions; any other workspace archives here.
if (!source.capabilities.isGit && source.archiveWorkspace) {
contributions.push(
buildWorkspaceCallback({
source,
id: "workspace:archive",
rank: 100,
title: source.labels.archiveWorkspace,
keywords: ["archive", "workspace"],
icon: source.icons.archiveWorkspace,
shortcutKeys: source.shortcuts.archiveWorkspace,
run: source.archiveWorkspace,
visibility: "query",
}),
);
}
if (source.capabilities.canPin) {
contributions.push(
buildWorkspaceAction({
@@ -203,7 +203,7 @@ export function useWorkspaceCommandCenterActions(): void {
supportsSetupObservation,
);
const { overrides } = useKeyboardShortcutOverrides();
const { gitActions, isGit } = useGitActions({
const { gitActions, isGit, archiveWorkspace } = useGitActions({
serverId: serverId ?? "",
cwd: cwd ?? "",
icons: GIT_ACTION_ICONS,
@@ -270,6 +270,7 @@ export function useWorkspaceCommandCenterActions(): void {
toggleFocusMode: t("settings.shortcuts.help.toggleFocusMode"),
toggleExplorerSidebar: t("workspace.tabs.explorerSidebar.toggle"),
// Workspace management labels
archiveWorkspace: t("workspace.git.actions.archive.label"),
rename: t("sidebar.workspace.actions.rename"),
copyPath: t("workspace.header.actions.copyPath"),
copyBranchName: t("workspace.header.actions.copyBranchName"),
@@ -280,6 +281,7 @@ export function useWorkspaceCommandCenterActions(): void {
},
icons: {
...WORKSPACE_COMMAND_CENTER_ICONS,
archiveWorkspace: staticIcon(GIT_ACTION_ICONS.archive),
git: (action) => staticIcon(action.icon),
},
shortcuts: resolveWorkspaceShortcuts(overrides),
@@ -301,12 +303,14 @@ export function useWorkspaceCommandCenterActions(): void {
keyboardActionDispatcher.dispatch(action);
},
runGitAction,
archiveWorkspace,
copyPath,
copyBranchName,
toggleLabel,
}),
[
activeTabIndex,
archiveWorkspace,
activeTabKind,
canPin,
canShowSetup,
@@ -17,6 +17,13 @@ import { isNative } from "@/constants/platform";
* On macOS, Electron handles edge resize natively.
*/
/**
* Marks a scroll viewport as window content: it and its descendants emit no window
* regions, because Electron does not clip app-region rects to scroll viewports.
* See the `[data-window-content]` rule in public/index.html.
*/
export const WINDOW_CONTENT_DATASET = { "window-content": "" };
export const titlebarDragSurfaceStyle: React.CSSProperties = {
cursor: "default",
// @ts-expect-error — WebkitAppRegion is not in CSSProperties
+5 -8
View File
@@ -15,7 +15,6 @@ const ScrollView = isWeb ? RNScrollView : GHScrollView;
interface DiffViewerProps {
diffLines: DiffLine[];
maxHeight?: number;
emptyLabel?: string;
fillAvailableHeight?: boolean;
}
@@ -119,7 +118,6 @@ function DiffSegment({
export function DiffViewer({
diffLines,
maxHeight,
emptyLabel,
fillAvailableHeight = false,
}: DiffViewerProps) {
@@ -133,12 +131,8 @@ export function DiffViewer({
);
const outerScrollStyle = React.useMemo(
() => [
styles.verticalScroll,
maxHeight !== undefined && inlineUnistylesStyle({ maxHeight }),
fillAvailableHeight && styles.fillHeight,
],
[maxHeight, fillAvailableHeight],
() => [styles.verticalScroll, fillAvailableHeight && styles.fillHeight],
[fillAvailableHeight],
);
const linesContainerStyle = React.useMemo(
() => [
@@ -184,6 +178,9 @@ export function DiffViewer({
</ScrollView>
);
// Capped tool details own vertical scrolling outside the diff.
if (!fillAvailableHeight) return horizontalScroll;
const content = (
<ScrollView
style={outerScrollStyle}
@@ -2,31 +2,41 @@ import { describe, expect, it } from "vitest";
import { dragStateInitial, dragStateReducer } from "./drag-reducer";
describe("dragStateReducer", () => {
it("starts tracking the active item with a snapshot of the data", () => {
it("starts tracking the active item with the rows on screen", () => {
const next = dragStateReducer(dragStateInitial<string>(), {
type: "start",
id: "alpha",
data: ["alpha", "beta"],
items: ["alpha", "beta"],
});
expect(next).toEqual({ activeId: "alpha", dragItems: ["alpha", "beta"] });
expect(next).toEqual({ activeId: "alpha", dragItems: ["alpha", "beta"], dropped: null });
});
it("clears the active item and the snapshot", () => {
it("clears the active item and the rows", () => {
const next = dragStateReducer(
{ activeId: "alpha", dragItems: ["alpha", "beta"] },
{ activeId: "alpha", dragItems: ["alpha", "beta"], dropped: null },
{ type: "clear" },
);
expect(next).toEqual({ activeId: null, dragItems: null });
expect(next).toEqual({ activeId: null, dragItems: null, dropped: null });
});
it("holds the dropped order in place of the order it replaces", () => {
const dropped = { order: ["beta", "alpha"], replaces: ["alpha", "beta"] };
const next = dragStateReducer(
{ activeId: "alpha", dragItems: ["alpha", "beta"], dropped: null },
{ type: "drop", dropped },
);
expect(next).toEqual({ activeId: null, dragItems: null, dropped });
});
it("replaces an in-flight drag when a new one starts", () => {
const next = dragStateReducer(
{ activeId: "alpha", dragItems: ["alpha", "beta"] },
{ type: "start", id: "beta", data: ["beta", "gamma"] },
{ activeId: "alpha", dragItems: ["alpha", "beta"], dropped: null },
{ type: "start", id: "beta", items: ["beta", "gamma"] },
);
expect(next).toEqual({ activeId: "beta", dragItems: ["beta", "gamma"] });
expect(next).toEqual({ activeId: "beta", dragItems: ["beta", "gamma"], dropped: null });
});
});
@@ -1,19 +1,33 @@
export interface DragState<T> {
activeId: string | null;
dragItems: T[] | null;
/** A dropped key order, shown in place of the owner's until the owner's order changes. */
export interface DroppedOrder {
order: string[];
/** The owner's key order at the drop. */
replaces: string[];
}
export type DragAction<T> = { type: "start"; id: string; data: T[] } | { type: "clear" };
export interface DragState<T> {
activeId: string | null;
/** The rows on screen while a drag is in flight. */
dragItems: T[] | null;
dropped: DroppedOrder | null;
}
export type DragAction<T> =
| { type: "start"; id: string; items: T[] }
| { type: "drop"; dropped: DroppedOrder }
| { type: "clear" };
export function dragStateInitial<T>(): DragState<T> {
return { activeId: null, dragItems: null };
return { activeId: null, dragItems: null, dropped: null };
}
export function dragStateReducer<T>(state: DragState<T>, action: DragAction<T>): DragState<T> {
switch (action.type) {
case "start":
return { activeId: action.id, dragItems: action.data };
return { activeId: action.id, dragItems: action.items, dropped: null };
case "drop":
return { activeId: null, dragItems: null, dropped: action.dropped };
case "clear":
return { activeId: null, dragItems: null };
return dragStateInitial();
}
}
@@ -1,6 +1,6 @@
import { useCallback, useReducer } from "react";
import { useCallback, useMemo, useReducer } from "react";
import type { DragEndEvent, DragStartEvent } from "@dnd-kit/core";
import { dragStateInitial, dragStateReducer } from "./drag-reducer";
import { dragStateInitial, dragStateReducer, type DroppedOrder } from "./drag-reducer";
import { reorderItemsOnDragEnd } from "./reorder-items";
export interface DragReorderHandlers {
@@ -15,6 +15,28 @@ export interface DragReorderState<T> {
handlers: DragReorderHandlers;
}
/**
* The owner's rows in the dropped order, or null once the owner's own order has changed since
* the drop.
*/
function arrangeAsDropped<T>(
data: T[],
keys: string[],
{ order, replaces }: DroppedOrder,
): T[] | null {
const ownerOrderUnchanged =
keys.length === replaces.length && keys.every((key, index) => key === replaces[index]);
if (!ownerOrderUnchanged) return null;
const indexByKey = new Map(keys.map((key, index) => [key, index]));
const arranged: T[] = [];
for (const key of order) {
const index = indexByKey.get(key);
if (index !== undefined) arranged.push(data[index]);
}
return arranged.length === data.length ? arranged : null;
}
export function useDragReorderState<T>({
data,
keyExtractor,
@@ -30,13 +52,22 @@ export function useDragReorderState<T>({
}): DragReorderState<T> {
const [state, dispatch] = useReducer(dragStateReducer<T>, undefined, dragStateInitial<T>);
const keys = useMemo(() => data.map(keyExtractor), [data, keyExtractor]);
const held = useMemo(
() => (state.dropped ? arrangeAsDropped(data, keys, state.dropped) : null),
[data, keys, state.dropped],
);
// The owner's order changed, so the dropped order has nothing left to stand in for.
if (state.dropped && !held) dispatch({ type: "clear" });
const items = state.dragItems ?? held ?? data;
const handleDragStart = useCallback(
(event: DragStartEvent) => {
if (disabled) return;
dispatch({ type: "start", id: String(event.active.id), data });
dispatch({ type: "start", id: String(event.active.id), items });
onDragBegin?.();
},
[data, disabled, onDragBegin],
[disabled, items, onDragBegin],
);
const clearDragState = useCallback(() => {
@@ -46,25 +77,29 @@ export function useDragReorderState<T>({
const handleDragEnd = useCallback(
(event: DragEndEvent) => {
const { active, over } = event;
const items = state.dragItems ?? data;
dispatch({ type: "clear" });
if (disabled) return;
const activeId = String(active.id);
const reordered = reorderItemsOnDragEnd({
items,
activeId,
overId: over ? String(over.id) : null,
keyExtractor,
});
if (reordered) onDragEnd?.(reordered, activeId);
const reordered = disabled
? null
: reorderItemsOnDragEnd({
items,
activeId,
overId: over ? String(over.id) : null,
keyExtractor,
});
if (!reordered) {
dispatch({ type: "clear" });
return;
}
// The owner's new order can arrive in a later render. Hold the dropped order until it does.
dispatch({ type: "drop", dropped: { order: reordered.map(keyExtractor), replaces: keys } });
onDragEnd?.(reordered, activeId);
},
[data, disabled, keyExtractor, onDragEnd, state.dragItems],
[disabled, items, keyExtractor, keys, onDragEnd],
);
return {
activeId: state.activeId,
items: state.dragItems ?? data,
items,
handlers: {
onDragStart: handleDragStart,
onDragCancel: clearDragState,
@@ -36,7 +36,10 @@ export interface DraggableListProps<T> {
data: T[];
keyExtractor: (item: T, index: number) => string;
renderItem: (info: DraggableRenderItemInfo<T>) => ReactElement;
/** The new order, and the key of the item the user moved to reach it. */
/**
* The new order, and the key of the item the user moved to reach it. The list keeps showing
* this order until `data` arrives in a different order, so the owner must apply it.
*/
onDragEnd: (data: T[], movedKey: string) => void;
style?: StyleProp<ViewStyle>;
/** Outer container style (useful for nested, non-scrolling lists). */
@@ -1,4 +1,4 @@
import React, { act } from "react";
import React, { act, useCallback, useState } from "react";
import { createRoot, type Root } from "react-dom/client";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
@@ -11,6 +11,7 @@ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });
interface Item {
id: string;
label?: string;
}
function keyExtractor(item: Item): string {
@@ -41,7 +42,7 @@ function renderRowWithHandle(info: DraggableRenderItemInfo<Item>) {
<DraggableListHandle accessibilityLabel={`Move ${info.item.id}`} testID="row-handle">
<span>grip</span>
</DraggableListHandle>
<span data-testid="row-body">{info.item.id}</span>
<span data-testid="row-body">{info.item.label ?? info.item.id}</span>
</div>
);
}
@@ -87,6 +88,87 @@ function pressAndMove(element: HTMLElement, distance: number) {
});
}
const OWNER_DELAY_MS = 50;
function wait(ms: number): Promise<void> {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
/**
* An owner that relabels its rows as soon as one is dropped, and whose new order reaches the list
* in a later render, like one that saves to a store.
*/
function ListWithLateOwner() {
const [items, setItems] = useState<Item[]>([{ id: "one" }, { id: "two" }]);
const relabelThenReorderLater = useCallback((next: Item[]) => {
const relabel = (item: Item): Item => ({ id: item.id, label: `${item.id} dropped` });
setItems((current) => current.map(relabel));
setTimeout(() => setItems(next.map(relabel)), OWNER_DELAY_MS);
}, []);
return (
<DraggableList
data={items}
keyExtractor={keyExtractor}
renderItem={renderRowWithHandle}
onDragEnd={relabelThenReorderLater}
useDragHandle
/>
);
}
function rowOrder(): (string | null)[] {
return Array.from(container?.querySelectorAll('[data-testid="row-body"]') ?? []).map(
(row) => row.textContent,
);
}
/** Drag the element down by `distance` in two mouse moves, letting dnd-kit measure in between. */
async function dragDown(element: HTMLElement, distance: number) {
const { left, top, width, height } = element.getBoundingClientRect();
const x = left + width / 2;
const y = top + height / 2;
await act(async () => {
element.dispatchEvent(
new MouseEvent("mousedown", { bubbles: true, button: 0, clientX: x, clientY: y }),
);
});
for (const moved of [distance / 2, distance]) {
await act(async () => {
document.dispatchEvent(
new MouseEvent("mousemove", { bubbles: true, clientX: x, clientY: y + moved }),
);
await wait(20);
});
}
act(() => {
document.dispatchEvent(new MouseEvent("mouseup", { bubbles: true }));
});
}
describe("DraggableList on web", () => {
it("shows the owner's current rows in the dropped order until its new order arrives", async () => {
act(() => {
root?.render(<ListWithLateOwner />);
});
const [firstHandle] = Array.from(
container?.querySelectorAll<HTMLElement>('[data-testid="row-handle"]') ?? [],
);
const [firstRow, secondRow] = Array.from(
container?.querySelectorAll<HTMLElement>('[data-testid="row-body"]') ?? [],
);
const rowDistance =
secondRow.getBoundingClientRect().top - firstRow.getBoundingClientRect().top;
await dragDown(firstHandle, rowDistance);
expect(rowOrder()).toEqual(["two dropped", "one dropped"]);
await act(() => wait(OWNER_DELAY_MS * 2));
expect(rowOrder()).toEqual(["two dropped", "one dropped"]);
});
});
describe("DraggableListHandle on web", () => {
it("starts the row's drag from the handle, and only from the handle", () => {
const onDragBegin = vi.fn();
+89 -43
View File
@@ -9,7 +9,16 @@ import {
type LucideIcon,
} from "lucide-react-native";
import { useTranslation } from "react-i18next";
import { memo, useCallback, useEffect, useMemo, useRef, useState, type RefObject } from "react";
import {
memo,
useCallback,
useEffect,
useMemo,
useRef,
useState,
type ReactNode,
type RefObject,
} from "react";
import {
Pressable,
ScrollView,
@@ -19,12 +28,19 @@ import {
View,
type LayoutChangeEvent,
} from "react-native";
import { Gesture, ScrollView as GHScrollView } from "react-native-gesture-handler";
import {
Gesture,
type GestureType,
ScrollView as GHScrollView,
} from "react-native-gesture-handler";
import Animated, { runOnJS, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
import { scheduleOnRN } from "react-native-worklets";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { StyleSheet, useUnistyles } from "react-native-unistyles";
import { TitlebarDragRegion } from "@/components/desktop/titlebar-drag-region";
import {
TitlebarDragRegion,
WINDOW_CONTENT_DATASET,
} from "@/components/desktop/titlebar-drag-region";
import { SidebarCloseButton } from "@/components/headers/sidebar-close-button";
import {
resolveDesktopSidebarInsetLeft,
@@ -39,7 +55,7 @@ import { HostPicker } from "@/components/hosts/host-picker";
import { SidebarDisplayPreferencesMenu } from "@/components/sidebar/display-preferences/menu";
import { SidebarSeparator } from "@/components/sidebar/sidebar-separator";
import { SidebarToastRegion } from "@/components/sidebar/sidebar-toast-region";
import { SidebarNavRows } from "@/components/sidebar/sidebar-nav-rows";
import { SidebarNavRows, useVisibleSidebarNavItems } from "@/components/sidebar/sidebar-nav-rows";
import { SidebarFooterIconHighlight } from "@/components/sidebar/sidebar-footer-icon-highlight";
import { SidebarHelpMenu } from "@/components/sidebar/sidebar-help-menu";
import { SidebarFooterOverflowMenu } from "@/components/sidebar/sidebar-footer-overflow-menu";
@@ -622,29 +638,7 @@ function MobileSidebar({
>
<View style={styles.sidebarContent} pointerEvents="auto">
<WindowChromeSafeArea placement="below" />
{platformIsNative ? (
<GHScrollView
// Same contract as the workspace list: vertical drags scroll the nav
// block, a clear horizontal intent still activates the close pan.
simultaneousHandlers={closeGestureRef}
style={styles.mobileNavScroll}
showsVerticalScrollIndicator={false}
alwaysBounceVertical={false}
testID="sidebar-nav-scroll"
>
{navRows}
</GHScrollView>
) : (
<ScrollView
style={styles.mobileNavScroll}
showsVerticalScrollIndicator={false}
alwaysBounceVertical={false}
testID="sidebar-nav-scroll"
>
{navRows}
</ScrollView>
)}
<SidebarSeparator />
<SidebarNavScroll closeGestureRef={closeGestureRef}>{navRows}</SidebarNavScroll>
<SidebarViewSlot dismiss={handleWorkspacePress}>
<SidebarToastRegion active={active}>
@@ -689,6 +683,47 @@ function MobileSidebar({
);
}
interface SidebarNavScrollProps {
closeGestureRef: RefObject<GestureType | undefined>;
/** Web only: the viewport emits no window regions (see WINDOW_CONTENT_DATASET). */
windowContent?: boolean;
children: ReactNode;
}
// The capped, scrolling nav block shared by the mobile and desktop sidebars, with the
// divider below it. The divider is a sibling because Unistyles does not patch the
// gesture-handler ScrollView.
function SidebarNavScroll({ closeGestureRef, windowContent, children }: SidebarNavScrollProps) {
return (
<>
{platformIsNative ? (
<GHScrollView
// Same contract as the workspace list: vertical drags scroll the nav
// block, a clear horizontal intent still activates the close pan.
simultaneousHandlers={closeGestureRef}
style={styles.navScroll}
showsVerticalScrollIndicator={false}
alwaysBounceVertical={false}
testID="sidebar-nav-scroll"
>
{children}
</GHScrollView>
) : (
<ScrollView
dataSet={windowContent ? WINDOW_CONTENT_DATASET : undefined}
style={styles.navScroll}
showsVerticalScrollIndicator={false}
alwaysBounceVertical={false}
testID="sidebar-nav-scroll"
>
{children}
</ScrollView>
)}
<SidebarSeparator testID="sidebar-nav-separator" />
</>
);
}
function DesktopSidebar({
theme,
workspaceGroups,
@@ -809,12 +844,14 @@ function DesktopSidebar({
],
[insetsTop, insets.bottom, insets.left, overlay, divisionLayout],
);
// Below the window controls' row, or in the top band's place, the first row starts flush.
const inTopBand = useTopBand() !== null;
const sidebarHeaderGroupStyle = useMemo(
() => [styles.sidebarHeaderGroup, (ownsTopLeft || inTopBand) && styles.sidebarHeaderGroupFlush],
[ownsTopLeft, inTopBand],
);
// Windows and Linux draw their window controls top-right, so the sidebar has no chrome
// row there. The strip above the scrolling rows is then its window drag surface.
const showsChromeRow = ownsTopLeft || Boolean(DEV_BUILD_LABEL);
// With every top item hidden the sidebar starts at the Workspaces section, as before the
// nav scroller existed: no strip above it and no divider below it.
const hasNavRows = useVisibleSidebarNavItems().length > 0;
const showsDragStrip = hasNavRows && !showsChromeRow && !inTopBand;
return (
<MobilePanelOverlay
panel="agent-list"
@@ -825,7 +862,7 @@ function DesktopSidebar({
<Animated.View style={desktopSidebarStyle}>
<View style={desktopSidebarBorderStyle}>
<View style={styles.sidebarDragArea}>
{ownsTopLeft || DEV_BUILD_LABEL ? (
{showsChromeRow ? (
<View style={styles.desktopChromeRow}>
<TitlebarDragRegion />
{DEV_BUILD_LABEL ? (
@@ -842,11 +879,21 @@ function DesktopSidebar({
</View>
) : null}
</View>
) : (
<TitlebarDragRegion />
)}
<SidebarNavRows style={sidebarHeaderGroupStyle} onBeforeNavigate={closeSidebar} />
) : null}
{showsDragStrip ? (
<View style={styles.desktopDragStrip} testID="sidebar-nav-drag-strip">
<TitlebarDragRegion />
</View>
) : null}
</View>
{/* The drag overlay stays above this viewport: Electron does not clip
app-region rects to scroll viewports, so a scrolled-out row would
still claim its no-drag rect. */}
{hasNavRows ? (
<SidebarNavScroll closeGestureRef={closeGestureRef} windowContent>
<SidebarNavRows style={styles.sidebarHeaderGroup} onBeforeNavigate={closeSidebar} />
</SidebarNavScroll>
) : null}
<SidebarViewSlot dismiss={closeSidebar}>
<SidebarToastRegion active={active}>
@@ -935,19 +982,18 @@ const staticStyles = RNStyleSheet.create({
});
const styles = StyleSheet.create((theme) => ({
// The rows start flush: the chrome row, drag strip, or top band above them gives the inset.
sidebarHeaderGroup: {
paddingTop: theme.spacing[2],
gap: 2,
paddingBottom: theme.spacing[1.5],
borderBottomWidth: 1,
borderBottomColor: theme.colors.border,
},
sidebarHeaderGroupFlush: {
paddingTop: 0,
desktopDragStrip: {
position: "relative",
height: theme.spacing[2],
},
// The nav block caps at half the sidebar; a long item list scrolls inside the
// cap instead of crowding the workspace list off a short screen.
mobileNavScroll: {
navScroll: {
flexGrow: 0,
flexShrink: 1,
maxHeight: "50%",
@@ -38,18 +38,23 @@ export interface MarkdownImageContext {
export function useMarkdownSource(
text: string,
context: MarkdownImageContext,
links: { commandNames?: ReadonlySet<string>; forgeReferencePattern?: string } = {},
links: {
commandNames?: ReadonlySet<string>;
forgeReferencePattern?: string;
external?: boolean;
} = {},
) {
const occurrenceKey = useId();
const { commandNames, forgeReferencePattern } = links;
const { commandNames, forgeReferencePattern, external } = links;
const prepared = useMemo(
() =>
prepareMarkdownSource(text, context.workspaceRoot, {
supportsSvg: isWeb,
commandNames,
forgeReferencePattern,
external,
}),
[text, context.workspaceRoot, commandNames, forgeReferencePattern],
[text, context.workspaceRoot, commandNames, forgeReferencePattern, external],
);
const sources = [...new Set(prepared.images.map((image) => image.source))];
const acquisitions = sources.map((source) => {
@@ -562,6 +562,34 @@ describe("bare URL sentence punctuation", () => {
expect(tree.children?.[0]?.children?.[0]?.attributes?.url).toBe("https://example.com/a.");
},
);
it.each([
["https://a.com、https://b.com!", ["https://a.com", "、", "https://b.com", "!"]],
["https://a.com(说明)以及", ["https://a.com", "(说明)以及"]],
["看这里:https://example.com/foo,还有", ["看这里:", "https://example.com/foo", ",还有"]],
["(https://example.com/a)", ["(", "https://example.com/a", ")"]],
["见【https://example.com/a】。", ["见【", "https://example.com/a", "】。"]],
["“https://example.com/a”…", ["“", "https://example.com/a", "”…"]],
[
"见https://zh.wikipedia.org/wiki/人工智能。",
["见", "https://zh.wikipedia.org/wiki/人工智能", "。"],
],
])("ends a bare URL at CJK and typographic punctuation: %s", async (source, expected) => {
const prepared = prepareMarkdownSource(source);
const tree = recognizeTextLinks(
await parseMarkdown(prepared.render(), { latexMath: false }),
prepared.linkRecognition.text,
prepared.linkRecognition.inlineCode,
);
const parts = (tree.children?.[0]?.children ?? []).map((node) =>
node.type === "Link" ? String(node.attributes?.url) : String(node.content),
);
expect(parts).toEqual(expected);
expect(toNativeLinkRecognition(prepared.linkRecognition).text).toMatchObject({
isDisabled: false,
isDefault: false,
});
});
});
it("requires workspace context for relative inline paths and escapes literal regex characters", () => {
@@ -1096,3 +1124,30 @@ it.each([false, true])(
expect(markdownStyle.codeBlock?.fontSize).toBe(theme.fontSize.code);
},
);
describe("external Markdown", () => {
const external = (source: string) => prepareMarkdownSource(source, undefined, { external: true });
it("recognizes no files, forge references or commands, only https URLs", () => {
const { linkRecognition } = external("Needs Node.js 22 and `~/.dsh/.env`, see #12");
expect("Needs Node.js 22, see #12".match(linkRecognition.text)).toBeNull();
expect(linkRecognition.inlineCode.test("~/.dsh/.env")).toBe(false);
expect("Docs at https://example.com/a.".match(linkRecognition.text)).toEqual([
"https://example.com/a",
]);
});
it("keeps https links and leaves any other destination as its label", () => {
expect(
external(
"[Guide](docs/guide.md), [site](https://example.com), [mail](mailto:a@b.c), [ref][r]\n\n[r]: ./x",
).render(),
).toBe("Guide, [site](https://example.com), mail, ref\n\n[r]: ./x");
});
it("shows a relative image as its alt text", () => {
expect(external("![Demo](media/demo.png) ![Shot](https://x/a.png)").render()).toBe(
"Demo ![Shot](https://x/a.png)",
);
});
});
@@ -8,6 +8,7 @@ import {
import { useStableEvent } from "@/hooks/use-stable-event";
import { matchCommandLink, useAgentCommandHints, type CommandHints } from "@/agent-commands";
import { useForgeShorthand } from "@/git/forge-shorthand";
import { pluginOverviewUrl } from "@getpaseo/protocol/plugin-overview";
import { openExternalUrl } from "@/utils/open-external-url";
import { AttachmentLightbox, type ImageLightboxSource } from "@/components/attachment-lightbox";
import type { Theme } from "@/styles/theme";
@@ -24,6 +25,8 @@ import { MermaidFence, MermaidStreamingContext, splitMermaidFences } from "./fen
const ThemedMarkdown = withUnistyles(EnrichedMarkdownText);
const MD4C_FLAGS = { latexMath: false, hardSoftBreaks: true, admonitions: true };
// A README is written for its forge, where the lines of a paragraph join into one.
const EXTERNAL_MD4C_FLAGS = { ...MD4C_FLAGS, hardSoftBreaks: false };
// Reading the breakpoint here makes Unistyles restyle the text when the layout crosses it.
const markdownStyle =
@@ -52,6 +55,12 @@ export interface MarkdownRendererProps extends MarkdownImageContext {
streaming?: boolean;
onLinkPress?: (url: string) => unknown;
agentCommands?: boolean;
/**
* Author-controlled Markdown from outside this host, such as a plugin README: only its https
* links and images work, nothing is read as a file, forge reference or command, and the lines of
* a paragraph join as they do on its forge.
*/
external?: boolean;
}
/** All Markdown surfaces share the same engine and source adaptation. */
@@ -86,12 +95,14 @@ const MarkdownPart = memo(function MarkdownPart({
streaming = false,
onLinkPress,
agentCommands: _agentCommands,
external = false,
commandHints = null,
...imageContext
}: MarkdownRendererProps & { commandHints?: CommandHints | null }) {
const environment = useAssistantFileLinkEnvironment();
const actions = useAssistantFileLinkActions();
const forgeShorthand = useForgeShorthand();
const workspaceForgeShorthand = useForgeShorthand();
const forgeShorthand = external ? null : workspaceForgeShorthand;
const client =
imageContext.client ??
(environment.client?.readFile
@@ -105,10 +116,20 @@ const MarkdownPart = memo(function MarkdownPart({
...imageContext,
client,
},
{ commandNames: commandHints?.names, forgeReferencePattern: forgeShorthand?.pattern },
{
commandNames: commandHints?.names,
forgeReferencePattern: forgeShorthand?.pattern,
external,
},
);
const [image, setImage] = useState<ImageLightboxSource | null>(null);
const pressLink = useStableEvent(({ url, sourceType }: LinkPressEvent) => {
if (external) {
// The parser still autolinks bare http, www and email text; only https links open.
const safe = pluginOverviewUrl(url);
if (safe) void openExternalUrl(safe);
return;
}
const command = commandHints && matchCommandLink(url, sourceType, commandHints.names);
if (command) {
commandHints.insert(command);
@@ -145,7 +166,7 @@ const MarkdownPart = memo(function MarkdownPart({
uniProps={pickMarkdownStyle(compact, muted)}
flavor="github"
selectable={selectable}
md4cFlags={MD4C_FLAGS}
md4cFlags={external ? EXTERNAL_MD4C_FLAGS : MD4C_FLAGS}
linkRecognition={linkRecognition}
enableTaskListItemToggle={false}
enableLinkPreview={false}
+47 -10
View File
@@ -1,3 +1,4 @@
import { pluginOverviewUrl } from "@getpaseo/protocol/plugin-overview";
import { classifyAssistantFileLink } from "@/assistant-file-links";
import { ASSISTANT_FILE_EXTENSIONS } from "@/assistant-file-links/extensions";
import { normalizeMarkdownHtml } from "./html";
@@ -36,9 +37,12 @@ function createTextPattern(path: string, forgeReferencePattern?: string): RegExp
// Matches bare URLs that MD4C does not autolink, like single-label or bracketed hosts.
// Quotes and unbalanced closing parentheses end the URL. Trailing sentence punctuation stays outside.
const URL_CHARACTER = String.raw`[^\s<>()"'\x60]`;
// CJK, fullwidth and typographic punctuation (、。,()【】「」“”…) also ends it; CJK letters do not.
const URL_BOUNDARY =
"\\u2018\\u2019\\u201C\\u201D\\u2026\\u3000-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\uFF01-\\uFF0F\\uFF1A-\\uFF20\\uFF3B-\\uFF40\\uFF5B-\\uFF65";
const URL_CHARACTER = String.raw`[^\s<>()"'\x60${URL_BOUNDARY}]`;
const URL_GROUP = String.raw`\(${URL_CHARACTER}*\)`;
const BARE_URL = String.raw`https?://(?:${URL_CHARACTER}|${URL_GROUP})*(?:[^\s<>()"'\x60.,;:!?]|${URL_GROUP})`;
const BARE_URL = String.raw`https?://(?:${URL_CHARACTER}|${URL_GROUP})*(?:[^\s<>()"'\x60.,;:!?${URL_BOUNDARY}]|${URL_GROUP})`;
const TEXT_PATTERN = createTextPattern(PROSE_PATH);
// One entry per distinct workspace forge remote; reuse keeps the engine's regex identity stable.
@@ -53,6 +57,12 @@ function textPattern(forgeReferencePattern?: string): RegExp {
return pattern;
}
// External Markdown links only what its author wrote as an https URL.
const EXTERNAL_LINKS = {
text: new RegExp(BARE_URL.replace("https?", "https"), "g"),
inlineCode: /^https:\/\/[^\s<>]+$/,
};
function linkMetadata(inlineCodePaths: ReadonlySet<string>, forgeReferencePattern?: string) {
// The engine accepts regexes on both platforms. Classify complete code spans
// first, then pass literal matches rather than maintaining a second path grammar.
@@ -139,6 +149,12 @@ export function prepareMarkdownSource(
commandNames?: ReadonlySet<string>;
/** Regex source for forge references such as `#12`; see `@/git/forge-shorthand`. */
forgeReferencePattern?: string;
/**
* Author-controlled Markdown from outside this host, such as a plugin README. It follows the
* registry's overview contract: only absolute https links and images, and nothing is
* recognized as a file, forge reference or command.
*/
external?: boolean;
} = {},
) {
source = normalizeMarkdownHtml(source);
@@ -149,10 +165,13 @@ export function prepareMarkdownSource(
extensions: [gfmTable()],
mdastExtensions: [gfmTableFromMarkdown()],
}));
const metadata = linkMetadata(
collectInlineCodePaths(source, workspaceRoot, options.commandNames),
options.forgeReferencePattern,
);
const external = options.external === true;
const metadata = external
? { linkRecognition: EXTERNAL_LINKS, linkSource: markdownLinkSource }
: linkMetadata(
collectInlineCodePaths(source, workspaceRoot, options.commandNames),
options.forgeReferencePattern,
);
const edits: { start: number; end: number; text: string }[] = [];
if (
!source.includes("![") &&
@@ -162,7 +181,8 @@ export function prepareMarkdownSource(
!/^[\t >]*[^\t >\r\n][^\r\n]*(?:\r\n|\r|\n)[^\r\n]+(?:\r\n|\r|\n)(?=[\t >:|-]*\|)[\t >|]*:?-[-\t :|]*$/m.test(
source,
) &&
!(workspaceRoot && source.includes("]("))
!(workspaceRoot && source.includes("](")) &&
!(external && /\]|<[a-z]+:/i.test(source))
) {
return { images, ...metadata, render: () => source };
}
@@ -181,9 +201,10 @@ export function prepareMarkdownSource(
) {
const target = node.type === "image" ? node : definitions.get(node.identifier);
if (
target &&
options.supportsSvg === false &&
/(?:\.svg(?:[?#]|$)|^data:image\/svg\+xml)/i.test(target.url)
(external && !pluginOverviewUrl(target?.url)) ||
(target &&
options.supportsSvg === false &&
/(?:\.svg(?:[?#]|$)|^data:image\/svg\+xml)/i.test(target.url))
) {
edits.push({ start, end, text: escapeMarkdownText(node.alt ?? "") });
return;
@@ -236,6 +257,21 @@ export function prepareMarkdownSource(
if (lineEnd < end) split(lineEnd);
}
}
// An external link to anything but an https URL keeps its label and loses the brackets and
// destination around it, so edits inside the label still apply.
function dropUnsafeDestination(node: Nodes, start: number, end: number) {
if (node.type !== "link" && node.type !== "linkReference") return;
const target = node.type === "link" ? node : definitions.get(node.identifier);
if (pluginOverviewUrl(target?.url)) return;
const labelStart = node.children[0]?.position?.start.offset;
const labelEnd = node.children.at(-1)?.position?.end.offset;
if (labelStart === undefined || labelEnd === undefined) {
edits.push({ start, end, text: "" });
return;
}
edits.push({ start, end: labelStart, text: "" });
edits.push({ start: labelEnd, end, text: "" });
}
function visit(node: Nodes, previous?: Nodes) {
const position = node.position;
if (position?.start.offset !== undefined && position.end.offset !== undefined) {
@@ -255,6 +291,7 @@ export function prepareMarkdownSource(
const boundary = lineStart - newline.length;
edits.push({ start: boundary, end: lineStart, text: `${newline}${blank}${newline}` });
}
if (external) dropUnsafeDestination(node, start, end);
if (node.type === "link") {
const title = workspaceHoverTitle(node, source.slice(start, end), workspaceRoot);
if (title !== null)
+2 -25
View File
@@ -1562,7 +1562,6 @@ interface ExpandableBadgeProps {
style?: StyleProp<ViewStyle>;
onToggle?: () => void;
onOpenFile?: () => void;
onDetailHoverChange?: (hovered: boolean) => void;
renderDetails?: () => ReactNode;
isLoading?: boolean;
isError?: boolean;
@@ -1887,7 +1886,6 @@ export const ExpandableBadge = memo(function ExpandableBadge({
isExpanded,
onToggle,
onOpenFile,
onDetailHoverChange,
renderDetails,
isLoading = false,
isError = false,
@@ -1913,11 +1911,6 @@ export const ExpandableBadge = memo(function ExpandableBadge({
}, []);
const handlePressIn = useCallback(() => setIsPressed(true), []);
const handlePressOut = useCallback(() => setIsPressed(false), []);
const handleDetailHoverIn = useCallback(() => onDetailHoverChange?.(true), [onDetailHoverChange]);
const handleDetailHoverOut = useCallback(
() => onDetailHoverChange?.(false),
[onDetailHoverChange],
);
const handleOpenFilePress = useCallback(
(event: GestureResponderEvent) => {
event.stopPropagation?.();
@@ -2207,14 +2200,9 @@ export const ExpandableBadge = memo(function ExpandableBadge({
) : null}
</View>
{detailContent ? (
<Pressable
ref={detailWrapperRef}
style={detailWrapperStyle}
onHoverIn={handleDetailHoverIn}
onHoverOut={handleDetailHoverOut}
>
<View ref={detailWrapperRef} style={detailWrapperStyle}>
{detailContent}
</Pressable>
</View>
) : null}
</View>
);
@@ -2234,7 +2222,6 @@ function areExpandableBadgePropsEqual(previous: ExpandableBadgeProps, next: Expa
if (previous.testID !== next.testID) return false;
if (previous.onToggle !== next.onToggle) return false;
if (previous.onOpenFile !== next.onOpenFile) return false;
if (previous.onDetailHoverChange !== next.onDetailHoverChange) return false;
if (previous.renderDetails !== next.renderDetails) return false;
return true;
}
@@ -2252,7 +2239,6 @@ interface ToolCallProps {
metadata?: Record<string, unknown>;
isLastInSequence?: boolean;
disableOuterSpacing?: boolean;
onInlineDetailsHoverChange?: (hovered: boolean) => void;
onInlineDetailsExpandedChange?: (expanded: boolean) => void;
onOpenFilePath?: (filePath: string) => void;
defaultExpanded?: boolean;
@@ -2276,7 +2262,6 @@ export const ToolCall = memo(function ToolCall({
metadata,
isLastInSequence = false,
disableOuterSpacing,
onInlineDetailsHoverChange,
onInlineDetailsExpandedChange,
onOpenFilePath,
defaultExpanded,
@@ -2362,13 +2347,6 @@ export const ToolCall = memo(function ToolCall({
presentation.isLoadingDetails,
]);
useEffect(() => {
if (!onInlineDetailsHoverChange || !shouldRenderInline || isExpanded) {
return;
}
onInlineDetailsHoverChange(false);
}, [isExpanded, shouldRenderInline, onInlineDetailsHoverChange]);
useEffect(() => {
if (!onInlineDetailsExpandedChange) {
return;
@@ -2435,7 +2413,6 @@ export const ToolCall = memo(function ToolCall({
isError={status === "failed"}
isLastInSequence={isLastInSequence}
disableOuterSpacing={disableOuterSpacing}
onDetailHoverChange={onInlineDetailsHoverChange}
/>
);
}, areToolCallPropsEqual);
@@ -19,6 +19,8 @@ interface PageLayoutProps {
titleTestID?: string;
/** Controls for the whole page: right of the title on desktop, in the back header on compact. */
actions?: ReactNode;
/** `wide` for pages that lay content out in a grid, such as a gallery. Defaults to a reading column. */
width?: "default" | "wide";
children: ReactNode;
}
@@ -33,6 +35,7 @@ export function PageLayout({
testID,
titleTestID,
actions,
width = "default",
children,
}: PageLayoutProps) {
const isCompact = useIsCompactFormFactor();
@@ -54,7 +57,7 @@ export function PageLayout({
contentContainerStyle={scrollContentStyle}
testID={testID}
>
<View style={styles.content}>
<View style={width === "wide" ? styles.contentWide : styles.content}>
{showTitle ? (
<View style={styles.titleRow} testID={titleTestID}>
<Text style={styles.title} testID="page-title">
@@ -85,6 +88,13 @@ const styles = StyleSheet.create((theme) => ({
maxWidth: 720,
alignSelf: "center",
},
contentWide: {
padding: theme.spacing[4],
paddingTop: theme.spacing[6],
width: "100%",
maxWidth: 1080,
alignSelf: "center",
},
titleRow: {
flexDirection: "row",
alignItems: "center",
@@ -35,14 +35,19 @@ interface SidebarNavRowsProps extends SidebarNavRowProps {
firstRowTrailing?: ReactNode;
}
/** The top-level items the user keeps visible, in display order. */
export function useVisibleSidebarNavItems() {
const { items } = useSidebarNavItems("header");
return useMemo(() => items.filter((item) => item.visible), [items]);
}
/**
* Top-level sidebar navigation, ordered and filtered by the user's
* `sidebarNavItems` preference. Renders nothing — not even the bordered group
* wrapper — when every item is hidden and there is no `firstRowTrailing`.
*/
export function SidebarNavRows({ style, onBeforeNavigate, firstRowTrailing }: SidebarNavRowsProps) {
const { items } = useSidebarNavItems("header");
const visibleItems = useMemo(() => items.filter((item) => item.visible), [items]);
const visibleItems = useVisibleSidebarNavItems();
const groupRef = useRef<View | null>(null);
if (visibleItems.length === 0 && !firstRowTrailing) return null;
@@ -5,6 +5,7 @@ import {
ScrollView as RNScrollView,
type StyleProp,
type ViewStyle,
type ScrollViewProps,
} from "react-native";
import { ScrollView as GHScrollView } from "react-native-gesture-handler";
import { StyleSheet } from "react-native-unistyles";
@@ -28,6 +29,25 @@ import { isWeb } from "@/constants/platform";
const ScrollView = isWeb ? RNScrollView : GHScrollView;
// A capped detail scrolls as a whole. Only full-height sheets need section scrollers.
function DetailSectionBody({
fillAvailableHeight,
style,
contentContainerStyle,
children,
...scrollProps
}: ScrollViewProps & { fillAvailableHeight: boolean }) {
const bodyStyle = useMemo(() => [style, contentContainerStyle], [style, contentContainerStyle]);
if (fillAvailableHeight) {
return (
<ScrollView {...scrollProps} style={style} contentContainerStyle={contentContainerStyle}>
{children}
</ScrollView>
);
}
return <View style={bodyStyle}>{children}</View>;
}
// ---- Content Component ----
interface ToolCallDetailsContentProps {
@@ -40,6 +60,7 @@ interface ToolCallDetailsContentProps {
}
interface DetailStyles {
fillAvailableHeight: boolean;
sectionFillStyle: StyleProp<ViewStyle>;
codeBlockFillStyle: StyleProp<ViewStyle>;
codeVerticalScrollStyle: StyleProp<ViewStyle>;
@@ -49,7 +70,6 @@ interface DetailStyles {
jsonScrollErrorCombined: StyleProp<ViewStyle>;
fullBleedContainerStyle: StyleProp<ViewStyle>;
loadingContainerStyle: StyleProp<ViewStyle>;
resolvedMaxHeight: number | undefined;
shouldFill: boolean;
isFullBleed: boolean;
}
@@ -69,7 +89,6 @@ function resolveShouldFill(
function useDetailStyles(
detail: ToolCallDetail | undefined,
resolvedMaxHeight: number | undefined,
fillAvailableHeight: boolean,
): DetailStyles {
const isFullBleed = resolveIsFullBleed(detail);
@@ -85,28 +104,14 @@ function useDetailStyles(
[codeBlockStyle, shouldFill],
);
const codeVerticalScrollStyle = useMemo(
() => [
styles.codeVerticalScroll,
resolvedMaxHeight !== undefined && inlineUnistylesStyle({ maxHeight: resolvedMaxHeight }),
shouldFill && styles.fillHeight,
],
[resolvedMaxHeight, shouldFill],
() => [styles.codeVerticalScroll, shouldFill && styles.fillHeight],
[shouldFill],
);
const scrollAreaFillStyle = useMemo(
() => [
styles.scrollArea,
resolvedMaxHeight !== undefined && inlineUnistylesStyle({ maxHeight: resolvedMaxHeight }),
shouldFill && styles.fillHeight,
],
[resolvedMaxHeight, shouldFill],
);
const scrollAreaStyle = useMemo(
() => [
styles.scrollArea,
resolvedMaxHeight !== undefined && inlineUnistylesStyle({ maxHeight: resolvedMaxHeight }),
],
[resolvedMaxHeight],
() => [styles.scrollArea, shouldFill && styles.fillHeight],
[shouldFill],
);
const scrollAreaStyle = useMemo(() => [styles.scrollArea], []);
const jsonScrollCombined = styles.jsonScroll;
const jsonScrollErrorCombined = [styles.jsonScroll, styles.jsonScrollError];
const fullBleedContainerStyle = useMemo(
@@ -122,6 +127,7 @@ function useDetailStyles(
);
return {
fillAvailableHeight,
sectionFillStyle,
codeBlockFillStyle,
codeVerticalScrollStyle,
@@ -131,7 +137,6 @@ function useDetailStyles(
jsonScrollErrorCombined,
fullBleedContainerStyle,
loadingContainerStyle,
resolvedMaxHeight,
shouldFill,
isFullBleed,
};
@@ -160,7 +165,8 @@ function ShellDetailSection({ command, output, ds }: ShellDetailProps) {
return (
<View style={ds.sectionFillStyle}>
<View style={ds.codeBlockFillStyle}>
<ScrollView
<DetailSectionBody
fillAvailableHeight={ds.fillAvailableHeight}
style={ds.codeVerticalScrollStyle}
contentContainerStyle={styles.codeVerticalContent}
nestedScrollEnabled
@@ -180,7 +186,7 @@ function ShellDetailSection({ command, output, ds }: ShellDetailProps) {
</Text>
</View>
</ScrollView>
</ScrollView>
</DetailSectionBody>
</View>
</View>
);
@@ -196,11 +202,7 @@ function EditDetailSection({ diffLines, ds }: EditDetailProps) {
<View style={ds.sectionFillStyle}>
{diffLines ? (
<View style={ds.codeBlockFillStyle}>
<DiffViewer
diffLines={diffLines}
maxHeight={ds.resolvedMaxHeight}
fillAvailableHeight={ds.shouldFill}
/>
<DiffViewer diffLines={diffLines} fillAvailableHeight={ds.shouldFill} />
</View>
) : null}
</View>
@@ -228,7 +230,8 @@ function ScrollableTextSection({
[content, filePath],
);
const body = (
<ScrollView
<DetailSectionBody
fillAvailableHeight={ds.fillAvailableHeight}
style={ds.scrollAreaFillStyle}
contentContainerStyle={styles.scrollContent}
nestedScrollEnabled
@@ -243,7 +246,7 @@ function ScrollableTextSection({
</Text>
)}
</ScrollView>
</ScrollView>
</DetailSectionBody>
);
if (!wrapInSectionFill) return body;
return <View style={ds.sectionFillStyle}>{body}</View>;
@@ -258,7 +261,8 @@ interface FetchDetailProps {
function FetchDetailSection({ url, result, ds }: FetchDetailProps) {
return (
<View style={ds.sectionFillStyle}>
<ScrollView
<DetailSectionBody
fillAvailableHeight={ds.fillAvailableHeight}
style={ds.scrollAreaFillStyle}
contentContainerStyle={styles.scrollContent}
nestedScrollEnabled
@@ -269,7 +273,7 @@ function FetchDetailSection({ url, result, ds }: FetchDetailProps) {
{result ? `${url}\n\n${result}` : url}
</Text>
</ScrollView>
</ScrollView>
</DetailSectionBody>
</View>
);
}
@@ -277,7 +281,8 @@ function FetchDetailSection({ url, result, ds }: FetchDetailProps) {
function ScrollablePlainTextSection({ text, ds }: { text: string; ds: DetailStyles }) {
return (
<View style={styles.section}>
<ScrollView
<DetailSectionBody
fillAvailableHeight={ds.fillAvailableHeight}
style={ds.scrollAreaStyle}
contentContainerStyle={styles.scrollContent}
nestedScrollEnabled
@@ -286,7 +291,7 @@ function ScrollablePlainTextSection({ text, ds }: { text: string; ds: DetailStyl
<Text selectable style={styles.plainText}>
{text}
</Text>
</ScrollView>
</DetailSectionBody>
</View>
);
}
@@ -304,7 +309,8 @@ function buildSearchSections(detail: SearchDetail, ds: DetailStyles): ReactNode[
if (detail.content) {
out.push(
<View key="search-content" style={styles.section}>
<ScrollView
<DetailSectionBody
fillAvailableHeight={ds.fillAvailableHeight}
style={ds.scrollAreaStyle}
contentContainerStyle={styles.scrollContent}
nestedScrollEnabled
@@ -315,7 +321,7 @@ function buildSearchSections(detail: SearchDetail, ds: DetailStyles): ReactNode[
{detail.content}
</Text>
</ScrollView>
</ScrollView>
</DetailSectionBody>
</View>,
);
}
@@ -548,7 +554,8 @@ export function ToolCallDetailsContent({
}: ToolCallDetailsContentProps) {
const { t } = useTranslation();
const resolvedMaxHeight = fillAvailableHeight ? undefined : (maxHeight ?? 300);
const ds = useDetailStyles(detail, resolvedMaxHeight, fillAvailableHeight);
// The allowance belongs to the whole disclosure, rather than each section.
const ds = useDetailStyles(detail, fillAvailableHeight);
const diffLines = useDiffLines(detail);
const sections: ReactNode[] = buildDetailSections(toolName, detail, diffLines, ds, t);
@@ -564,6 +571,17 @@ export function ToolCallDetailsContent({
return <Text style={styles.emptyStateText}>{t("toolCallDetails.empty")}</Text>;
}
if (resolvedMaxHeight !== undefined) {
return (
<ScrollView
style={inlineUnistylesStyle({ maxHeight: resolvedMaxHeight })}
contentContainerStyle={ds.fullBleedContainerStyle}
nestedScrollEnabled
>
{sections}
</ScrollView>
);
}
return <View style={ds.fullBleedContainerStyle}>{sections}</View>;
}
@@ -68,24 +68,27 @@ const theme = {
} as unknown as Theme;
describe("control sizing gate", () => {
it("is touch-sized in the compact layout or on a touch screen, and pointer-sized otherwise", () => {
expect(resolveControlSizing({ compactLayout: true, touchScreen: true })).toBe("touch");
expect(resolveControlSizing({ compactLayout: true, touchScreen: false })).toBe("touch");
expect(resolveControlSizing({ compactLayout: false, touchScreen: true })).toBe("touch");
expect(resolveControlSizing({ compactLayout: false, touchScreen: false })).toBe("pointer");
it("is touch-sized in the compact layout or where touch is the primary input, and pointer-sized otherwise", () => {
expect(resolveControlSizing({ compactLayout: true, touchPrimaryPointer: true })).toBe("touch");
expect(resolveControlSizing({ compactLayout: true, touchPrimaryPointer: false })).toBe("touch");
expect(resolveControlSizing({ compactLayout: false, touchPrimaryPointer: true })).toBe("touch");
expect(resolveControlSizing({ compactLayout: false, touchPrimaryPointer: false })).toBe(
"pointer",
);
});
it("gives a touch screen its touch sizes at every width", () => {
it("gives a touch primary pointer its touch sizes at every width", () => {
const sizes = { touch: 44, pointer: 32 };
// An iPad: touch-sized in the docked desktop layout too.
expect(bySizing(sizes, true)).toEqual({ xs: 44, md: 44 });
// A mouse-driven window: touch-sized only once it narrows into the compact layout.
// A mouse- or trackpad-driven window, touch screen or not: touch-sized only once it narrows
// into the compact layout.
expect(bySizing(sizes, false)).toEqual({ xs: 44, md: 32 });
});
it("keeps a device without a touch screen on pointer sizes from md up", () => {
// The unit runtime has no touch screen, which is the desktop that must not change.
it("keeps a device without a touch primary pointer on pointer sizes from md up", () => {
// The unit runtime has no touch primary pointer, which is the desktop that must not change.
expect(controlSizingForLayout(false)).toBe("pointer");
expect(controlSizingForLayout(true)).toBe("touch");
expect(CONTROL_HEIGHTS.md).toEqual({ xs: 44, md: 32 });
@@ -1,4 +1,4 @@
import { hasTouchScreen } from "@/hooks/pointer-capabilities";
import { hasTouchPrimaryPointer } from "@/hooks/pointer-capabilities";
// The sizing gate, apart from the control sizes so that low-level modules such as
// `constants/layout` can size by it without loading the theme. Import it through
@@ -14,28 +14,32 @@ export type ControlSizing = "touch" | "pointer";
export interface ControlSizingFacts {
/** The layout is below the `md` breakpoint. */
compactLayout: boolean;
/** The device has a touch screen; see `hasTouchScreen`. */
touchScreen: boolean;
/** Touch is the device's primary input; see `hasTouchPrimaryPointer`. */
touchPrimaryPointer: boolean;
}
/**
* The one sizing gate: touch-sized in the compact layout or on any device with a touch screen,
* pointer-sized otherwise. A touch screen keeps touch sizing when a mouse or keyboard is attached.
* The one sizing gate: touch-sized in the compact layout or where touch is the primary input,
* pointer-sized otherwise. An iPad keeps touch sizing with a trackpad attached; a laptop with a
* touch screen that its trackpad drives is pointer-sized.
*/
export function resolveControlSizing({
compactLayout,
touchScreen,
touchPrimaryPointer,
}: ControlSizingFacts): ControlSizing {
if (compactLayout || touchScreen) return "touch";
if (compactLayout || touchPrimaryPointer) return "touch";
return "pointer";
}
// Read once, so attaching a mouse or keyboard later never flips the sizing.
const DEVICE_HAS_TOUCH_SCREEN = hasTouchScreen();
const DEVICE_HAS_TOUCH_PRIMARY_POINTER = hasTouchPrimaryPointer();
/** The sizing on this device for a layout, for code that sizes outside a stylesheet. */
export function controlSizingForLayout(compactLayout: boolean): ControlSizing {
return resolveControlSizing({ compactLayout, touchScreen: DEVICE_HAS_TOUCH_SCREEN });
return resolveControlSizing({
compactLayout,
touchPrimaryPointer: DEVICE_HAS_TOUCH_PRIMARY_POINTER,
});
}
/** A Unistyles breakpoint value: one number in the compact layout, another from `md` up. */
@@ -51,11 +55,11 @@ export type SizingValue = Record<ControlSizing, number>;
*/
export function bySizing(
sizes: SizingValue,
touchScreen: boolean = DEVICE_HAS_TOUCH_SCREEN,
touchPrimaryPointer: boolean = DEVICE_HAS_TOUCH_PRIMARY_POINTER,
): LayoutValue {
return {
xs: sizes[resolveControlSizing({ compactLayout: true, touchScreen })],
md: sizes[resolveControlSizing({ compactLayout: false, touchScreen })],
xs: sizes[resolveControlSizing({ compactLayout: true, touchPrimaryPointer })],
md: sizes[resolveControlSizing({ compactLayout: false, touchPrimaryPointer })],
};
}
@@ -126,6 +126,10 @@ export function smallIconButtonChromeFrameSize(compact = false): number {
return ICON_BUTTON_SIZES.small[controlSizingForLayout(compact)];
}
// Icon buttons sit in header and toolbar rows that clip overflow, so the keyboard focus ring
// from public/index.html is drawn inside the frame instead of around it.
const FOCUS_RING_INSET = -2;
const styles = StyleSheet.create((theme) => ({
large: {
width: bySizing(ICON_BUTTON_SIZES.large),
@@ -135,8 +139,7 @@ const styles = StyleSheet.create((theme) => ({
alignItems: "center",
justifyContent: "center",
flexShrink: 0,
outlineWidth: 0,
outlineColor: "transparent",
outlineOffset: FOCUS_RING_INSET,
},
small: {
width: ICON_BUTTON_SIZES.small.pointer,
@@ -146,8 +149,7 @@ const styles = StyleSheet.create((theme) => ({
alignItems: "center",
justifyContent: "center",
flexShrink: 0,
outlineWidth: 0,
outlineColor: "transparent",
outlineOffset: FOCUS_RING_INSET,
},
smallTouch: {
width: ICON_BUTTON_SIZES.small.touch,
@@ -157,8 +159,7 @@ const styles = StyleSheet.create((theme) => ({
alignItems: "center",
justifyContent: "center",
flexShrink: 0,
outlineWidth: 0,
outlineColor: "transparent",
outlineOffset: FOCUS_RING_INSET,
},
round: {
borderRadius: theme.borderRadius.full,
@@ -43,6 +43,7 @@ vi.mock("@gorhom/portal", () => ({
/** Every `waitFor` Gorhom received, in render order. Gorhom rebuilds its content pan per value. */
const sheetWaitFor = vi.hoisted(() => [] as unknown[]);
const sheetSimultaneousHandlers = vi.hoisted(() => [] as unknown[]);
vi.mock("@gorhom/bottom-sheet", async () => {
const { Portal } = await import("@gorhom/portal");
@@ -55,10 +56,17 @@ vi.mock("@gorhom/bottom-sheet", async () => {
children,
stackBehavior,
waitFor,
}: { children?: React.ReactNode; stackBehavior?: string; waitFor?: unknown },
simultaneousHandlers,
}: {
children?: React.ReactNode;
stackBehavior?: string;
waitFor?: unknown;
simultaneousHandlers?: unknown;
},
_ref,
) => {
sheetWaitFor.push(waitFor);
sheetSimultaneousHandlers.push(simultaneousHandlers);
return React.createElement(
Portal,
null,
@@ -259,6 +267,7 @@ describe("IsolatedBottomSheetModal content drag", () => {
document.body.appendChild(container);
root = createRoot(container);
sheetWaitFor.length = 0;
sheetSimultaneousHandlers.length = 0;
});
afterEach(() => {
@@ -275,11 +284,19 @@ describe("IsolatedBottomSheetModal content drag", () => {
return null;
}
function renderSheet(content: React.ReactNode) {
function renderSheet(
content: React.ReactNode,
handlers: Pick<
React.ComponentProps<typeof IsolatedBottomSheetModal>,
"waitFor" | "simultaneousHandlers"
> = {},
) {
act(() => {
root.render(
<>
<IsolatedBottomSheetModal contextBridge={null}>{content}</IsolatedBottomSheetModal>
<IsolatedBottomSheetModal contextBridge={null} {...handlers}>
{content}
</IsolatedBottomSheetModal>
<PortalHostProbe />
</>,
);
@@ -291,9 +308,106 @@ describe("IsolatedBottomSheetModal content drag", () => {
expect(sheetWaitFor.at(-1)).toBeUndefined();
renderSheet(<ContentDrag />);
expect(sheetWaitFor.at(-1)).toBe(dragGesture);
expect(sheetSimultaneousHandlers.at(-1)).toEqual([dragGesture]);
expect(sheetWaitFor.at(-1)).toEqual([dragGesture]);
renderSheet(null);
expect(sheetWaitFor.at(-1)).toBeUndefined();
expect(sheetSimultaneousHandlers.at(-1)).toBeUndefined();
});
it.each([false, true])(
"preserves supplied relations when a content drag mounts and unmounts (array=%s)",
(array) => {
const waiting = React.createRef<React.ComponentType>();
const simultaneous = React.createRef<React.ComponentType>();
const handlers = {
waitFor: array ? [waiting] : waiting,
simultaneousHandlers: array ? [simultaneous] : simultaneous,
};
renderSheet(<ContentDrag />, handlers);
expect(sheetWaitFor.at(-1)).toEqual([waiting, dragGesture]);
expect(sheetSimultaneousHandlers.at(-1)).toEqual([simultaneous, dragGesture]);
renderSheet(null, handlers);
expect(sheetWaitFor.at(-1)).toBe(handlers.waitFor);
expect(sheetSimultaneousHandlers.at(-1)).toBe(handlers.simultaneousHandlers);
},
);
});
// Load the real vendored implementations at runtime without typechecking Gorhom's entire source
// tree (its hooks barrel reaches upstream files that don't compile under the app's TS settings).
const gorhomSource = "@gorhom/bottom-sheet/src";
const { default: BottomSheetDraggableView } = await import(
`${gorhomSource}/components/bottomSheetDraggableView/BottomSheetDraggableView`
);
const { BottomSheetInternalContext } = await import(`${gorhomSource}/contexts/internal`);
const { BottomSheetDraggableContext, BottomSheetGestureHandlersContext } = await import(
`${gorhomSource}/contexts/gesture`
);
const rnghSource = "react-native-gesture-handler/src";
const { extractGestureRelations } = await import(
`${rnghSource}/handlers/gestures/GestureDetector/utils`
);
import { Gesture, type GestureType } from "react-native-gesture-handler";
const noGestureWork = () => {};
const gestureHandlerContext = {
contentPanGestureHandler: {
handleOnStart: noGestureWork,
handleOnChange: noGestureWork,
handleOnEnd: noGestureWork,
handleOnFinalize: noGestureWork,
},
handlePanGestureHandler: {
handleOnStart: noGestureWork,
handleOnChange: noGestureWork,
handleOnEnd: noGestureWork,
handleOnFinalize: noGestureWork,
},
};
function dragInternalContext(relations: SheetContentDragGesture | SheetContentDragGesture[]) {
return {
enableContentPanningGesture: true,
waitFor: relations,
simultaneousHandlers: relations,
};
}
describe("bottom sheet native drag relations", () => {
it.each([false, true])(
"resolves both relations through the real content pan (array=%s)",
(array) => {
const container = document.createElement("div");
const root = createRoot(container);
const child = Gesture.Pan();
child.handlerTag = 42;
const ref = { current: child };
const relations = array ? [ref] : ref;
let resolved: ReturnType<typeof extractGestureRelations> | undefined;
const internal = dragInternalContext(relations);
function Probe() {
const pan = useContext(BottomSheetDraggableContext) as GestureType | null;
if (pan) resolved = extractGestureRelations(pan);
return null;
}
try {
act(() =>
root.render(
<BottomSheetInternalContext.Provider value={internal}>
<BottomSheetGestureHandlersContext.Provider value={gestureHandlerContext}>
<BottomSheetDraggableView>
<Probe />
</BottomSheetDraggableView>
</BottomSheetGestureHandlersContext.Provider>
</BottomSheetInternalContext.Provider>,
),
);
expect(resolved?.waitFor).toEqual([42]);
expect(resolved?.simultaneousHandlers).toEqual([42]);
} finally {
act(() => root.unmount());
}
},
);
});
@@ -105,6 +105,8 @@ export const IsolatedBottomSheetModal = forwardRef<
contextBridge,
backdropOpacity,
enableDismissOnClose = true,
waitFor,
simultaneousHandlers,
...bottomSheetProps
} = props;
// State, not a ref the child fills in: Gorhom builds its pan once per `waitFor`, and RNGH reads
@@ -115,6 +117,19 @@ export const IsolatedBottomSheetModal = forwardRef<
setContentDragGesture(gesture);
return () => setContentDragGesture((current) => (current === gesture ? undefined : current));
}, []);
// RNGH Android's shouldBeCancelledByActiveHandler treats a waiting ancestor's raw ACTIVE
// state as ownership and cancels its child at activation. Simultaneity lets the child activate;
// waitFor still keeps the sheet stationary until the child fails.
const contentDragHandlers = useMemo(() => {
if (!contentDragGesture) return { waitFor, simultaneousHandlers };
return {
waitFor: [...(waitFor ? [waitFor].flat() : []), contentDragGesture],
simultaneousHandlers: [
...(simultaneousHandlers ? [simultaneousHandlers].flat() : []),
contentDragGesture,
],
};
}, [contentDragGesture, waitFor, simultaneousHandlers]);
const renderBackdrop = useCallback(
(backdropProps: BottomSheetBackdropProps) => (
<SheetBackdrop
@@ -132,7 +147,8 @@ export const IsolatedBottomSheetModal = forwardRef<
enableDismissOnClose={enableDismissOnClose}
stackBehavior={presentation}
backdropComponent={backdropOpacity === undefined ? undefined : renderBackdrop}
waitFor={contentDragGesture}
waitFor={contentDragHandlers.waitFor}
simultaneousHandlers={contentDragHandlers.simultaneousHandlers}
>
<BottomSheetScope attachContentDrag={attachContentDrag}>
{contextBridge ? contextBridge(children) : children}
@@ -31,6 +31,7 @@ import {
toolbarSlot,
type ToolbarGlyphs,
} from "@/components/ui/control-geometry";
import { shortModelLabel } from "./utils";
const SNAP_POINTS = ["80%", "90%"];
const MODEL_LIST_TOP_INSET = 4;
@@ -66,11 +67,6 @@ interface CompactModelSheetProps {
children: ReactNode;
}
function shortModelLabel(label: string): string {
const separatorIndex = label.lastIndexOf("/");
return separatorIndex === -1 ? label : label.slice(separatorIndex + 1);
}
function resolveModelSheetProfileActions(
onCreateProfile: ((seed: AgentProfileSeed) => void) | undefined,
onEditProfile: ((profileId: string) => void) | undefined,
@@ -4,6 +4,7 @@ import {
getAgentControlHintKey,
normalizeModelId,
resolveAgentModelSelection,
shortModelLabel,
} from "./utils";
describe("getAgentControlHintKey", () => {
@@ -251,3 +252,19 @@ describe("resolveAgentModelSelection", () => {
expect(selection.displayThinking).toBe("Max");
});
});
describe("shortModelLabel", () => {
it("drops a provider namespace", () => {
expect(shortModelLabel("openrouter/gpt-5.5")).toBe("gpt-5.5");
expect(shortModelLabel("openrouter/google/gemini-2.5-flash")).toBe("gemini-2.5-flash");
});
it("keeps slashes inside a display name", () => {
expect(shortModelLabel("DeepSeek V4.1 Flash (~6-7 tok/s, 56/56)")).toBe(
"DeepSeek V4.1 Flash (~6-7 tok/s, 56/56)",
);
expect(shortModelLabel("llama-swap/DeepSeek V4.1 Flash (56/56)")).toBe(
"DeepSeek V4.1 Flash (56/56)",
);
});
});
@@ -35,6 +35,12 @@ export function normalizeModelId(modelId: string | null | undefined): string | n
return normalized;
}
// Drops a provider namespace ("openrouter/gpt-5.5" -> "gpt-5.5") for the compact trigger.
// A namespace segment has no spaces, so slashes inside a display name ("52/56") survive.
export function shortModelLabel(label: string): string {
return label.replace(/^(?:[^\s/]+\/)+(?=\S)/, "");
}
export function getFeatureHighlightColor(featureId: string): FeatureHighlightColor {
switch (featureId) {
case FAST_MODE_FEATURE_ID:
+10 -4
View File
@@ -204,7 +204,7 @@ export interface MessageInputProps {
onSubmitLoadingPress?: () => void;
/** Intercept key press events before default handling. Return true to prevent default. */
onKeyPress?: (event: ComposerKeyPressEvent) => boolean;
/** Reports cursor selection updates from the underlying input. */
/** Reports selection updates from user input and programmatic replacements. */
onSelectionChange?: (selection: { start: number; end: number }) => void;
onFocusChange?: (focused: boolean) => void;
onHeightChange?: (height: number) => void;
@@ -1468,11 +1468,18 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
if (nextText === "") {
textInputRef.current?.reset();
} else {
textInputRef.current?.replaceText(nextText, selection);
textInputRef.current?.replaceText(nextText, selectionRef.current);
}
onChangeText(nextText);
// iOS does not emit a selection event for a programmatic text replacement.
onSelectionChangeCallback?.(selectionRef.current);
},
[onChangeText, updateComposerHeightForText, updateLiveTextPresence],
[
onChangeText,
onSelectionChangeCallback,
updateComposerHeightForText,
updateLiveTextPresence,
],
);
useLayoutEffect(
@@ -2339,7 +2346,6 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
<ComposerInputPresentation
fullscreen={isFullscreen}
controlSizing={controlSizing}
sendIconSize={toolbarGlyph.size}
surface={textSurface}
toolbar={toolbar}
send={sendButton}
@@ -23,14 +23,13 @@ function keepEditorFocused(event: import("react-native").PointerEvent) {
/**
* One tree for both layout modes. The editing surface keeps its position so the
* mounted editor, its native buffer, selection, and focus survive every toggle;
* only the chrome around it changes. Fullscreen shows exit top right and Send
* bottom right, both on the rail the inline Send button uses; a send error sits
* only the chrome around it changes. Fullscreen keeps the exit glyph on the text
* rail and Send at the bottom right; a send error sits
* in the same footer as Send.
*/
export function ComposerInputPresentation({
fullscreen,
controlSizing,
sendIconSize,
surface,
toolbar,
send,
@@ -47,7 +46,6 @@ export function ComposerInputPresentation({
fullscreen: boolean;
/** The sizing the toolbar's stylesheet resolves to; see `resolveControlSizing`. */
controlSizing: ControlSizing;
sendIconSize: number;
surface: ReactNode;
toolbar: ReactNode;
send: ReactNode;
@@ -69,7 +67,6 @@ export function ComposerInputPresentation({
const glyphSize = iconSizeFor("md")[controlSizing];
const railOffset = resolveGlyphRailOffset({
controlSize: TOOLBAR_CONTROL_SIZES[controlSizing],
sendIconSize,
glyphIconSize: glyphSize,
});
const maximizeIcon = useCallback(
@@ -80,8 +77,8 @@ export function ComposerInputPresentation({
(color: string) => <Minimize2 color={color} size={glyphSize} />,
[glyphSize],
);
// The toolbar row bleeds 6px past the input padding; the inline glyph sits on that edge.
const enterStyle = useMemo(() => [styles.enterButton, { right: -6 + railOffset }], [railOffset]);
// Fullscreen controls share the text rail; the toolbar disc owns its separate corner inset.
const enterStyle = useMemo(() => [styles.enterButton, { right: railOffset }], [railOffset]);
const exitStyle = useMemo(() => [styles.iconButton, { marginRight: railOffset }], [railOffset]);
return (
<View
@@ -603,12 +603,14 @@ describe("retained selection", () => {
});
describe("fullscreen glyph rail", () => {
it("nudges 16px fullscreen glyphs onto the Send arrow's ink edge", () => {
expect(
resolveGlyphRailOffset({ controlSize: 28, sendIconSize: 16, glyphIconSize: 16 }),
).toBeCloseTo(4 / 3);
expect(
resolveGlyphRailOffset({ controlSize: 28, sendIconSize: 20, glyphIconSize: 16 }),
).toBeCloseTo(1 / 6);
it.each([
{ controlSize: 28, glyphIconSize: 16 },
{ controlSize: 44, glyphIconSize: 20 },
])("puts the visible fullscreen edge on the text rail ($controlSize)", (geometry) => {
const offset = resolveGlyphRailOffset(geometry);
// Maximize2 and Minimize2 reach x21 in a 24-unit viewBox, with a 2-unit stroke.
const inkInset =
(geometry.controlSize - geometry.glyphIconSize) / 2 + (geometry.glyphIconSize * 2) / 24;
expect(offset + inkInset).toBeCloseTo(0);
});
});
+5 -10
View File
@@ -234,21 +234,16 @@ export async function stopRealtimeVoice(ctx: StopRealtimeVoiceContext): Promise<
}
/**
* Offset that aligns a glyph's visible ink with the Send arrow's ink when both sit in
* equal controls on the same right rail. In Lucide's 24px viewBox ArrowUp ends at
* x19 while Maximize2/Minimize2 end at x21, so equal boxes leave the fullscreen
* glyphs visibly past the arrow.
* Put the fullscreen glyph's visible right edge on the text rail, letting its
* hit area extend into the padding. Both Lucide glyphs reach x21 of 24 and use
* the default 2-unit stroke (one viewBox unit beyond the path).
*/
export function resolveGlyphRailOffset(input: {
controlSize: number;
sendIconSize: number;
glyphIconSize: number;
}): number {
const arrowInkInset =
(input.controlSize - input.sendIconSize) / 2 + (5 * input.sendIconSize) / 24;
const glyphInkInset =
(input.controlSize - input.glyphIconSize) / 2 + (3 * input.glyphIconSize) / 24;
return arrowInkInset - glyphInkInset;
const inkInset = (input.controlSize - input.glyphIconSize) / 2 + (2 * input.glyphIconSize) / 24;
return -inkInset;
}
export function resolveComposerSurfaceText(
@@ -90,6 +90,16 @@ class FakeDaemonClient {
cancelDictationStream(dictationId: string): void {
this.cancels.push(dictationId);
}
emitStreamError(dictationId: string, error: string): void {
const message = {
type: "dictation_stream_error",
payload: { dictationId, error, retryable: true },
} as SessionOutboundMessage;
for (const listener of this.rawMessageListeners) {
listener(message);
}
}
}
const tick = async () => {
@@ -314,6 +324,29 @@ describe("DictationStreamSender", () => {
await expect(finish).resolves.toEqual({ dictationId: "d1", text: "ok" });
});
it("fails finish with the daemon's stream error instead of waiting for acks", async () => {
const client = new FakeDaemonClient();
client.autoAck = false;
let nextId = 0;
const sender = new DictationStreamSender({
client,
format: "audio/pcm;rate=16000;bits=16",
createDictationId: () => `d${++nextId}`,
});
sender.enqueueSegment("seg0");
await tick();
client.emitStreamError("d1", "Local speech worker request timed out: commit");
sender.enqueueSegment("seg1");
await tick();
const finish = sender.finish(1);
await expect(promiseOutcome(finish, 1000)).resolves.toBe("rejected");
await expect(finish).rejects.toThrow("Local speech worker request timed out");
expect(client.finishes).toEqual([]);
expect(sender.getSegmentCount()).toBe(2);
});
it("does not replay long buffered native dictation in one synchronous burst", async () => {
const client = new FakeDaemonClient();
client.isConnected = false;
@@ -8,6 +8,10 @@ const DICTATION_DRAIN_IDLE_TIMEOUT_MS = 30_000;
const waitForNextFlushTurn = (): Promise<void> => new Promise((resolve) => setTimeout(resolve, 0));
type DictationStreamAckMessage = Extract<SessionOutboundMessage, { type: "dictation_stream_ack" }>;
type DictationStreamErrorMessage = Extract<
SessionOutboundMessage,
{ type: "dictation_stream_error" }
>;
interface DrainWaitResult {
kind: "signaled" | "timed-out";
@@ -64,6 +68,7 @@ export class DictationStreamSender {
private startGeneration = 0;
private startPromise: Promise<void> | null = null;
private streamError: Error | null = null;
constructor(params: DictationStreamSenderParams) {
this.format = params.format;
@@ -88,10 +93,11 @@ export class DictationStreamSender {
}
this.clientCleanup = client.subscribeRawMessages((message) => {
if (message.type !== "dictation_stream_ack") {
return;
if (message.type === "dictation_stream_ack") {
this.handleAck(message);
} else if (message.type === "dictation_stream_error") {
this.handleStreamError(message);
}
this.handleAck(message);
});
}
@@ -127,6 +133,7 @@ export class DictationStreamSender {
this.acknowledgedSeq = -1;
this.streamReady = false;
this.startPromise = null;
this.streamError = null;
this.startGeneration += 1;
this.resolveDrainWaiters();
}
@@ -197,6 +204,7 @@ export class DictationStreamSender {
this.sendSeq = 0;
this.acknowledgedSeq = -1;
this.streamReady = false;
this.streamError = null;
const start = (async () => {
await client.startDictationStream(dictationId, this.format);
@@ -285,6 +293,25 @@ export class DictationStreamSender {
this.resolveDrainWaiters();
}
// The daemon drops a stream after an error and answers later chunks with
// errors instead of acks, so waiting for delivery can only time out.
private handleStreamError(message: DictationStreamErrorMessage): void {
if (message.payload.dictationId !== this.dictationId || this.streamError) {
return;
}
this.streamError = new Error(message.payload.error);
this.resolveDrainWaiters();
}
private throwStreamError(): void {
const error = this.streamError;
if (!error) {
return;
}
this.invalidateStream();
throw error;
}
private invalidateStream(): void {
this.resetStreamForReplay();
}
@@ -309,11 +336,13 @@ export class DictationStreamSender {
private async waitForFlushDrain(finalSeq: number): Promise<void> {
while (this.hasPendingDelivery(finalSeq)) {
this.throwStreamError();
const client = this.client;
if (!client?.isConnected || !this.dictationId || !this.streamReady) {
throw new Error("Failed to flush dictation stream");
}
const result = await this.waitForDrainSignal();
this.throwStreamError();
if (result.kind === "timed-out") {
this.invalidateStream();
throw new Error("Timed out waiting for dictation stream delivery");
+15 -1
View File
@@ -209,6 +209,8 @@ interface UseGitActionsResult {
gitActions: GitActions;
branchLabel: string;
isGit: boolean;
/** Archives this workspace, Git or not. Null while it cannot be archived. */
archiveWorkspace: (() => void) | null;
}
interface UseWorkspaceScreenArchiveControllerInput {
@@ -266,6 +268,13 @@ function canArchiveWorkspace(
);
}
function availableArchive(
controller: { canArchive: boolean; isArchiving: boolean },
archive: () => void,
): (() => void) | null {
return controller.canArchive && !controller.isArchiving ? archive : null;
}
function useWorkspaceScreenArchiveController({
serverId,
activeWorkspaceSelection,
@@ -864,7 +873,12 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
[gitActionsInput, baseRefLabel, hasPullRequest, forge, t],
);
return { gitActions, branchLabel, isGit };
return {
gitActions,
branchLabel,
isGit,
archiveWorkspace: availableArchive(archiveController, handleArchiveWorkspace),
};
}
function translateGitActions(
@@ -23,10 +23,18 @@ class FakeMediaQueryList {
}
}
function createFakeDisplay(initial: { finePointer: boolean; touchScreen: boolean }) {
function createFakeDisplay(initial: {
finePointer: boolean;
touchScreen: boolean;
touchPrimaryPointer?: boolean;
}) {
const queries = {
finePointer: new FakeMediaQueryList("(hover: hover) and (pointer: fine)", initial.finePointer),
touchScreen: new FakeMediaQueryList("(any-pointer: coarse)", initial.touchScreen),
touchPrimaryPointer: new FakeMediaQueryList(
"(pointer: coarse)",
initial.touchPrimaryPointer ?? false,
),
};
const matchMedia = (query: string) => {
const match = Object.values(queries).find((list) => list.media === query);
@@ -75,3 +83,25 @@ describe("pointer capabilities", () => {
});
});
});
describe("hasTouchPrimaryPointer", () => {
it("is false on a touch-screen laptop driven by its trackpad", () => {
const display = createFakeDisplay({ finePointer: true, touchScreen: true });
expect(createPointerCapabilitiesSource(display.matchMedia).hasTouchPrimaryPointer()).toBe(
false,
);
});
it("is true when the primary pointer is coarse", () => {
const display = createFakeDisplay({
finePointer: false,
touchScreen: true,
touchPrimaryPointer: true,
});
expect(createPointerCapabilitiesSource(display.matchMedia).hasTouchPrimaryPointer()).toBe(true);
});
it("is false without media queries", () => {
expect(createPointerCapabilitiesSource(null).hasTouchPrimaryPointer()).toBe(false);
});
});
+12 -6
View File
@@ -8,6 +8,7 @@ import { isWeb } from "@/constants/platform";
// (detachable keyboards, tablet mode, devtools touch emulation).
const FINE_POINTER_QUERY = "(hover: hover) and (pointer: fine)";
const TOUCH_SCREEN_QUERY = "(any-pointer: coarse)";
const TOUCH_PRIMARY_POINTER_QUERY = "(pointer: coarse)";
export interface PointerCapabilities {
/** A mouse-like pointer drives the UI. */
@@ -21,6 +22,7 @@ type MatchMedia = (query: string) => MediaQueryList;
export interface PointerCapabilitiesSource {
getSnapshot: () => PointerCapabilities;
subscribe: (onChange: () => void) => () => void;
hasTouchPrimaryPointer: () => boolean;
}
export function createPointerCapabilitiesSource(
@@ -28,9 +30,11 @@ export function createPointerCapabilitiesSource(
): PointerCapabilitiesSource {
const finePointerQuery = matchMedia?.(FINE_POINTER_QUERY) ?? null;
const touchScreenQuery = matchMedia?.(TOUCH_SCREEN_QUERY) ?? null;
const touchPrimaryPointerQuery = matchMedia?.(TOUCH_PRIMARY_POINTER_QUERY) ?? null;
let snapshot: PointerCapabilities = { finePointer: false, touchScreen: false };
return {
hasTouchPrimaryPointer: () => touchPrimaryPointerQuery?.matches ?? false,
getSnapshot() {
const finePointer = finePointerQuery?.matches ?? false;
const touchScreen = touchScreenQuery?.matches ?? false;
@@ -61,6 +65,7 @@ const NATIVE_POINTER_CAPABILITIES: PointerCapabilities = { finePointer: false, t
const nativeSource: PointerCapabilitiesSource = {
getSnapshot: () => NATIVE_POINTER_CAPABILITIES,
subscribe: () => () => {},
hasTouchPrimaryPointer: () => true,
};
const source = isWeb ? createPointerCapabilitiesSource(browserMatchMedia()) : nativeSource;
@@ -79,10 +84,11 @@ export function hasFinePointer(): boolean {
return source.getSnapshot().finePointer;
}
/** Touch sizing remains enabled on hybrid browsers that report touch points. */
export function hasTouchScreen(): boolean {
return (
source.getSnapshot().touchScreen ||
(isWeb && typeof window !== "undefined" && window.navigator.maxTouchPoints > 0)
);
/**
* True when touch is the primary input, read at call time. iPadOS keeps touch primary with a
* trackpad attached; a laptop with a touch screen that its trackpad drives reports a fine primary
* pointer.
*/
export function hasTouchPrimaryPointer(): boolean {
return source.hasTouchPrimaryPointer();
}

Some files were not shown because too many files have changed in this diff Show More