Compare commits

..
Author SHA1 Message Date
Mohamed Boudra 043f0995d4 chore(release): cut 0.17.1 2026-11-21 22:09:29 +01:00
Mohamed Boudra f03734c402 docs(changelog): add 0.17.1 release notes 2026-11-21 22:04:16 +01:00
1303 changed files with 6332 additions and 138894 deletions
-2
View File
@@ -50,7 +50,6 @@ desktop:
app:
- "packages/app/**"
- "packages/expo-two-way-audio/**"
- "packages/react-native-enriched-markdown/**"
sdk:
- "packages/plugin/**"
@@ -81,7 +80,6 @@ browser:
- "packages/app/index.ts"
- "packages/app/*config.{cjs,js,ts}"
- "packages/app/package.json"
- "packages/react-native-enriched-markdown/**"
relay:
- "packages/relay/**"
+9 -47
View File
@@ -20,8 +20,6 @@ env:
# CI does not use the CUDA execution provider, and the onnxruntime-node
# postinstall download from NuGet is large enough to make npm ci flaky.
ONNXRUNTIME_NODE_INSTALL: skip
NPM_CONFIG_AUDIT: "false"
NPM_CONFIG_FUND: "false"
jobs:
changes:
@@ -167,29 +165,8 @@ jobs:
- name: Run website tests
run: npx vitest run packages/website/src --bail=1
# WebKit needs about 180 system packages (125 MB) from the Ubuntu mirror. The mirror
# sometimes serves them at under 100 kB/s, which turns a 1-minute step into 25 minutes.
# Keep the downloaded .deb files in the Actions cache so apt installs them without the mirror.
- name: Restore website browser system packages
uses: actions/cache@v4
with:
path: ~/website-browser-debs
key: website-browser-debs-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: website-browser-debs-${{ runner.os }}-
- name: Install website test browsers
run: |
mkdir -p ~/website-browser-debs
shopt -s nullglob
cached_debs=(~/website-browser-debs/*.deb)
if (( ${#cached_debs[@]} > 0 )); then
sudo cp "${cached_debs[@]}" /var/cache/apt/archives/
fi
npx playwright install --with-deps chromium webkit
archive_debs=(/var/cache/apt/archives/*.deb)
if (( ${#archive_debs[@]} > 0 )); then
cp "${archive_debs[@]}" ~/website-browser-debs/
fi
run: npx playwright install --with-deps chromium webkit
- name: Verify website mockups
run: npm run test:e2e --workspace=@getpaseo/website
@@ -299,7 +276,10 @@ jobs:
run: npm run test:integration --workspace=@getpaseo/server
env: *server_test_env
# Keep this job scoped to regressions reported on macOS.
# native-recursive.ts serves darwin and win32, but windows-latest above is the only
# runner that exercises it. macOS — the platform the reported watcher bug was on —
# otherwise has no server-test coverage. Scoped to the observer/watcher suites to
# bound runtime.
server-tests-macos:
name: server-tests (macos-latest, file observation)
needs: changes
@@ -327,24 +307,6 @@ jobs:
src/server/workspace-git-service.observation.integration.test.ts \
--bail=1
- name: Verify path casing on macOS
run: |
npm run test:unit --workspace=@getpaseo/server -- \
src/server/agent/agent-storage.test.ts \
src/utils/directory-suggestions.test.ts \
--bail=1
- name: Verify plugin compiler children are reaped
run: |
npm run test:unit --workspace=@getpaseo/server -- \
src/server/plugins/index.posix.test.ts \
-t "reaps compiler children" --bail=1
- name: Verify plugin session sockets survive a dead plugin child
run: |
npm run test:unit --workspace=@getpaseo/server -- \
src/server/plugins/session-socket.posix.test.ts --bail=1
desktop-tests-ubuntu:
name: desktop-tests (ubuntu-latest)
needs: changes
@@ -498,9 +460,9 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
E2E_WORKERS: "2"
# File groups are weighted by observed reporter durations.
# Share of the test list per shard, rebalanced from main and PR eight-shard
# durations so the slowest and fastest shards meet.
PWTEST_SHARD_WEIGHTS: "90:114:100:104:108:112:112:90"
# Share of the test list per shard, rebalanced from the Playwright step
# minutes of five eight-shard runs so the slowest and fastest shards meet.
PWTEST_SHARD_WEIGHTS: "85:94:117:128:91:103:127:85"
- name: Upload test artifacts
uses: actions/upload-artifact@v4
@@ -614,7 +576,7 @@ jobs:
# Source tests do not read PASEO_CLI_TEST_SHARD. Run them once, on the
# shortest E2E shard, after its runner has built the server stack.
- name: Run CLI source tests
if: ${{ env.PASEO_CLI_TEST_SHARD == '2' }}
if: ${{ env.PASEO_CLI_TEST_SHARD == '3' }}
run: npm run test:unit --workspace=@getpaseo/cli
# The dependency watchers write build outputs, so run them after the parallel CLI tests.
+1 -6
View File
@@ -11,10 +11,5 @@
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"ignorePatterns": [
"*.lock",
"**/*.gen.ts",
"**/*.gen.tsx",
"packages/react-native-enriched-markdown/**"
]
"ignorePatterns": ["*.lock", "**/*.gen.ts", "**/*.gen.tsx"]
}
+2 -1
View File
@@ -3,7 +3,7 @@
"options": {
"typeAware": false
},
"ignorePatterns": [".dev/**", "packages/react-native-enriched-markdown/**"],
"ignorePatterns": [".dev/**"],
"plugins": ["react", "react-perf", "unicorn", "typescript", "oxc", "import", "promise"],
"jsPlugins": ["./scripts/oxlint/paseo-plugin.mjs"],
"categories": {
@@ -552,6 +552,7 @@
"packages/app/src/components/download-toast.tsx",
"packages/app/src/components/file-explorer-pane.tsx",
"packages/app/src/components/headers/back-header.tsx",
"packages/app/src/components/highlighted-code-block.tsx",
"packages/app/src/components/hosts/host-filter.tsx",
"packages/app/src/components/hosts/host-picker.tsx",
"packages/app/src/components/import-session-sheet.tsx",
+31 -65
View File
@@ -1,109 +1,76 @@
# Changelog
## 0.17.3 - 2026-11-22
### Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse ([#10525](https://github.com/getpaseo/paseo/pull/10525))
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening ([#10524](https://github.com/getpaseo/paseo/pull/10524))
- Fixed `/` and `@` pickers disappearing until reload after returning to a workspace through window history ([#8954](https://github.com/getpaseo/paseo/pull/8954) by [@viking1201](https://github.com/viking1201))
## 0.17.2 - 2026-11-22
- **Turn and session stats:** View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers. ([#10496](https://github.com/getpaseo/paseo/pull/10496), [#10510](https://github.com/getpaseo/paseo/pull/10510))
- **Automatic model list refresh:** Enabled providers refresh their model lists in the background every 30 minutes. ([#10481](https://github.com/getpaseo/paseo/pull/10481))
- **Sidebar usage by default:** The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list. ([#10491](https://github.com/getpaseo/paseo/pull/10491))
- **Agents can steer turns:** Agents can steer another agent's running turn alongside queueing or interrupting it, and receive delivery guidance in the response. ([#10483](https://github.com/getpaseo/paseo/pull/10483))
### Added
- Added Archive workspace to the mobile workspace actions menu ([#10507](https://github.com/getpaseo/paseo/pull/10507))
- Added provider docs links, fuller diagnostic reports, and a scrollable Models list with inline refresh to provider settings ([#10487](https://github.com/getpaseo/paseo/pull/10487))
### Changed
- Removed the "This chat uses OpenCode v2." info row from OpenCode v2 chats ([#10490](https://github.com/getpaseo/paseo/pull/10490))
### Fixed
- Fixed pressing Tab or Enter in the slash menu running a stale `/exit` choice and archiving the agent ([#10484](https://github.com/getpaseo/paseo/pull/10484) by [@3ae3ae](https://github.com/3ae3ae))
- Fixed busy host connections dropping to reconnect when multiple connections are saved ([#10395](https://github.com/getpaseo/paseo/pull/10395))
- Fixed retrying an edited New workspace form hitting a conflict error after a failed start, and unified composer error alerts ([#10482](https://github.com/getpaseo/paseo/pull/10482))
- Fixed Antigravity turns staying running after creating a recurring schedule ([#10469](https://github.com/getpaseo/paseo/pull/10469))
- Fixed daemon startup and plugin reloads leaving zombie child processes for local directory plugins ([#10470](https://github.com/getpaseo/paseo/pull/10470))
## 0.17.1 - 2026-11-21
- **Antigravity approvals and history:** Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires [Antigravity CLI 1.5.0 or later](https://paseo.sh/docs/supported-providers/antigravity). ([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from a branch or pull request. ([#10190](https://github.com/getpaseo/paseo/pull/10190))
- **Update providers in Paseo:** See each provider's status and installed version, and update supported CLIs from the app. ([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider quota forecasts:** Usage shows when your current pace will use up a quota before it resets. ([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
- **Watch PRs and MRs:** Ask an agent to watch a pull or merge request for new checks, reviews, and comments. ([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation. ([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
- **Update providers in Paseo:** See each provider's status, installed version, and available updates in the provider list. Open a provider's settings from Settings, setup, or the model picker to update supported CLIs and watch their output. ([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider quota forecasts:** Usage estimates when a quota will run out before reset based on your current pace, shown inline with the reset time. Healthy quota bars now show in green, and reset and exhaustion times include the weekday and calendar date when needed. ([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385), [#10397](https://github.com/getpaseo/paseo/pull/10397))
- **Watch PRs and MRs:** Ask an agent to watch a GitHub, GitLab, Gitea, Forgejo, or Codeberg change request for updates to checks, reviews, or comments. Stop a watch from Background work. ([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **Heartbeats in Background work:** See and stop an agent's heartbeats next to its background tasks. ([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
- **Agent messages wait their turn:** By default, messages from other agents wait for the current turn to end. ([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
- **More goose models:** Select models from every provider configured in goose. ([#9719](https://github.com/getpaseo/paseo/pull/9719) by [@i386](https://github.com/i386))
- **Agent messages wait their turn:** Reports and notifications from other agents arrive in order when the current turn ends instead of interrupting it. An interrupt or your own prompt carries earlier queued messages in the same turn, and Stop holds queued messages until the next prompt instead of starting a new turn. ([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
- **Antigravity approvals and history:** Choose a permission mode, respond to tool approvals, and import or reopen sessions. Use Antigravity CLI 1.5.0 or later on the daemon host, and include `acp` if you override its command. In Hub, reselect the model and thinking level if a saved model ID includes an old effort suffix. ([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **More goose models:** Select models from all providers configured in goose. Existing goose settings and sessions carry over to the bundled plugin. ([#9719](https://github.com/getpaseo/paseo/pull/9719) by [@i386](https://github.com/i386))
- **Plugin agent instructions:** Plugins can add their own instructions to agents. ([#9781](https://github.com/getpaseo/paseo/pull/9781))
### Added
- Added OpenRouter credit balances and API key spending to Usage and `paseo usage` ([#10269](https://github.com/getpaseo/paseo/pull/10269))
- Added Antigravity account quotas to Usage ([#10232](https://github.com/getpaseo/paseo/pull/10232) by [@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- Added Antigravity skills to `/` suggestions ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- Added bundled orchestration skills to Antigravity ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- Added Antigravity skill suggestions when you type `/` inside a prompt ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- Added bundled orchestration skills to Antigravity on hosts where Paseo skills are installed ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- Added shortcuts to open the model picker and cycle thinking levels with Cmd/Ctrl+/ and Cmd/Ctrl+Shift+/ ([#10147](https://github.com/getpaseo/paseo/pull/10147))
- Added agent settings to Command Center search before the first message ([#10182](https://github.com/getpaseo/paseo/pull/10182) by [@cleiter](https://github.com/cleiter))
- Added Rewind to Command Center for the latest turn ([#10144](https://github.com/getpaseo/paseo/pull/10144))
- Added a separate Ultracode toggle for Claude ([#10150](https://github.com/getpaseo/paseo/pull/10150) by [@fivetaku](https://github.com/fivetaku))
- Added a separate Ultracode toggle for eligible Claude models ([#10150](https://github.com/getpaseo/paseo/pull/10150) by [@fivetaku](https://github.com/fivetaku))
- Added Flex speed for Codex ([#9809](https://github.com/getpaseo/paseo/pull/9809) by [@qjqqyy](https://github.com/qjqqyy))
- Added syntax highlighting for shell scripts and Dockerfiles ([#10178](https://github.com/getpaseo/paseo/pull/10178))
- Added project listing on connected daemons for Hub sessions ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- Added project listing on connected daemons for Hub sessions with `hub.execute` ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- Added labels and workspace IDs to `paseo ls --json` ([#10076](https://github.com/getpaseo/paseo/pull/10076))
### Changed
- Changed content width to Default, Wide, and Full presets that also resize open chats and Markdown previews ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Changed Antigravity tool cards to show shell commands, output, and file diffs ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- Changed Appearance content width to Default (820 px), Wide (1,200 px), and Full presets that resize open chats, the composer, and Markdown previews together ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Changed Antigravity tool cards to show shell commands and output, file diffs, and Paseo tool details ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- Changed Clone from GitHub to show matching private repositories first ([#10264](https://github.com/getpaseo/paseo/pull/10264))
- Changed healthy quota bars in Usage to green ([#10397](https://github.com/getpaseo/paseo/pull/10397))
- Changed worktree teardown to keep the worktree when the command times out ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
- Changed workspace navigation on mobile to acknowledge taps sooner ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- Changed workspace Git status to skip its reload after a short reconnect with no file changes ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
- Changed worktree teardown to keep the worktree when the command exceeds one minute or the `worktree.teardownTimeoutMs` limit in `paseo.json` ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
- Changed workspace navigation to acknowledge taps promptly and initially load fewer offscreen chat rows on mobile ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- Changed workspace Git status to reuse its snapshot after a short reconnect when the checkout has not changed ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
- Changed `browser_new_tab` to ask agents to choose a Desktop when several are connected ([#10189](https://github.com/getpaseo/paseo/pull/10189))
### Fixed
- Fixed an online host's workspaces going missing ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- Fixed chat history timing out when many open chats refresh after reconnecting ([#10368](https://github.com/getpaseo/paseo/pull/10368))
- Fixed an online host's workspaces staying missing after the app evicts its cached directory ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- Fixed chat history timing out when many open chats refresh at once after reconnecting ([#10368](https://github.com/getpaseo/paseo/pull/10368))
- Fixed slow reopening of long Claude chats while the daemon is busy ([#10369](https://github.com/getpaseo/paseo/pull/10369))
- Fixed images from a live reply waiting for images in another chat's history to load ([#10371](https://github.com/getpaseo/paseo/pull/10371))
- Fixed agents failing to recover after stopping a foreground daemon with Ctrl+C ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- Fixed long Antigravity chats losing the end of their history after a daemon restart ([#10428](https://github.com/getpaseo/paseo/pull/10428))
- Fixed agent recovery failing and idle agents showing errors after stopping a foreground daemon with Ctrl+C on macOS or Linux ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- Fixed reopening a long Antigravity chat after a daemon restart losing the end of its history ([#10428](https://github.com/getpaseo/paseo/pull/10428))
- Fixed Antigravity turns ending while a background command is still running ([#10310](https://github.com/getpaseo/paseo/pull/10310))
- Fixed the Add model sheet staying open after saving a custom model ([#10432](https://github.com/getpaseo/paseo/pull/10432))
- Fixed the Add model sheet staying open after saving a custom model when provider discovery is slow or fails ([#10432](https://github.com/getpaseo/paseo/pull/10432))
- Fixed slash suggestions failing when a provider reports duplicate command names ([#10275](https://github.com/getpaseo/paseo/pull/10275))
- Fixed resumed Codex sessions using their previous working directory for configuration and MCP servers ([#10390](https://github.com/getpaseo/paseo/pull/10390) by [@tabulius-ux](https://github.com/tabulius-ux))
- Fixed resumed Codex sessions keeping their previous working directory for configuration and MCP servers when opened in a different directory ([#10390](https://github.com/getpaseo/paseo/pull/10390) by [@tabulius-ux](https://github.com/tabulius-ux))
- Fixed stale Codex subagent statuses after reopening or rewinding the parent chat ([#10171](https://github.com/getpaseo/paseo/pull/10171) by [@AnalyticETH](https://github.com/AnalyticETH))
- Fixed Usage showing the previous Claude account's quota after switching accounts ([#10236](https://github.com/getpaseo/paseo/pull/10236))
- Fixed the sidebar usage row dropping period labels when several usage windows are pinned ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- Fixed the sidebar usage row dropping period labels such as `5h` and `wk` when multiple usage windows are pinned ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- Fixed Changes failing to recognize a checkout immediately after restoring its worktree ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304), [#10406](https://github.com/getpaseo/paseo/pull/10406))
- Fixed split-pane dividers stopping or lagging during drags ([#5996](https://github.com/getpaseo/paseo/pull/5996))
- Fixed split-pane dividers stopping or lagging during drags after adding panes to a previously resized row ([#5996](https://github.com/getpaseo/paseo/pull/5996))
- Fixed double-click word selection and triple-click line selection in diffs ([#10252](https://github.com/getpaseo/paseo/pull/10252) by [@pedrovieira](https://github.com/pedrovieira))
- Fixed the composer and chat column losing alignment when Chat outline is enabled ([#10277](https://github.com/getpaseo/paseo/pull/10277))
- Fixed the web composer's focus shortcut hint overlapping the placeholder ([#6200](https://github.com/getpaseo/paseo/pull/6200))
- Fixed the web composer focus shortcut hint overlapping the placeholder text at narrow widths or in longer translations ([#6200](https://github.com/getpaseo/paseo/pull/6200))
- Fixed the archive shortcut failing when the active workspace's sidebar group is collapsed ([#10356](https://github.com/getpaseo/paseo/pull/10356) by [@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
- Fixed other sessions and plugins seeing a workspace as active while another session is archiving it ([#10391](https://github.com/getpaseo/paseo/pull/10391) by [@tabulius-ux](https://github.com/tabulius-ux))
- Fixed Android composer buttons requiring a second tap after typing or zooming a chat image ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
- Fixed swiping a terminal in an Android browser opening the keyboard ([#10225](https://github.com/getpaseo/paseo/pull/10225) by [@tonylt](https://github.com/tonylt))
- Fixed swiping a terminal in an Android browser opening the keyboard when it was closed ([#10225](https://github.com/getpaseo/paseo/pull/10225) by [@tonylt](https://github.com/tonylt))
- Fixed Collapse turns hiding a finished OMP or Pi reply when an idle provider notice appears ([#10135](https://github.com/getpaseo/paseo/pull/10135))
- Fixed repeated finish notifications while an agent responds to background tasks ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- Fixed repeated finish notifications while an agent responds to background tasks and its earlier finish is unread ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- Fixed an empty chat losing the prompt and start of a reply after reconnecting mid-reply ([#9723](https://github.com/getpaseo/paseo/pull/9723) by [@ragokan](https://github.com/ragokan))
- Fixed changing the Claude thinking level stopping its background work ([#10008](https://github.com/getpaseo/paseo/pull/10008) by [@gilad-rubin](https://github.com/gilad-rubin))
- Fixed changes between Claude thinking levels stopping its background work ([#10008](https://github.com/getpaseo/paseo/pull/10008) by [@gilad-rubin](https://github.com/gilad-rubin))
- Fixed OpenCode turns staying running after a shared OpenCode service stops ([#10187](https://github.com/getpaseo/paseo/pull/10187))
- Fixed OMP denying an approved tool call when session or grant choices were offered ([#10126](https://github.com/getpaseo/paseo/pull/10126) by [@dsingal0](https://github.com/dsingal0))
- Fixed a Codex message stopped before its turn starts showing an error instead of canceled ([#9931](https://github.com/getpaseo/paseo/pull/9931) by [@3ae3ae](https://github.com/3ae3ae))
- Fixed Changes failing to open when Git metadata watching reaches its limit ([#10188](https://github.com/getpaseo/paseo/pull/10188))
- Fixed copying selected reply text into plain-text targets with unwanted Markdown syntax ([#10079](https://github.com/getpaseo/paseo/pull/10079) by [@danberindei](https://github.com/danberindei))
- Fixed Markdown previews and source views losing their scroll position when switching between them ([#10195](https://github.com/getpaseo/paseo/pull/10195) by [@apple-ouyang](https://github.com/apple-ouyang))
- Fixed file views losing their scroll position when switching Preview and Source, except HTML previews on iOS ([#10195](https://github.com/getpaseo/paseo/pull/10195) by [@apple-ouyang](https://github.com/apple-ouyang))
- Fixed file tabs in split panes showing or focusing the wrong file ([#9888](https://github.com/getpaseo/paseo/pull/9888) by [@KosmoCHE](https://github.com/KosmoCHE))
- Fixed touch-screen submenus closing as soon as they open ([#10175](https://github.com/getpaseo/paseo/pull/10175) by [@christiantwu](https://github.com/christiantwu))
- Fixed dictation failing after another chat that used the microphone closes ([#10185](https://github.com/getpaseo/paseo/pull/10185) by [@Brandon168](https://github.com/Brandon168))
@@ -113,14 +80,13 @@
- Fixed Mermaid flowcharts with `@` in labels showing source instead of the diagram ([#10165](https://github.com/getpaseo/paseo/pull/10165) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
- Fixed hidden background workspaces triggering the dock badge and favicon ([#9983](https://github.com/getpaseo/paseo/pull/9983))
- Fixed desktop sidebar navigation crowding out workspaces ([#9903](https://github.com/getpaseo/paseo/pull/9903) by [@pentatonic-alex](https://github.com/pentatonic-alex))
- Fixed closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- Fixed historical closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- Fixed plugin agents failing to reopen after their provider closes the session ([#10153](https://github.com/getpaseo/paseo/pull/10153))
- Fixed plugin screens and settings failing to use plugin state hooks ([#10049](https://github.com/getpaseo/paseo/pull/10049))
### Plugins
- Added plugin control of worktree creation, removal, and restoration ([#10278](https://github.com/getpaseo/paseo/pull/10278))
- Added a `focusHost` navigation option that selects the destination host in the sidebar ([#5574](https://github.com/getpaseo/paseo/pull/5574) by [@discwl](https://github.com/discwl))
- Added a `focusHost` navigation option for plugins to select the destination host in the sidebar when opening a workspace or agent ([#5574](https://github.com/getpaseo/paseo/pull/5574) by [@discwl](https://github.com/discwl))
## 0.16.2 - 2026-11-18
+29 -63
View File
@@ -1,101 +1,68 @@
# Changelog
## 0.17.3 - 2026-11-22
### 修复
- 修复 iPhone 上“Workspace 标签”等弹窗忽略主体滑动、无法展开、滚动或收起的问题 ([#10525](https://github.com/getpaseo/paseo/pull/10525))
- 修复 Antigravity 将默认模型的思考级别套用到所有模型,导致无法打开 Orchestrator 对话的问题 ([#10524](https://github.com/getpaseo/paseo/pull/10524))
- 修复通过窗口历史记录返回工作区后,`/` 和 `@` 选择器在刷新前一直消失的问题 ([#8954](https://github.com/getpaseo/paseo/pull/8954),贡献者:[@viking1201](https://github.com/viking1201))
## 0.17.2 - 2026-11-22
- **回合和会话统计**:查看 Claude、OpenCode v2、Pi、Oh My Pi 和插件 Provider 的单轮及会话耗时、token、缓存和费用指标。([#10496](https://github.com/getpaseo/paseo/pull/10496), [#10510](https://github.com/getpaseo/paseo/pull/10510))
- **自动刷新模型列表**:已启用的 Provider 每 30 分钟在后台刷新一次模型列表。([#10481](https://github.com/getpaseo/paseo/pull/10481))
- **默认显示侧边栏用量**:侧边栏用量摘要现在默认开启,未启用 Provider 的用量来源默认隐藏,来源开关移至“来源”列表。([#10491](https://github.com/getpaseo/paseo/pull/10491))
- **Agent 可引导进行中的轮次**:Agent 除了排队或中断外,现在可以引导另一个 Agent 正在运行的轮次,并在响应中收到投递指引。([#10483](https://github.com/getpaseo/paseo/pull/10483))
### 新增
- 在移动端工作区操作菜单中新增“归档工作区” ([#10507](https://github.com/getpaseo/paseo/pull/10507))
- 在 Provider 设置中新增文档链接、更完整的诊断报告,以及带内联刷新按钮的可滚动 Models 列表 ([#10487](https://github.com/getpaseo/paseo/pull/10487))
### 变更
- 移除 OpenCode v2 对话中的“This chat uses OpenCode v2.”提示行 ([#10490](https://github.com/getpaseo/paseo/pull/10490))
### 修复
- 修复在斜杠菜单中按 Tab 或 Enter 时误触发过期的 `/exit` 选项并归档 Agent 的问题 ([#10484](https://github.com/getpaseo/paseo/pull/10484),贡献者:[@3ae3ae](https://github.com/3ae3ae))
- 修复保存了多个主机连接时,繁忙的正常连接会断开重连的问题 ([#10395](https://github.com/getpaseo/paseo/pull/10395))
- 修复新建工作区启动失败后,修改表单再重试时出现冲突错误的问题,并统一了 Composer 错误提示 ([#10482](https://github.com/getpaseo/paseo/pull/10482))
- 修复 Antigravity 创建循环定时任务后轮次一直停留在运行状态的问题 ([#10469](https://github.com/getpaseo/paseo/pull/10469))
- 修复启动 daemon 和重载本地目录插件后遗留僵尸子进程的问题 ([#10470](https://github.com/getpaseo/paseo/pull/10470))
## 0.17.1 - 2026-11-21
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。需要 [Antigravity CLI 1.5.0 或更高版本](https://paseo.sh/zh-CN/docs/supported-providers/antigravity)。([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从分支或 PR 创建 worktree。([#10190](https://github.com/getpaseo/paseo/pull/10190))
- **在 Paseo 中更新 Provider**:查看各 Provider 的状态和已安装版本,并在应用内更新受支持的 CLI。([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider 配额预测**:“使用情况”页面会显示配额按当前使用速度将在重置前何时用完。([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385))
- **监视 PR 和 MR**:让 Agent 监视 PR 或 MR 的检查、审查和评论更新。([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从分支或 PR 创建 worktree。插件可以管理 worktree 的创建、移除和恢复。从 fork 的 PR 或 MR 创建分支时,选择“运行设置”以批准工作区自动化。([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
- **在 Paseo 中更新 Provider**:在 Provider 列表中查看各 Provider 的状态、已安装版本和可用更新。从设置、初次配置或模型选择器打开 Provider 设置,即可更新受支持的 CLI 并查看输出。([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
- **Provider 配额预测**:“使用情况”页面会根据当前使用速度估算配额在重置前何时用完,并显示在重置时间同一行中。健康的配额进度条现已改为绿色,重置与用尽时间也会在需要时显示星期和具体日期。([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385), [#10397](https://github.com/getpaseo/paseo/pull/10397))
- **监视 PR 和 MR**:让 Agent 监视 GitHub、GitLab、Gitea、Forgejo 或 Codeberg 上的 PR 或 MR,跟踪检查、审查或评论的变化。你可以在后台任务中停止监视。([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
- **在后台任务中查看 heartbeat**:在 Agent 的后台任务旁查看和停止 heartbeat。([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
- **Agent 消息排队等待**:默认情况下,其他 Agent 的消息会等当前轮次结束后再送达。([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
- **更多 goose 模型**:从 goose 中已配置的所有 Provider 选择模型。([#9719](https://github.com/getpaseo/paseo/pull/9719),贡献者:[@i386](https://github.com/i386))
- **Agent 消息排队等待**:其他 Agent 的报告和通知会在当前轮次结束后按顺序到达,不再打断当前轮次。中断消息或你发送的新提示词会在同一轮次中一并带入此前排队的其他消息;点击“停止”则会暂存排队中的消息直到下一次提示词,而不会开启新轮次。([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。请在 daemon 主机上使用 Antigravity CLI 1.5.0 或更新版本,如果覆盖了启动命令请包含 `acp`。如果 Hub 中保存的模型 ID 含有旧的推理强度后缀,请重新选择模型和思考级别。([#10193](https://github.com/getpaseo/paseo/pull/10193))
- **更多 goose 模型**:从 goose 中已配置的所有 Provider 选择模型。现有 goose 设置和会话会迁移到内置插件。([#9719](https://github.com/getpaseo/paseo/pull/9719),贡献者:[@i386](https://github.com/i386))
- **插件 Agent 指令**:插件可以向 Agent 添加自己的指令。([#9781](https://github.com/getpaseo/paseo/pull/9781))
### 新增
- 在“使用情况”页面和 `paseo usage` 中新增 OpenRouter 余额和 API 密钥支出 ([#10269](https://github.com/getpaseo/paseo/pull/10269))
- 在“使用情况”页面新增 Antigravity 账号配额 ([#10232](https://github.com/getpaseo/paseo/pull/10232),贡献者:[@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
- 在 `/` 建议中新增 Antigravity 技能 ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- 为 Antigravity 新增内置编排技能 ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- 在提示词中输入 `/` 时,新增 Antigravity 技能建议 ([#10383](https://github.com/getpaseo/paseo/pull/10383))
- 在已安装 Paseo 技能的主机上,为 Antigravity 新增内置编排技能 ([#10273](https://github.com/getpaseo/paseo/pull/10273))
- 新增 Cmd/Ctrl+/ 和 Cmd/Ctrl+Shift+/ 快捷键,用于打开模型选择器和切换思考级别 ([#10147](https://github.com/getpaseo/paseo/pull/10147))
- 新增在发送第一条消息前通过命令中心搜索 Agent 设置 ([#10182](https://github.com/getpaseo/paseo/pull/10182),贡献者:[@cleiter](https://github.com/cleiter))
- 新增在命令中心回退最近轮次的操作 ([#10144](https://github.com/getpaseo/paseo/pull/10144))
- 新增 Claude 的独立 Ultracode 开关 ([#10150](https://github.com/getpaseo/paseo/pull/10150),贡献者:[@fivetaku](https://github.com/fivetaku))
- 新增符合条件的 Claude 模型的独立 Ultracode 开关 ([#10150](https://github.com/getpaseo/paseo/pull/10150),贡献者:[@fivetaku](https://github.com/fivetaku))
- 新增 Codex Flex 速度选项 ([#9809](https://github.com/getpaseo/paseo/pull/9809),贡献者:[@qjqqyy](https://github.com/qjqqyy))
- 新增 shell 脚本和 Dockerfile 的语法高亮 ([#10178](https://github.com/getpaseo/paseo/pull/10178))
- 为 Hub 会话新增列出已连接 daemon 项目的能力 ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- 为具有 `hub.execute` 权限的 Hub 会话新增列出已连接 daemon 活跃项目的能力 ([#10392](https://github.com/getpaseo/paseo/pull/10392))
- 新增 `paseo ls --json` 输出的标签和工作区 ID ([#10076](https://github.com/getpaseo/paseo/pull/10076))
### 变更
- 将内容宽度改为默认、宽版和全宽预设,并同时调整已打开对话和 Markdown 预览的宽度 ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Antigravity 工具卡片现在显示 shell 命令、输出和文件 diff ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- 将“外观”中的内容宽度改为默认(820 px)、宽版(1,200 px)和全宽预设,同时调整已打开对话、Composer 和 Markdown 预览的宽度 ([#10231](https://github.com/getpaseo/paseo/pull/10231))
- Antigravity 工具卡片现在显示 shell 命令及输出、文件 diff 和 Paseo 工具详情 ([#10379](https://github.com/getpaseo/paseo/pull/10379))
- 从 GitHub 克隆时,优先显示匹配的私有仓库 ([#10264](https://github.com/getpaseo/paseo/pull/10264))
- “使用情况”页面中健康的配额进度条改为绿色 ([#10397](https://github.com/getpaseo/paseo/pull/10397))
- worktree 清理命令超时时保留 worktree ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
- 手机端工作区导航更快响应点击 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- 短暂重连且文件未更改时,工作区 Git 状态不再重新加载 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
- worktree 清理命令在超过默认的一分钟或 `paseo.json` 中 `worktree.teardownTimeoutMs` 限制时保留 worktree ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
- 工作区导航会立即响应点击,并在手机端初始加载时减少屏幕外的对话行数 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
- 工作区 Git 状态在短暂重连且检出的内容未更改时复用之前的快照 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
- 连接多个 Desktop 时,`browser_new_tab` 会让 Agent 选择打开标签页的 Desktop ([#10189](https://github.com/getpaseo/paseo/pull/10189))
### 修复
- 修复在线主机的工作区不显示的问题 ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- 修复应用清除主机目录缓存后,在线主机的工作区一直不显示的问题 ([#10318](https://github.com/getpaseo/paseo/pull/10318))
- 修复重新连接后多个已打开的对话同时刷新时,历史记录加载超时的问题 ([#10368](https://github.com/getpaseo/paseo/pull/10368))
- 修复 daemon 繁忙时,重新打开较长的 Claude 对话速度慢的问题 ([#10369](https://github.com/getpaseo/paseo/pull/10369))
- 修复当前回复中的图片等待另一个对话的历史图片加载的问题 ([#10371](https://github.com/getpaseo/paseo/pull/10371))
- 修复用 Ctrl+C 停止前台 daemon 后 Agent 恢复失败的问题 ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- 修复 daemon 重启后较长的 Antigravity 对话丢失末尾历史记录的问题 ([#10428](https://github.com/getpaseo/paseo/pull/10428))
- 修复在 macOS 或 Linux 上用 Ctrl+C 停止前台 daemon 后,Agent 恢复失败且空闲 Agent 显示错误的问题 ([#10381](https://github.com/getpaseo/paseo/pull/10381))
- 修复 daemon 重启后重新打开较长的 Antigravity 对话时丢失末尾历史记录的问题 ([#10428](https://github.com/getpaseo/paseo/pull/10428))
- 修复 Antigravity 后台命令仍在运行时轮次就已结束的问题 ([#10310](https://github.com/getpaseo/paseo/pull/10310))
- 修复保存自定义模型后“添加模型”弹窗一直保持打开的问题 ([#10432](https://github.com/getpaseo/paseo/pull/10432))
- 修复保存自定义模型后,在 Provider 发现较慢或失败时“添加模型”弹窗一直保持打开的问题 ([#10432](https://github.com/getpaseo/paseo/pull/10432))
- 修复 Provider 返回重复命令名称时,斜杠建议列表出错的问题 ([#10275](https://github.com/getpaseo/paseo/pull/10275))
- 修复恢复的 Codex 会话的配置和 MCP 服务器仍沿用旧工作目录的问题 ([#10390](https://github.com/getpaseo/paseo/pull/10390),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
- 修复在不同目录中恢复 Codex 会话时,配置和 MCP 服务器仍沿用旧工作目录的问题 ([#10390](https://github.com/getpaseo/paseo/pull/10390),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
- 修复重新打开或回退父对话后,Codex 子 Agent 状态未更新的问题 ([#10171](https://github.com/getpaseo/paseo/pull/10171),贡献者:[@AnalyticETH](https://github.com/AnalyticETH))
- 修复切换 Claude 账号后,“使用情况”页面仍显示上一个账号配额的问题 ([#10236](https://github.com/getpaseo/paseo/pull/10236))
- 修复固定多个用量窗口时,侧边栏用量行隐藏周期标签的问题 ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- 修复固定多个用量窗口时,侧边栏用量行隐藏 `5h` 和 `wk` 等周期标签的问题 ([#10274](https://github.com/getpaseo/paseo/pull/10274))
- 修复恢复 worktree 后,“更改”无法立即识别检出目录的问题 ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304), [#10406](https://github.com/getpaseo/paseo/pull/10406))
- 修复拖动分屏分隔条时卡住或跟手缓慢的问题 ([#5996](https://github.com/getpaseo/paseo/pull/5996))
- 修复向调整过宽度的分屏行添加新窗格后,分隔条无法拖动或跟手缓慢的问题 ([#5996](https://github.com/getpaseo/paseo/pull/5996))
- 修复 diff 中双击选词和三击选行的问题 ([#10252](https://github.com/getpaseo/paseo/pull/10252),贡献者:[@pedrovieira](https://github.com/pedrovieira))
- 修复启用聊天大纲时,Composer 与对话栏对不齐的问题 ([#10277](https://github.com/getpaseo/paseo/pull/10277))
- 修复网页版 Composer 的聚焦快捷键提示遮挡占位符文字的问题 ([#6200](https://github.com/getpaseo/paseo/pull/6200))
- 修复网页版 Composer 在较窄宽度或较长译文下聚焦快捷键提示遮挡占位符文字的问题 ([#6200](https://github.com/getpaseo/paseo/pull/6200))
- 修复当前工作区所在的侧边栏分组折叠时,归档快捷键失效的问题 ([#10356](https://github.com/getpaseo/paseo/pull/10356),贡献者:[@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
- 修复一个会话正在归档工作区时,其他会话和插件仍将其显示为活跃状态的问题 ([#10391](https://github.com/getpaseo/paseo/pull/10391),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
- 修复在 Android 上输入文字或缩放对话图片后,首次点击 Composer 按钮无效的问题 ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
- 修复在 Android 浏览器中滑动终端时弹出键盘的问题 ([#10225](https://github.com/getpaseo/paseo/pull/10225),贡献者:[@tonylt](https://github.com/tonylt))
- 修复在 Android 浏览器中滑动终端时弹出已关闭的键盘的问题 ([#10225](https://github.com/getpaseo/paseo/pull/10225),贡献者:[@tonylt](https://github.com/tonylt))
- 修复启用“折叠轮次”时,空闲的 Provider 通知导致已完成的 OMP 或 Pi 回复被隐藏的问题 ([#10135](https://github.com/getpaseo/paseo/pull/10135))
- 修复 Agent 响应后台任务时重复发送完成通知的问题 ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- 修复 Agent 响应后台任务时,在之前的完成状态未读的情况下重复发送完成通知的问题 ([#10200](https://github.com/getpaseo/paseo/pull/10200))
- 修复空对话在回复中途重连后丢失提示词和回复开头的问题 ([#9723](https://github.com/getpaseo/paseo/pull/9723),贡献者:[@ragokan](https://github.com/ragokan))
- 修复切换 Claude 思考级别时停止后台任务的问题 ([#10008](https://github.com/getpaseo/paseo/pull/10008),贡献者:[@gilad-rubin](https://github.com/gilad-rubin))
- 修复共享 OpenCode 服务停止后轮次一直显示为运行中的问题 ([#10187](https://github.com/getpaseo/paseo/pull/10187))
@@ -103,7 +70,7 @@
- 修复 Codex 消息在轮次开始前停止时显示错误而非已取消的问题 ([#9931](https://github.com/getpaseo/paseo/pull/9931),贡献者:[@3ae3ae](https://github.com/3ae3ae))
- 修复 Git 元数据监听达到上限时无法打开“更改”的问题 ([#10188](https://github.com/getpaseo/paseo/pull/10188))
- 修复将选中的回复复制到纯文本目标时出现多余 Markdown 语法的问题 ([#10079](https://github.com/getpaseo/paseo/pull/10079),贡献者:[@danberindei](https://github.com/danberindei))
- 修复在预览和源码之间切换时 Markdown 预览和源码视图丢失滚动位置的问题 ([#10195](https://github.com/getpaseo/paseo/pull/10195),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
- 修复在预览和源码之间切换时文件视图丢失滚动位置的问题,iOS 的 HTML 预览除外 ([#10195](https://github.com/getpaseo/paseo/pull/10195),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
- 修复拆分窗格中的文件标签页显示或聚焦错误文件的问题 ([#9888](https://github.com/getpaseo/paseo/pull/9888),贡献者:[@KosmoCHE](https://github.com/KosmoCHE))
- 修复触摸屏上的子菜单打开后立即关闭的问题 ([#10175](https://github.com/getpaseo/paseo/pull/10175),贡献者:[@christiantwu](https://github.com/christiantwu))
- 修复关闭另一个使用过麦克风的对话后无法听写的问题 ([#10185](https://github.com/getpaseo/paseo/pull/10185),贡献者:[@Brandon168](https://github.com/Brandon168))
@@ -113,14 +80,13 @@
- 修复 Mermaid 流程图标签含有 `@` 时显示源码而非图表的问题 ([#10165](https://github.com/getpaseo/paseo/pull/10165),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
- 修复隐藏的后台工作区触发程序坞徽标和网站图标状态的问题 ([#9983](https://github.com/getpaseo/paseo/pull/9983))
- 修复桌面侧边栏导航占满工作区列表空间的问题 ([#9903](https://github.com/getpaseo/paseo/pull/9903),贡献者:[@pentatonic-alex](https://github.com/pentatonic-alex))
- 修复仓库默认分支显示已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- 修复仓库默认分支显示历史已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
- 修复 Provider 关闭会话后插件 Agent 无法重新打开的问题 ([#10153](https://github.com/getpaseo/paseo/pull/10153))
- 修复插件页面和设置无法使用插件状态钩子的问题 ([#10049](https://github.com/getpaseo/paseo/pull/10049))
### 插件
- 新增插件对 worktree 创建、移除和恢复的管理能力 ([#10278](https://github.com/getpaseo/paseo/pull/10278))
- 新增插件导航 `focusHost` 选项,用于在侧边栏选中目标主机 ([#5574](https://github.com/getpaseo/paseo/pull/5574),贡献者:[@discwl](https://github.com/discwl))
- 新增插件导航 `focusHost` 选项,打开工作区或 Agent 时在侧边栏选中目标主机 ([#5574](https://github.com/getpaseo/paseo/pull/5574),贡献者:[@discwl](https://github.com/discwl))
## 0.16.2 - 2026-11-18
+1 -1
View File
@@ -56,7 +56,7 @@ At the start of non-trivial work, list `docs/` and skim anything relevant to the
| [docs/terminal-rendering.md](docs/terminal-rendering.md) | Native terminal view: xterm owns the grid, cluster placement, emoji widths, mixed-direction limits, render regression |
| [docs/agent-stream-performance.md](docs/agent-stream-performance.md) | Assistant text pipeline — coalescing window, paced reveal, why arrival lumps are smoothed at render |
| [docs/agent-stream-disclosure.md](docs/agent-stream-disclosure.md) | Expand/collapse in the chat timeline — hold contract, native anchor sequence, frame spacing, render-window cost |
| [docs/markdown-renderer.md](docs/markdown-renderer.md) | Shared Markdown engine, the vendored library fork, native selection, links, images and library constraints |
| [docs/markdown-renderer.md](docs/markdown-renderer.md) | Shared Markdown engine, native selection, links, images and library constraints |
| [docs/native-text-selection.md](docs/native-text-selection.md) | Native diagram grouping, selection boundaries and leading inline image limitations |
| [docs/file-observation.md](docs/file-observation.md) | Recursive watcher ownership, Linux constraints, teardown invariants, and Parcel comparison |
| [docs/testing.md](docs/testing.md) | TDD workflow, determinism, real dependencies over mocks, test organization |
+5 -12
View File
@@ -152,21 +152,14 @@ Users can also detach an existing subagent from the subagents track. Detach is d
Agent-originated messages and automatic notifications share a recipient-daemon delivery module. A queued receipt acknowledges admission before provider dispatch. The module keeps one ordered queue per recipient, and the recipient reads its prompts in the order the daemon admitted them. Nothing overtakes an older queued message. A prompt takes its place when the daemon admits it, even while the provider is still starting an earlier turn, and a message stays in the queue until the turn that carries it starts. The turn has started when the agent manager acknowledges the run start; a turn that fails after that point is not delivered again.
An agent sender picks `queue`, `steer`, or `interrupt` with `activeTurnBehavior`. `steer` and `interrupt` mean what they mean for a person. A person's send has no `queue`. Each kind of prompt is released this way:
- **`queue`** (the agent default) waits. An idle recipient gets the queue after two quiet seconds; steady arrivals cannot hold that window open past ten seconds. While the recipient has a running or starting turn (including compaction), the queue waits and is delivered together when that turn ends on its own or fails. The daemon releases it when it observes the recipient settle; a two-second timer also retries. Finish notifications and change-request updates always queue.
- **`steer`** waits for neither the quiet window nor the turn. It is dispatched at admission as one prompt that enters the running turn: the messages queued before it, then the steer. A provider that cannot steer, or that refuses this steer, gets the prompt as a replacing turn instead, the same as a person's steer.
- **`interrupt`** is dispatched at admission the same way, as one prompt that replaces the running turn. An older queued message cannot start a turn after the newer `interrupt` that countermands it.
- **`steer`** (the agent default) waits. An idle recipient gets the queue after two quiet seconds; steady arrivals cannot hold that window open past ten seconds. While the recipient has a running or starting turn (including compaction), the queue waits and is delivered together when that turn ends on its own or fails. The daemon releases it when it observes the recipient settle; a two-second timer also retries.
- **`interrupt`** waits for neither the quiet window nor the turn. It is dispatched at admission as one prompt that replaces the running turn: the messages queued before it, then the interrupt. An older `steer` cannot start a turn after the newer `interrupt` that countermands it.
- **A person's prompt** (app, CLI, top-level MCP) is dispatched directly with its existing steer or interrupt behavior and takes the queue along the same way: the messages admitted before it first, then the person's text, in one provider prompt. Messages admitted after it follow it. The person's text keeps its own transcript row. When the turn does not start, the messages return to the queue in their place. That covers a start the provider rejects and a start that is not acknowledged within 60 seconds; a provider that starts the turn after those 60 seconds receives the messages twice.
- **Stop** (the stop button, Escape, `cancel_agent`, a Hub interrupt) starts nothing. Messages admitted before the Stop are held, not dropped, including an interrupt whose turn had not started yet. They go ahead of the recipient's next prompt, in that prompt's turn: a person's prompt, or an agent message or notification admitted after the Stop. A held steer or interrupt no longer enters the turn; it waits like a queued message. A queue step or dispatch decided before the Stop is void, and the queue is held again when the message that reopened it is withdrawn. A replacing prompt, a reload, and a rewind are not a Stop. Neither is `cancel_agent` on a recipient with no running or starting turn: it stops nothing, reports that it canceled no run, and a queued message keeps its quiet window.
- **Stop** (the stop button, Escape, `cancel_agent`, a Hub interrupt) starts nothing. Messages admitted before the Stop are held, not dropped, including an interrupt whose turn had not started yet. They go ahead of the recipient's next prompt, in that prompt's turn: a person's prompt, or an agent message or notification admitted after the Stop. A held interrupt no longer interrupts; it waits like a `steer`. A queue step or dispatch decided before the Stop is void, and the queue is held again when the message that reopened it is withdrawn. A replacing prompt, a reload, and a rewind are not a Stop. Neither is `cancel_agent` on a recipient with no running or starting turn: it stops nothing, reports that it canceled no run, and a queued `steer` keeps its quiet window.
The queued receipt carries the applied behavior and guidance text for the sender. The text comes from two facts known at admission: whether the recipient has a running turn, and whether its provider can steer (`AgentManager.canSteer`, which is true when the session offers `steerActiveTurn`). It does not wait for the outcome. Guidance for a message queued behind a running turn tells the sender to send a short `steer` or `interrupt` follow-up instead of resending, because the follow-up carries the queued message ahead of it and a resend would be read twice. The MCP tool, the WebSocket `send_agent_message_response`, the CLI, and the connected-host path all relay this one text.
A command the provider accepts out of band is the one exception to admission order: it runs alone without ending the turn. A queued command runs ahead of older messages, and an `interrupt` that runs this way takes no queued message along. A person's command leaves the queue where it is. A prompt is a command when it starts with a slash and a name that has no second slash, so `/compact` is one and `/tmp/build.log is stale` is plain text.
Older CLIs and connected hosts send an explicit `steer` for every default agent send. The daemon reads an agent sender's `steer` as `queue` unless the client advertises the `agent_active_turn_behaviors` capability. A new client talking to a daemon without `server_info.features.agentActiveTurnBehaviors` sends no behavior for `queue` and refuses a `steer`.
A command the provider accepts out of band is the one exception to admission order: it runs alone without ending the turn. A queued command runs ahead of older messages, and a `steer` or `interrupt` that runs this way takes no queued message along. A person's command leaves the queue where it is. A prompt is a command when it starts with a slash and a name that has no second slash, so `/compact` is one and `/tmp/build.log is stale` is plain text.
One provider prompt has one session mode. A batch released by a steer, an interrupt, or a person's prompt uses the latest explicit choice in it, the person's own first. Queued messages with conflicting choices keep separate ordered dispatches.
One provider prompt has one session mode. A batch released by an interrupt or a person's prompt uses the latest explicit choice in it, the person's own first. Steers with conflicting choices keep separate ordered dispatches.
The pending message window is in memory. Clean shutdown flushes it, held messages included, before
closing agents; an abrupt crash can lose queued prompts. A durable send receipt remains pending until actual dispatch
-6
View File
@@ -121,12 +121,6 @@ from `packages/app/android`:
These check terminal arrow ownership, held-key repeats and modifiers, and ordinary text-field editing.
Run the terminal module's tests the same way with `:paseo-terminal:connectedDebugAndroidTest`. Besides
row layout, they check that the terminal input asks the keyboard not to learn what is typed
(`IME_FLAG_NO_PERSONALIZED_LEARNING`), so passwords typed at a prompt stay out of Gboard's
suggestions in other apps. React Native's TextInput has no prop for that flag, and it replaces
`imeOptions` when `returnKeyType` or `disableFullscreenUI` is set, so the terminal input sets neither.
Run the display density regression tests the same way:
```bash
-1
View File
@@ -102,7 +102,6 @@ Each agent is stored as a separate JSON file, grouped by project directory.
| `config` | `SerializableConfig?` | Agent session configuration (see below) |
| `runtimeInfo` | `RuntimeInfo?` | Live runtime state (see below) |
| `features` | `AgentFeature[]?` | Provider-reported features (toggles/selects) |
| `sessionMetrics` | `AgentMetric[]?` | Provider-reported session metrics, already formatted for display; the latest report replaces the list |
| `persistence` | `PersistenceHandle?` | Handle for resuming sessions |
| `lastError` | `string?` (nullable) | Last error message, if any |
| `requiresAttention` | `boolean?` | Whether the agent needs user attention |
+2 -2
View File
@@ -78,7 +78,7 @@ In the composer, the first glyph's ink starts on the text column's edge, and the
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 takes presses over its size's control height without adding that height to its row. 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.
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.
A `<Pressable>` wrapping a `<Text>` is a sixth variant. It is wrong. `<Button>` accepts `style`, `textStyle`, `leftIcon`, `disabled`, `size`, and `variant`.
@@ -134,7 +134,7 @@ A section or group explains itself through the `info` prop on `<SettingsSection>
Cards inside a section sit closer than sections. Rows inside a card touch — only the divider separates them. The rhythm is page → spacious; section → spacious; card → tight.
Rows have generous vertical padding: roughly 16px of content plus 16px of vertical padding for settings rows, 8–12px for sidebar list items where many rows must fit. Every row is at least as tall as one holding a switch, so text rows, switch rows and rows that open something (`<SettingsDetailRow>`, a collapsible row's header) line up. A row holding a button or a select is taller. Compressing rows below the established density to fit more on the screen is wrong. Too many rows means more cards or more sections, not smaller rows.
Rows have generous vertical padding: roughly 16px of content plus 16px of vertical padding for settings rows, 8–12px for sidebar list items where many rows must fit. A row that opens something (`<SettingsDetailRow>`, a collapsible row's header) is at least as tall as one holding a default control, so a list where only some of those rows carry a switch keeps one row height. Other rows take their content's height. Compressing rows below the established density to fit more on the screen is wrong. Too many rows means more cards or more sections, not smaller rows.
Rows revealed under a `<SettingsCollapsibleRow>` are nested rows, one step smaller than card rows: 8px of vertical padding, `fontSize.sm` text, `sm` controls, and one fixed height so rows with and without a trailing button line up. The collapsible row sets this for everything under it (`packages/app/src/components/settings/row-density.tsx`). Never pass a density to a row, and never pad or resize a nested row by hand. Settings rows that share a menu surface with menu rows, such as Usage's options, go inside `<MenuSettingsRows>`, which puts their labels on the menu rows' label rail (`menuRowContentInset`).
+1 -1
View File
@@ -57,7 +57,7 @@ Authoritative terminology. UI label wins. Don't invent synonyms; use what's here
- **Agent controls** — Provider, model, mode, thinking, and provider-feature controls for an agent or draft agent. Code: `AgentControls` / `DraftAgentControls` (`packages/app/src/composer/agent-controls/index.tsx`). Forbidden: "Agent status bar".
- **Composer footer** — Optional area rendered below the composer input but still inside the keyboard-shifted composer layout. Code: `Composer.footer` (`packages/app/src/composer/index.tsx`).
- **Composer track** — A contextual lane at the foot of a pane, by the composer input. Specific tracks use the `<thing> track` form: **Queue track**, **Subagents track**, **Tasks track**. The subagents and tasks tracks are pills floating over the transcript, each opening a panel with its rows; the queue track is a lane inside the composer itself. Code: queue track inside `Composer` (`packages/app/src/composer/index.tsx`), pill and panel frame in `packages/app/src/composer/tracks.tsx`, `SubagentsTrack` (`packages/app/src/subagents/track.tsx`), `AgentTaskList` (`packages/app/src/composer/task-list/index.tsx`).
- **Steer** — A follow-up admitted into an agent's already-running turn instead of interrupting it. Interrupting the turn discards steers the provider has not read yet; there is no take-back short of that, and no provider offers one. The stop button and Escape both interrupt. A steer the provider never read keeps its transcript row, matching Codex. Sending while the agent waits on a permission denies that request first, so the message reaches the same turn instead of stalling behind it. UI: "Send and steer". Code: `steerActiveTurn` (`packages/server/src/server/agent/agent-sdk-types.ts`). Don't confuse with **Queue track**, which holds messages client-side until the turn ends and never enters the running turn. An agent sender's `activeTurnBehavior: "steer"` (CLI `--behavior steer`) means the same as a person's steer. Agent senders default to `queue` instead: the daemon holds the message until the running turn ends, as the queue track does for a person. Forbidden: "Delivery", "Queued prompt".
- **Steer** — A follow-up admitted into an agent's already-running turn instead of interrupting it. Interrupting the turn discards steers the provider has not read yet; there is no take-back short of that, and no provider offers one. The stop button and Escape both interrupt. A steer the provider never read keeps its transcript row, matching Codex. Sending while the agent waits on a permission denies that request first, so the message reaches the same turn instead of stalling behind it. UI: "Send and steer". Code: `steerActiveTurn` (`packages/server/src/server/agent/agent-sdk-types.ts`). Don't confuse with **Queue track**, which holds messages client-side until the turn ends and never enters the running turn. Forbidden: "Delivery", "Queued prompt".
- **Subagent** — User-facing term for an agent session related to a parent agent session. Use **subagents** in UI copy and docs. Internal daemon/provider plumbing may say "child agent" or `child_session`, especially for provider-managed imports; do not surface "child agent" as a product term.
- **Attachment tray** — The selected-attachments row inside the composer input, above the text input. Code: `renderAttachmentTray` (`packages/app/src/composer/index.tsx`). Forbidden: "Attachment bar".
- **Fork** — Starting a NEW agent session seeded with a copy of another session's curated chat history. The history rides along as a `chat_history` composer attachment on a draft; the fork does **not** resume or branch the provider-side session, and the source session keeps running untouched. Two targets, one surface, one RPC (`agent.fork_context`, gated on the `agentForkContext` host feature). UI: the fork menu lives in the assistant turn footer and offers "Fork in a new tab" / "Fork in a new workspace". On a **completed** turn it sits beside the copy button and pins a boundary to that turn, so the fork stops where the turn ended. On the **in-flight** turn it sits beside the progress loader and elapsed timer, and omits the boundary entirely — `selectForkContextRows` projects the whole timeline when no boundary is given, so the fork captures everything **up to now**, including the response still streaming. That omission is what makes mid-run forking work; pinning a boundary there would silently drop the live response. Forbidden on provider-subagent (read-only) panes. Code: `useForkAgent` (`packages/app/src/hooks/use-fork-agent.ts`), `selectForkContextRows` (`packages/server/src/server/agent/activity-curator.ts`). Don't confuse with: git fork (unrelated; Paseo has no such concept), **Worktree** (filesystem isolation, not history copying).
+2 -3
View File
@@ -72,9 +72,8 @@ hashes, never prompts, environment values, or credentials.
Before messaging an archived workspace, call `workspace.recovery.inspect.request`, then
`workspace.recovery.restore.request` and await success. The native message handler unarchives the
agent and loads its persisted provider session. A Hub message is a direct send (no `sourceAgentId`), so
`activeTurnBehavior: "steer"` uses the provider's native steering and interrupts the running turn
when that provider cannot steer. The daemon rejects `queue` on a direct send.
agent and loads its persisted provider session. `activeTurnBehavior: "steer"` uses the provider's
native steering behavior, including Paseo's existing behavior when that provider cannot steer.
Execution completion and arrival-specific output authority remain Hub responsibilities.
The older `hub.execution.*` RPCs remain accepted for existing clients. Their execution ownership
+6 -29
View File
@@ -14,42 +14,19 @@ Workspace file links use the shared file-link resolver. The workspace supplies i
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 (fixed in the fork).
## The fork
The library is a private workspace, `packages/react-native-enriched-markdown`. It is upstream [enriched-markdown](https://github.com/software-mansion/enriched-markdown) at npm `1.2.0-nightly-20261014-766fc0e67` (upstream commit `766fc0e67`) plus Paseo's changes, which lived in a `patch-package` patch until the package moved into the repository. It is never published. Keep the name `react-native-enriched-markdown`: autolinking, the Gradle project `:react-native-enriched-markdown`, the CocoaPods spec and app imports all use it.
The package keeps the npm tarball's layout, including its build output:
- Metro, Vitest and TypeScript load `lib/`, not `src/`. A JavaScript change edits `src/` and the matching `lib/module` and `lib/typescript` files.
- `android/generated` and `ios/generated` are checked-in codegen output (`includesGeneratedCode`). A change to a native component spec regenerates both; `scripts/postinstall-patches.test.mjs` compares them against the specs.
- `src/web/wasm/md4c.js` and `lib/module/web/wasm/md4c.js` are an Emscripten build of `cpp/md4c`. A parser change rebuilds them with upstream's `packages/core/cpp/wasm/build.sh`.
- Upstream's Gradle, CMake and CocoaPods scripts detect upstream's own monorepo by the paths `packages/core` and a root `vendor/`. Do not add either path to this repository.
- `postinstall.mjs` downloads the tree-sitter grammars into the ignored `cpp/highlight/vendor/grammars` and `vendor/tree-sitter`. The `enriched-markdown` block in `packages/app/package.json` chooses the languages.
CI does not build native code or run the fork's Robolectric suites. Run `npm run test:android --workspace=@getpaseo/app` for Android changes. Native changes require a client rebuild; JavaScript refresh cannot enable compiled grammars.
Some fork changes are backports. A sync past the upstream version drops them in favour of upstream's code:
| Fork change | Upstream | Released in |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- |
| Android measurements survive parent clones | [#924](https://github.com/software-mansion/enriched-markdown/pull/924) | after `1.2.0-nightly-20261019-926ef06f0` |
| Android nested list items start their text after their own marker | [#1015](https://github.com/software-mansion/enriched-markdown/pull/1015), [#1023](https://github.com/software-mansion/enriched-markdown/pull/1023) (Android) | `1.2.0` |
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
The pinned nightly has the same React Native package and core source trees as upstream commit `73ac5085eb1fdc743973b3473d4dba65abad5261`. Compatibility was checked with React Native 0.81.5. Native dependencies must be rebuilt when changing the highlighting configuration; JavaScript refresh cannot enable compiled grammars.
Math and video are disabled. Task lists and admonitions are enabled; task checkboxes are read-only. Source adaptation spaces adjacent empty GFM table delimiters before escaping prose spoiler delimiters and decodes entity text before the engine can discard it. Code spans and fences keep their literal source. Comment HTML is normalized to Markdown before parsing; details show their summary and body expanded.
Mermaid fences use the existing isolated diagram runtime and fullscreen viewer. Web dispatches them through the library’s code-block override. Native has no block-renderer hook, so the renderer extracts only Mermaid fences and places the existing WebView host between library-rendered segments. This is the only block exception; see [native selection limitations](native-text-selection.md) for diagram grouping and leading inline images. Streaming keeps the last valid diagram visible while the next revision renders.
Code blocks and plain quotes have a copy control in their top trailing corner. Native code blocks use the library's compiled grammars. On native, the code block and quote container views share one control (`HeaderCopyButton` on Android, `ENRMHeaderCopyButton` on iOS). A quote reserves the code block's header band above its body, so the control never covers quote text at any font size. On web, code blocks use `HighlightedCodeBlock` through the library's `renderers.codeBlock` override, and quotes use `WebBlockquote` through `renderers.blockquote`. Both use `BlockCopyButton`. On compact layouts the control is always visible, so the web quote reserves a band above its body, as native does. On wide layouts the control appears on hover or focus, so the quote keeps a right gutter instead; a band there would leave an empty strip above every quote.
Native code blocks use the library's copy control and compiled grammars. Web code blocks use `HighlightedCodeBlock` through the library's `renderers.codeBlock` override. Selection copy has to tell links Paseo recognized in the text (paths, forge references, code spans) from links in the Markdown, so the web link renderer marks the recognized ones. Plain-text paste carries them as the text the reply showed, and rich paste keeps them as links only when they point to an `http` or `https` URL. Authored links and parser autolinks such as a bare `www.example.com` copy as links. The patch also keeps the library's block spacing around the web code block override, preserves web list numbering and link titles, marks pending parses with `aria-busy` so Find waits for rendered text, and carries link syntax through native and web tap events. Web inline code inside a link inherits only the link colour; its code font, size and background stay intact. Keep link variants colour-only: native pills replace text runs and prevent paths from wrapping; Android pills also use the surrounding block’s font size. The package patch is tracked by [upstream PR #997](https://github.com/software-mansion/enriched-markdown/pull/997); remove the patch when the pinned release includes it.
A quote copies its body without the `>` markers, with its nested Markdown, and reads the content at the time of the press, so a streaming quote copies what it shows. A nested quote or code block keeps its own control. Web quote copy uses the same two clipboard flavors as selection copy: `text/plain` is unescaped Markdown and `text/html` is rendered from escaped Markdown. A rendered Mermaid diagram copies as its fence because its wrapper carries the fence source. Native quote copy serializes the quote's parsed Markdown, so a workspace image copies as its cached file URL, as native selection copy does; native has no map back to the workspace path. A native Mermaid diagram in a quote renders outside it (see [native selection limitations](native-text-selection.md)), so each quote fragment copies only its own text. Admonitions get no control: web renders them with a separate library renderer. On web an admonition inside a copied quote copies as its `> [!TYPE]` source; the fork marks the box and its generated title for this. Selection copy keeps the text it shows, because the cloned range cannot tell a whole callout from part of one. On native, quotes inside list items get no control, because they render as text spans in the item. Web renders them as blocks, so they get one.
Selection copy has to tell links Paseo recognized in the text (paths, forge references, code spans) from links in the Markdown, so the web link renderer marks the recognized ones. Plain-text paste carries them as the text the reply showed, and rich paste keeps them as links only when they point to an `http` or `https` URL. Authored links and parser autolinks such as a bare `www.example.com` copy as links. The fork also keeps the library's block spacing around the web code block override, preserves web list numbering and link titles, marks pending parses with `aria-busy` so Find waits for rendered text, and carries link syntax through native and web tap events. Web inline code inside a link inherits only the link colour; its code font, size and background stay intact. Keep link variants colour-only: native pills replace text runs and prevent paths from wrapping; Android pills also use the surrounding block’s font size. [Upstream PR #997](https://github.com/software-mansion/enriched-markdown/pull/997) tracks these changes.
The fork also keeps overflowing native horizontal blocks in control of their drags: Android claims parent interception at touch-down and releases it for vertical drags so the chat list can scroll; iOS keeps its scroll recognizer active for outward drags at the leading edge. This prevents compact sidebar pans from taking block scrolling without changing sidebar swipes on prose or non-overflowing blocks. Native changes require a client rebuild.
The package patch also keeps overflowing native horizontal blocks in control of their drags: Android claims parent interception at touch-down and releases it for vertical drags so the chat list can scroll; iOS keeps its scroll recognizer active for outward drags at the leading edge. This prevents compact sidebar pans from taking block scrolling without changing sidebar swipes on prose or non-overflowing blocks. Native changes require a client rebuild.
On iOS a newly mounted Markdown view paints empty for a frame or more after it is laid out at its measured height: the library parses even a view's first content on a background queue and applies it in a later main-queue turn. Expanding a turn in chat therefore shows its rows in place with the text arriving a frame later (165 ms when the mount keeps the main thread busy). Android paints the text in the first frame. Rendering a view's first content synchronously fixes the frame but costs frame time when a fling mounts history rows, so the app keeps the library's behavior until [enriched-markdown #1131](https://github.com/software-mansion/enriched-markdown/issues/1131) is resolved.
@@ -59,4 +36,4 @@ The library determines how incomplete Markdown appears during streaming. Complet
## Verification
Follow [QA](qa.md) and [mobile testing](mobile-testing.md). Exercise chat, file preview, plan and PR content on all three platforms. Include cross-paragraph selection, progressive streaming, a file-link tap, code copy/highlighting, quote copy (nested quote, code block in a quote, admonition, large font on native), a table and a workspace image. On iPad, repeat preview selection after opening and closing Explorer and after rotation. Check web find, selection-copy and source-message navigation after DOM changes.
Follow [QA](qa.md) and [mobile testing](mobile-testing.md). Exercise chat, file preview, plan and PR content on all three platforms. Include cross-paragraph selection, progressive streaming, a file-link tap, code copy/highlighting, a table and a workspace image. On iPad, repeat preview selection after opening and closing Explorer and after rotation. Check web find, selection-copy and source-message navigation after DOM changes.
+2 -23
View File
@@ -221,32 +221,11 @@ Plugin callbacks follow the same contract; see [plugin providers](plugins.md#con
`ProviderSnapshotManager` owns one refresh deadline per provider. The deadline starts before the
availability check and covers that check plus the complete catalog probe. Providers that make
multiple catalog requests must not apply this deadline separately to each request. The manager
aborts the shared refresh signal at the deadline, and when it stops. Shutdown waits for running
probes to settle before it shuts down provider clients, so a probe cannot start provider work,
such as an OpenCode server, after its client has cleaned up. Providers name active catalog operations and
aborts the shared refresh signal at the deadline. Providers name active catalog operations and
finish subprocess, server, or session cleanup before rejecting. Timeout errors list the operations
that were still active when the deadline expired.
Catalogue results stay cached by identity until a refresh or a change to that provider's configuration.
Providers change their model lists on the server without a CLI update, so the daemon refreshes
each enabled provider about every 30 minutes (`ProviderRefreshSchedule`). One timer ticks
`30 min / enabled providers` apart, and each tick starts at most one refresh: the provider refreshed
longest ago, if that was a full interval ago. Ticks do not wait for refreshes, so a provider that
probes many workspace targets does not delay the others, and provider CLIs never start in a burst.
Any forced refresh, configuration change, or newly enabled provider counts as a refresh and pushes
that provider's next one back a full interval.
The background refresh takes the settings refresh path for one provider, with these differences:
- It joins discovery already in flight.
- It passes `force: false`, because providers treat `force` as a requested hard refresh. OpenCode
rotates its shared server on it.
- An unchanged catalogue keeps the published record and its `fetchedAt`, so idle clients receive
no update.
- A result that is not ready, or a catalogue the provider marks `incomplete`, keeps a ready
catalogue. Plugin status probes report a failed startup as unavailable, so that counts as
transient. Set `ProviderCatalog.incomplete` when discovery fails and you fall back to a partial
list, as Claude does when model discovery times out. A manual refresh still publishes all three.
Catalogue results stay cached by identity until explicit refresh or a change to that provider's configuration.
Keys are resolved on each read so project configuration can select a different cached catalogue.
Selector opening may read a loading or stale query, but does not force provider probing.
+16 -38
View File
@@ -659,7 +659,6 @@ No prefix (`v`), no extra text. `Release Notes Sync` matches the `## X.Y.Z` (or
- `CHANGELOG.md` holds stable releases and at most one entry for the current beta series.
- The first beta of a version inserts a top entry like `## 0.1.60-beta.1 - YYYY-MM-DD`.
- Each subsequent beta rewrites that entry in place: the heading becomes the new beta number and date, and the body describes the full change from the previous stable release to this beta. Never add a second beta entry.
- The entry announces changes and leaves setup steps, click paths, migration notes, configuration keys, hedges and edge cases to product docs. The headline change is the first highlight. [Changelog conciseness](#changelog-conciseness) and [Changelog ordering](#changelog-ordering) hold the rules.
- The entry is a list of changes, not of PRs. When a later beta reverts, reworks, or follows up on something an earlier beta added, rewrite the bullet to the current behavior or delete it. A stable user never saw the earlier beta behavior, so fixes to it are not "Fixed" bullets.
- Anything that already shipped to stable through a patch release on an older line stays out of the beta entry.
- Stable promotion renames the entry to `## 0.1.60 - YYYY-MM-DD` after a final review.
@@ -715,30 +714,14 @@ claims a general improvement, rewrite it with the concrete change.
## Changelog conciseness
An entry announces what changed. Product docs own setup, navigation, migration and edge cases, and the PR link leads to the rest. These rules apply to highlights and section bullets.
Every section bullet must be scannable at a glance. The changelog is not release documentation — it's a list. [Highlights](#changelog-highlights) get more room; every other bullet follows these limits.
- **No instructions.** Cut setup steps, click paths, configuration keys, flags and migration notes. "Open a provider's settings from Settings, setup, or the model picker" is a click path. "Existing goose settings and sessions carry over to the bundled plugin" is a migration note.
- **One warning for a breaking requirement.** When the update stops something working until the user acts, state the requirement in one short sentence after the announcement, and link the product doc that has the steps: "Requires [Antigravity CLI 1.5.0 or later](https://paseo.sh/docs/supported-providers/antigravity)." Nothing else earns a second sentence.
- **No hedges or exception clauses.** Cut "when needed", "for eligible models", "on hosts where…", "except…", "with a hint shown when…" and "across common install shapes". Keep the condition that triggers a fixed failure, as in `Fixed <failure> when <condition>`.
- **The shorter bullet is still true.** When a change reaches only some providers, platforms or file types, name what it covers in the sentence's own words: "update supported CLIs" where one provider has no update command, "Markdown previews and source views" where HTML previews on iOS are left out, "by default" where an explicit interrupt still replaces the turn. Do not widen the claim to remove a clause.
- **State the outcome and stop.** Say what the user gets. Leave out queues, snapshots, caches, timeouts, LAN/WAN topology, TLS handshakes and IPC.
Each row is from the first draft of 0.17.1:
| Avoid | Write |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| Open a provider's settings from Settings, setup, or the model picker to update supported CLIs and watch their output | Update supported CLIs from the app |
| Use Antigravity CLI 1.5.0 or later on the daemon host, and include `acp` if you override its command | Requires Antigravity CLI 1.5.0 or later |
| Reports and notifications from other agents arrive in order when the current turn ends instead of interrupting it. An interrupt or your own prompt carries earlier queued messages in the same turn, and Stop holds queued messages until the next prompt | By default, messages from other agents wait for the current turn to end |
| Changed worktree teardown to keep the worktree when the command exceeds one minute or the `worktree.teardownTimeoutMs` limit in `paseo.json` | Changed worktree teardown to keep the worktree when the command times out |
| Fixed file views losing their scroll position when switching Preview and Source, except HTML previews on iOS | Fixed Markdown previews and source views losing their scroll position when switching between them |
Section bullets also follow these limits:
- **One sentence per bullet, max.** A second sentence is documentation. Cut it.
- **One sentence per bullet, max.** If a bullet contains two sentences, the second one is doing work that belongs in product docs, not the changelog. Cut it.
- **No trailing periods.** Bullets are list items, not prose. Drop the period at the end of every bullet, including the period inside any bolded lead-in. `**Configurable terminal scrollback**` not `**Configurable terminal scrollback.**`.
- **One line per bullet.** If a bullet wraps to three lines in a narrow column, it's too long.
- **Split bullets that pack multiple distinct changes.** If a bullet uses "and", "plus", a comma list, or an em-dash to chain several independent improvements, break them into separate bullets — even when they share a theme or author. One bullet = one user-facing change.
- **Trim qualifying clauses.** Drop "with a hint shown when…", "matching the CLI's behaviour", "across common install shapes". If the detail doesn't change whether a user cares, cut it.
- **Stop after identifying the change.** Do not explain LAN/WAN topology, TLS handshakes, IPC, or other architecture in a changelog bullet. Put necessary background in product docs.
- **Attribution follows the split.** When you split a dense bullet, move each PR/author to the bullet it belongs to. Never duplicate the same PR across multiple bullets.
## Changelog highlights
@@ -751,7 +734,7 @@ reader who stops after the highlights should have missed nothing they would ask
```markdown
## 0.16.0 - 2026-11-20
- **Undo workspace archive:** Restore an archived workspace with Undo or Cmd/Ctrl+Z. ([#8904](https://github.com/getpaseo/paseo/pull/8904))
- **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. ([#8904](https://github.com/getpaseo/paseo/pull/8904))
### Added
```
@@ -762,19 +745,17 @@ reader who stops after the highlights should have missed nothing they would ask
- **The lead-in is not a place or something Paseo already had.** A device, screen or area names
where the change landed. A feature name that was true of the last release hides the news: Paseo
already had keyboard shortcuts, so the lead-in says they now work on mobile.
- **One short sentence says the plain thing.** Write what a user would tell a friend: Paseo now
- **The first sentence says the plain thing.** Write what a user would tell a friend: Paseo now
shows the background tasks an agent is running. Leave out the conditions and mechanics that make
it true. A second sentence is only for a
[breaking requirement](#changelog-conciseness).
it true.
- **Describe the new behavior, not the old one.** Say what is faster or better now, and do not
dwell on how slow or broken it was before. A number is welcome as a short aside after the new
behavior is stated: seconds, a percentage, a multiple.
- **Do not list what a sentence already covers.** After "the same shortcuts as desktop", naming
five of them adds nothing. Keep a list only when it sets the scope, such as the providers a
feature works with.
- **Sentences end with periods, and the attribution follows the last one.**
[Changelog wording](#changelog-wording) and [Changelog conciseness](#changelog-conciseness)
apply.
- **The description runs one to three sentences.** Sentences end with periods, and the attribution
follows the last one. [Changelog wording](#changelog-wording) applies in full.
- **A highlight replaces the section bullets it covers.** A PR appears once in an entry, so its
attribution moves to the highlight.
- **A highlight is something a user would name.** Everything else stays a section bullet. A patch
@@ -783,13 +764,13 @@ reader who stops after the highlights should have missed nothing they would ask
of related fixes, becomes a highlight only when it passes the same test as a feature, and then
it is written as what works now: `**Fewer reconnects on return:**`.
| Avoid | Write |
| ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| `**iPad and touch screens:**` | `**Touch-sized tablet controls:**` |
| `**Hardware keyboard shortcuts:**` | `**Keyboard shortcuts on mobile:**` |
| When an agent ends its turn while shells it started are still running, a pill lists them | Paseo now shows the background tasks an agent is running |
| A diff no longer waits 4 to 40 seconds behind worktree scans | Opening Changes shows the file tree right away, and diffs load about 6 times sooner |
| The same shortcuts as desktop: command center, file picker, new workspace, workspace jumps | The same shortcuts as desktop, including your custom bindings |
| Avoid | Write |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `**iPad and touch screens:**` | `**Touch-sized tablet controls:**` |
| `**Hardware keyboard shortcuts:**` | `**Keyboard shortcuts on mobile:**` |
| When an agent ends its turn while shells it started are still running, a pill lists them | Paseo now shows the background tasks an agent is running |
| A diff no longer waits 4 to 40 seconds behind worktree scans | Opening Changes shows the file tree right away, and diffs load about 6 times sooner on hosts with many worktrees |
| The same shortcuts as desktop: command center, file picker, new workspace, workspace jumps | The same shortcuts as desktop, including your custom bindings |
Before showing a draft, read only the bold lead-ins top to bottom. Each one must answer "what is
new?" without its description, and each must outrank the one below it.
@@ -839,9 +820,6 @@ question.
for them: `Undo workspace archive`, `Fewer reconnects on return`. Fixes are routine, so one
that earned a highlight still follows everything new or improved.
- **The headline change goes first, whatever its group.** It is the change the release is announced
with. 0.17.1 leads with `Antigravity approvals and history`, which needs one provider. The groups
rank everything after it.
- **Reach decides before kind.** A new capability that needs a hardware keyboard is in group 3.
- **Rank the whole list in one pass.** The order you collected the pull requests in, the alphabet
and the order of the sections below are not rankings.
@@ -1,5 +1,3 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -1,5 +1,3 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -1,5 +1,3 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -1,5 +1,3 @@
- Antigravity approvals and history: Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires Antigravity CLI 1.5.0 or later.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request.
- Update providers in Paseo: See each provider's status and installed version, and update supported CLIs from the app.
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
Full notes: https://paseo.sh/changelog
@@ -1,5 +0,0 @@
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
-1
View File
@@ -72,7 +72,6 @@
"project": ["src/**/*.ts"]
}
},
"ignoreWorkspaces": ["packages/react-native-enriched-markdown"],
"ignoreDependencies": [
"sherpa-onnx-node",
"@playwright/test",
-2
View File
@@ -30,8 +30,6 @@ buildNpmPackage {
# Exclude mobile-only platform code (we only need the web/electron build)
!(lib.hasPrefix "/packages/app/android" relPath)
&& !(lib.hasPrefix "/packages/app/ios" relPath)
&& !(lib.hasPrefix "/packages/react-native-enriched-markdown/android" relPath)
&& !(lib.hasPrefix "/packages/react-native-enriched-markdown/ios" relPath)
# Website is unrelated to the desktop app
&& !(lib.hasPrefix "/packages/website" relPath)
# Documentation, CI definitions and agent/editor configuration. None of
+1 -1
View File
@@ -1 +1 @@
sha256-W725BRG14xajMsR4t8Y3NmxppMnJ8AUd7Kdb6F7LmMw=
sha256-esZ6cghL+VfK01yLZlFIK/M94+q0a2e+od3rvA3lPqo=
+49 -114
View File
@@ -1,18 +1,17 @@
{
"name": "paseo",
"version": "0.17.3",
"version": "0.17.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.17.3",
"version": "0.17.1",
"hasInstallScript": true,
"license": "Apache-2.0",
"workspaces": [
"plugins",
"packages/expo-two-way-audio",
"packages/react-native-enriched-markdown",
"packages/highlight",
"packages/plugin",
"packages/protocol",
@@ -8520,52 +8519,6 @@
"integrity": "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==",
"license": "BSD-2-Clause"
},
"node_modules/@modelcontextprotocol/client": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/client/-/client-2.4.0.tgz",
"integrity": "sha512-LgrD2OphHuG12vfKFKz6SOnq7bKHQmhGJIAYdD+MZBn2npHEyry6uD8zvktodtl5CQM85MO0anUyD9JwmUmxww==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@modelcontextprotocol/core": "2.4.0",
"cross-spawn": "^7.0.5",
"eventsource": "^3.0.2",
"eventsource-parser": "^3.0.8",
"jose": "^6.1.3",
"pkce-challenge": "^5.0.0",
"zod": "^4.2.0"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@modelcontextprotocol/core": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.4.0.tgz",
"integrity": "sha512-z8QBKqdfXLPzkLQuG4xp8hrVEMm1PZ1IgxMN2sMbJiFiAKOWXnAzogXn2W4aqIBlP1ea6U5yiqVquvUNM1Cj6Q==",
"dependencies": {
"zod": "^4.2.0"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@modelcontextprotocol/node": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/node/-/node-2.1.2.tgz",
"integrity": "sha512-IIcIqBpr6NCQQs5DgJTgvbSOAw+3iaR/uquqg+e0nXCdudfjPg/80x0TseUnQx14AUAtE4fsJCEpJKPyb6WPVA==",
"license": "Apache-2.0",
"dependencies": {
"@hono/node-server": "^1.19.9 || ^2.1.3",
"hono": "^4.11.4"
},
"engines": {
"node": ">=20"
},
"peerDependencies": {
"@modelcontextprotocol/server": "^2.4.0"
}
},
"node_modules/@modelcontextprotocol/sdk": {
"version": "1.29.0",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz",
@@ -8952,19 +8905,6 @@
"url": "https://opencollective.com/express"
}
},
"node_modules/@modelcontextprotocol/server": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.4.0.tgz",
"integrity": "sha512-rgR9yxSaAJ+bcsi/XroT/S2AfPiIWloXAnrdfYSCms9ivVju0ishu/wW0J21Ho6+ZOR1r7RyeRbjiRuF87ix5Q==",
"license": "Apache-2.0",
"dependencies": {
"@modelcontextprotocol/core": "2.4.0",
"zod": "^4.2.0"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.4.tgz",
@@ -20638,9 +20578,9 @@
}
},
"node_modules/eventsource-parser": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.1.tgz",
"integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==",
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz",
"integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==",
"license": "MIT",
"engines": {
"node": ">=18.0.0"
@@ -31962,10 +31902,6 @@
"react-native": "*"
}
},
"node_modules/react-native-enriched-markdown": {
"resolved": "packages/react-native-enriched-markdown",
"link": true
},
"node_modules/react-native-gesture-handler": {
"version": "2.32.0",
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.32.0.tgz",
@@ -37541,7 +37477,7 @@
},
"packages/app": {
"name": "@getpaseo/app",
"version": "0.17.3",
"version": "0.17.1",
"dependencies": {
"@codemirror/commands": "6.10.4",
"@codemirror/language": "6.12.4",
@@ -37625,7 +37561,7 @@
"react-native": "0.86.3",
"react-native-draggable-flatlist": "^4.0.3",
"react-native-edge-to-edge": "^1.7.0",
"react-native-enriched-markdown": "*",
"react-native-enriched-markdown": "1.2.0-nightly-20261014-766fc0e67",
"react-native-gesture-handler": "~2.32.0",
"react-native-keyboard-controller": "1.21.12",
"react-native-nitro-modules": "0.35.5",
@@ -39538,6 +39474,23 @@
"dev": true,
"license": "MIT"
},
"packages/app/node_modules/react-native-enriched-markdown": {
"version": "1.2.0-nightly-20261014-766fc0e67",
"resolved": "https://registry.npmjs.org/react-native-enriched-markdown/-/react-native-enriched-markdown-1.2.0-nightly-20261014-766fc0e67.tgz",
"integrity": "sha512-PyYAAVJAyjlcqHXgSnzxok13MDmyxs/nt46hHIOBdCc0prfaL2Ef6nYkZu7fFCeaETOJXd/xQr4n2/79I+gvdA==",
"hasInstallScript": true,
"license": "MIT",
"peerDependencies": {
"katex": ">=0.16.0",
"react": "*",
"react-native": "*"
},
"peerDependenciesMeta": {
"katex": {
"optional": true
}
}
},
"packages/app/node_modules/react-native-keyboard-controller": {
"version": "1.21.12",
"resolved": "https://registry.npmjs.org/react-native-keyboard-controller/-/react-native-keyboard-controller-1.21.12.tgz",
@@ -39694,13 +39647,13 @@
},
"packages/cli": {
"name": "@getpaseo/cli",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/server": "0.17.3",
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/server": "0.17.1",
"chalk": "^5.3.0",
"commander": "^12.0.0",
"mime-types": "^2.1.35",
@@ -39947,11 +39900,11 @@
},
"packages/client": {
"name": "@getpaseo/client",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/protocol": "0.17.3",
"@getpaseo/relay": "0.17.3",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/relay": "0.17.1",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
@@ -39963,7 +39916,7 @@
},
"packages/desktop": {
"name": "@getpaseo/desktop",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/cli": "*",
@@ -40206,7 +40159,7 @@
},
"packages/expo-two-way-audio": {
"name": "@getpaseo/expo-two-way-audio",
"version": "0.17.3",
"version": "0.17.1",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.14",
@@ -40252,7 +40205,7 @@
},
"packages/highlight": {
"name": "@getpaseo/highlight",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@codemirror/language": "6.12.4",
@@ -40282,7 +40235,7 @@
},
"packages/plugin": {
"name": "@getpaseo/plugin",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^1.4.0",
@@ -40290,8 +40243,8 @@
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@types/node": "^20.9.0",
"@types/react": "~19.2.0",
"react": "19.2.3",
@@ -40301,8 +40254,8 @@
"zod": "^4.4.3"
},
"peerDependencies": {
"@getpaseo/client": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/client": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"react": ">=19.1.0 <20",
"react-native": ">=0.81.5",
"zod": "^4.4.3"
@@ -40324,7 +40277,7 @@
},
"packages/protocol": {
"name": "@getpaseo/protocol",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"semver": "^7.8.5",
@@ -40350,24 +40303,9 @@
"node": ">=10"
}
},
"packages/react-native-enriched-markdown": {
"version": "0.17.1",
"hasInstallScript": true,
"license": "MIT",
"peerDependencies": {
"katex": ">=0.16.0",
"react": "*",
"react-native": "*"
},
"peerDependenciesMeta": {
"katex": {
"optional": true
}
}
},
"packages/relay": {
"name": "@getpaseo/relay",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@noble/ciphers": "^2.4.0",
@@ -40589,21 +40527,19 @@
},
"packages/server": {
"name": "@getpaseo/server",
"version": "0.17.3",
"version": "0.17.1",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "^0.17.1",
"@anthropic-ai/claude-agent-sdk": "0.3.326",
"@anthropic-ai/sdk": "^0.104.2",
"@getpaseo/client": "0.17.3",
"@getpaseo/highlight": "0.17.3",
"@getpaseo/plugin": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/relay": "0.17.3",
"@getpaseo/client": "0.17.1",
"@getpaseo/highlight": "0.17.1",
"@getpaseo/plugin": "0.17.1",
"@getpaseo/protocol": "0.17.1",
"@getpaseo/relay": "0.17.1",
"@isaacs/ttlcache": "^2.1.4",
"@modelcontextprotocol/node": "2.1.2",
"@modelcontextprotocol/sdk": "1.29.0",
"@modelcontextprotocol/server": "2.4.0",
"@opencode-ai/sdk": "1.14.46",
"@opencode/client": "2.0.10",
"@xterm/addon-serialize": "0.14.0",
@@ -40642,7 +40578,6 @@
"zod": "^4.4.3"
},
"devDependencies": {
"@modelcontextprotocol/client": "2.4.0",
"@playwright/test": "^1.56.1",
"@types/express": "^4.17.20",
"@types/markdown-it": "^14.2.0",
@@ -41549,7 +41484,7 @@
},
"packages/website": {
"name": "@getpaseo/website",
"version": "0.17.3",
"version": "0.17.1",
"dependencies": {
"@cloudflare/vite-plugin": "^1.29.1",
"@cloudflare/workers-types": "^4.20260317.1",
@@ -43160,7 +43095,7 @@
},
"plugins": {
"name": "@getpaseo/builtin-plugins",
"version": "0.17.3",
"version": "0.17.1",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.17.3",
"version": "0.17.1",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -23,7 +23,6 @@
"workspaces": [
"plugins",
"packages/expo-two-way-audio",
"packages/react-native-enriched-markdown",
"packages/highlight",
"packages/plugin",
"packages/protocol",
@@ -430,8 +430,7 @@ async function expectFooterWithinWidth(page: Page, width: number): Promise<void>
const label = page.getByRole("button", { name: /^Worked for/ }).last();
await expect(label).toBeVisible();
await expectTimingInsideFooter(page);
await expect(footer.getByRole("button", { name: "Turn stats" })).toBeVisible();
const controls = footer.getByRole("button", { name: /Copy turn|Fork chat|Turn stats/ });
const controls = footer.getByRole("button", { name: /Copy turn|Fork chat/ });
const before = await controls.evaluateAll((elements) =>
elements.map((element) => {
const rect = element.getBoundingClientRect();
@@ -757,161 +757,6 @@ test("pasting an assistant selection preserves literal underscores and authored
}
});
const QUOTE_BODY = [
"Draft for the team: **ship it** with [the notes](https://example.com/notes).",
"",
"> Nested reply.",
"",
"```ts",
"const quoted = 1;",
"```",
"",
"```mermaid",
"flowchart LR",
" Start --> Done",
"```",
"",
"Thanks!",
].join("\n");
const QUOTE_MARKDOWN = [
"Text before the quote.",
"",
...QUOTE_BODY.split("\n").map((line) => (line ? `> ${line}` : ">")),
"",
"> [!NOTE]",
"> Heads up before you paste.",
"",
"Text after the quote.",
].join("\n");
function assistantQuote(page: Page, index: number): Locator {
return assistantMessageBlocks(page).getByRole("blockquote").nth(index);
}
/** A quote's own control is its first, ahead of any nested quote's. */
function quoteCopyControl(quote: Locator): Locator {
return quote.getByRole("button", { name: "Copy quote" }).first();
}
async function copyQuote(quote: Locator): Promise<void> {
await quote.hover();
await quoteCopyControl(quote).click();
await expect(quote.getByRole("button", { name: "Copied" })).toBeVisible();
}
async function pasteIntoPlainAndRichFields(page: Page): Promise<{ plain: Locator; rich: Locator }> {
await page.evaluate(() => {
const fields = document.createElement("div");
fields.style.cssText = "position: fixed; bottom: 0; left: 0; z-index: 10000; background: white";
const plainText = document.createElement("textarea");
plainText.setAttribute("aria-label", "Plain text paste");
const richText = document.createElement("div");
richText.contentEditable = "true";
richText.setAttribute("role", "textbox");
richText.setAttribute("aria-label", "Rich text paste");
fields.append(plainText, richText);
document.body.append(fields);
});
const plain = page.getByRole("textbox", { name: "Plain text paste" });
await plain.focus();
await page.keyboard.press("ControlOrMeta+v");
const rich = page.getByRole("textbox", { name: "Rich text paste" });
await rich.focus();
await page.keyboard.press("ControlOrMeta+v");
return { plain, rich };
}
test("a quote's copy control copies only that quote's body", async ({ context, page }) => {
const agent = await seedMockAgentWorkspace({
repoPrefix: "assistant-quote-copy-",
title: "Assistant quote copy",
initialPrompt: "Render the quote fixture.",
featureValues: { mockAssistantResponse: QUOTE_MARKDOWN },
});
try {
await allowRichClipboard(context);
await agent.client.waitForAgentUpsert(
agent.agentId,
(snapshot) => snapshot.status === "idle",
30_000,
);
await openAgentRoute(page, agent);
const quote = assistantQuote(page, 0);
const nested = assistantQuote(page, 1);
await expect(quote).toContainText("Thanks!");
await test.step("an admonition has no copy control", async () => {
await expect(assistantMessageBlocks(page)).toContainText("Heads up before you paste.");
await expect(
assistantMessageBlocks(page).getByRole("button", { name: "Copy quote" }),
).toHaveCount(2);
});
await test.step("the control appears on hover or keyboard focus", async () => {
const control = quoteCopyControl(quote);
await expect(control).toHaveCSS("opacity", "0");
await quote.hover();
await expect(control).toHaveCSS("opacity", "1");
await page.mouse.move(0, 0);
await expect(control).toHaveCSS("opacity", "0");
await control.focus();
await expect(control).toHaveCSS("opacity", "1");
await control.blur();
});
await test.step("copying the quote takes its body, with a diagram as its fence", async () => {
await expect(quote.getByRole("img", { name: "Diagram" })).toBeVisible({ timeout: 30_000 });
await copyQuote(quote);
const copied = await readRichClipboard(page);
expect(copied.plainText).toBe(QUOTE_BODY);
expect(copied.html).toContain("<strong>ship it</strong>");
expect(copied.html).toContain("<blockquote>");
});
await test.step("the copy pastes as Markdown and as rich text", async () => {
const { plain, rich } = await pasteIntoPlainAndRichFields(page);
await expect(plain).toHaveValue(QUOTE_BODY);
await expect(rich.locator("strong")).toHaveText("ship it");
await expect(rich.getByRole("link", { name: "the notes" })).toHaveAttribute(
"href",
"https://example.com/notes",
);
await expect(rich).not.toContainText("Text before the quote.");
});
await test.step("a nested quote copies only itself", async () => {
await copyQuote(nested);
await expect
.poll(async () => (await readRichClipboard(page)).plainText)
.toBe("Nested reply.");
});
await test.step("a code block in the quote keeps its own copy", async () => {
const code = quote.getByText("const quoted = 1;", { exact: true });
await code.hover();
await quote.getByRole("button", { name: "Copy code" }).first().click();
await expect.poll(() => readPlainClipboard(page)).toBe("const quoted = 1;");
});
await test.step("a phone-sized layout shows the control above the full-width text", async () => {
await page.mouse.move(0, 0);
await page.setViewportSize({ width: 390, height: 844 });
const control = quoteCopyControl(quote);
await expect(control).toHaveCSS("opacity", "1");
const controlBox = await control.boundingBox();
const firstLine = await quote.getByText(/^Draft for the team/).boundingBox();
expect(controlBox && firstLine).toBeTruthy();
// The text starts below the control instead of wrapping short of it.
expect(firstLine!.y).toBeGreaterThanOrEqual(controlBox!.y + controlBox!.height);
expect(firstLine!.x + firstLine!.width).toBeGreaterThan(controlBox!.x);
});
} finally {
await agent.cleanup();
}
});
test("copying a selection across an assistant image keeps its Markdown source and alt text", async ({
context,
page,
@@ -59,35 +59,6 @@ async function selectClientSlashCommand(page: Page, query: string, label: string
await input.press("Enter");
}
async function typeBeforeMenuFilters(
page: Page,
input: { text: string; key: "Tab" | "Enter" },
): Promise<void> {
await composerLocator(page).evaluate(async (element, { text, key }) => {
if (!(element instanceof HTMLTextAreaElement)) {
throw new Error("Composer input is not a textarea");
}
const setValue = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
if (!setValue) throw new Error("Textarea value setter is unavailable");
setValue.call(element, text);
element.setSelectionRange(text.length, text.length);
element.dispatchEvent(new Event("input", { bubbles: true }));
await Promise.resolve();
element.dispatchEvent(new KeyboardEvent("keydown", { key, bubbles: true, cancelable: true }));
await new Promise((resolve) => requestAnimationFrame(() => setTimeout(resolve, 0)));
}, input);
}
async function showExitSuggestion(page: Page, query: string): Promise<void> {
await composerLocator(page).fill(query);
await expect(page.getByText("/exit", { exact: true }).first()).toBeVisible();
}
async function expectOpenAgentWithInput(page: Page, agentId: string, text: string): Promise<void> {
await expect(composerLocator(page)).toHaveValue(text);
await expectWorkspaceTabVisible(page, agentId);
}
async function expectAgentArchivedInSessions(page: Page, title: string): Promise<void> {
await openSessions(page);
await expectSessionRowArchived(page, title);
@@ -160,16 +131,6 @@ test.describe("Client slash commands", () => {
);
});
for (const key of ["Tab", "Enter"] as const) {
test(`${key} ignores an exit suggestion for an earlier query`, async ({ page }) => {
await withOpenReadyMockAgent(page, { title: "Stale slash command" }, async ({ agentId }) => {
await showExitSuggestion(page, "/e");
await typeBeforeMenuFilters(page, { text: "/co", key });
await expectOpenAgentWithInput(page, agentId, "/co");
});
});
}
test("slash clear replaces the active agent with a matching draft", async ({ page }) => {
await withOpenReadyMockAgent(
page,
@@ -1,21 +1,4 @@
import { execFileSync } from "node:child_process";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import type { createCreationScenario } from "../support/helpers/creation";
import { gotoAppShell } from "../support/helpers/app";
import { fillComposerDraft } from "../support/helpers/composer";
import {
connectNewWorkspaceDaemonClient,
openNewWorkspaceComposer,
selectWorkspaceIsolation,
} from "../support/helpers/new-workspace";
import {
seedTerminalProfiles,
selectLaunchOption,
submitTerminalLaunch,
} from "../support/helpers/new-workspace-launch";
import { waitForSidebarHydration } from "../support/helpers/workspace-ui";
import { expect } from "../support/fixtures";
import { test } from "../support/creation-fixtures";
@@ -133,14 +116,12 @@ for (const scenario of [
test(`retrying failed agent initialization preserves its workspace${scenario.suffix}`, async ({
creation,
startup,
page,
}) => {
await creation.openWorkspaceForm("local");
await creation.submitPrompt("Retry this workspace and agent together.", "Create");
await creation.expectAgentStillStarting();
await startup.fail();
await creation.expectStartupFailure();
await expect(page.getByTestId("app-toast")).toHaveCount(0);
await creation.expectOneCreatedWorkspace();
await scenario.prepare(creation);
await creation.submitPrompt("Retry this workspace and agent together.");
@@ -199,105 +180,6 @@ test("an edited agent draft starts after its first start failed", async ({
await expect(page.getByText(/request_key_conflict/)).toHaveCount(0);
});
test("editing a failed New workspace submission starts without a request key conflict", async ({
page,
}) => {
// An empty git repository naturally rejects worktree creation before workspace_ready.
const repoDir = mkdtempSync(path.join(tmpdir(), "paseo-empty-git-ws-"));
execFileSync("git", ["init"], { cwd: repoDir, stdio: "ignore" });
const client = await connectNewWorkspaceDaemonClient();
let projectId: string | null = null;
try {
const seeded = await client.createWorkspace({
source: { kind: "directory", path: repoDir },
});
if (!seeded.workspace) throw new Error(seeded.error ?? "Failed to seed empty git project");
projectId = seeded.workspace.projectId;
const listed = await client.listProjects();
const project = listed.projects.find((entry) => entry.projectId === projectId);
if (!project?.projectKey) throw new Error("Seeded project has no projectKey");
await gotoAppShell(page);
await waitForSidebarHydration(page);
await openNewWorkspaceComposer(page, {
projectKey: project.projectKey,
projectDisplayName: seeded.workspace.projectDisplayName,
});
await selectWorkspaceIsolation(page, "worktree");
await fillComposerDraft(page, "Start original worktree task.");
await page.getByRole("button", { name: "Create", exact: true }).click();
const composerError = page.getByTestId("composer-error").filter({ visible: true }).first();
await expect(composerError).toContainText("Unable to resolve repository default branch");
// The failure renders once in the composer alert, not duplicated in a top toast.
await expect(page.getByText("Unable to resolve repository default branch")).toHaveCount(1);
await selectWorkspaceIsolation(page, "local");
await fillComposerDraft(page, "hi");
await page.getByRole("button", { name: "Create", exact: true }).click();
await expect(page).toHaveURL(/\/workspace\//);
await expect(page.getByText(/request_key_conflict/)).toHaveCount(0);
await expect(
page.getByTestId("user-message").filter({ hasText: "hi", visible: true }),
).toBeVisible();
} finally {
if (projectId) await client.removeProject(projectId).catch(() => undefined);
await client.close();
rmSync(repoDir, { recursive: true, force: true });
}
});
test("switching only the launch target after a failed New workspace creation starts a new workspace", async ({
creation,
workspaceProvision,
page,
}) => {
const profiles = await seedTerminalProfiles([
{
id: "promptless-shell",
name: "Promptless Shell",
command: "sh",
args: ["-c", "echo ready; sleep 5"],
promptArg: "none",
},
]);
try {
await creation.openWorkspaceForm("local");
await workspaceProvision.fail();
await page.getByRole("button", { name: "Create", exact: true }).click();
await expect(
page.getByTestId("composer-error").filter({ visible: true }).first(),
).toContainText("Workspace provisioning failed for test");
await selectLaunchOption(page, "promptless-shell");
await submitTerminalLaunch(page);
await creation.expectOneCreatedWorkspace();
await expect(
page.locator('[data-testid^="workspace-tab-terminal_"]').filter({ visible: true }).first(),
).toBeVisible();
} finally {
await profiles.restore();
}
});
test("failing New workspace creation after switching workspaces shows an error toast", async ({
creation,
workspaceProvision,
page,
}) => {
await creation.openWorkspaceForm("local");
await workspaceProvision.hold();
await page.getByRole("button", { name: "Create", exact: true }).click();
await page.locator('[data-testid^="sidebar-workspace-row-"]').first().click();
await expect(page).toHaveURL(/\/workspace\//);
await workspaceProvision.fail();
await expect(page.getByTestId("app-toast")).toContainText(
"Workspace provisioning failed for test",
);
});
for (const entry of [
{
name: "agent draft",
@@ -118,8 +118,7 @@ async function exerciseProviderSettingsStack(page: Page) {
await page.getByRole("button", { name: "Refresh", exact: true }).click();
await expectProviderSettingsVisible(page);
// The Models header puts the model count before it: "12 · Checked just now".
await expect(page.getByText(/Checked just now$/)).toBeVisible({
await expect(page.getByText("Checked just now", { exact: true })).toBeVisible({
timeout: 30_000,
});
}
@@ -64,11 +64,6 @@ import {
expectSettingsHostPickerLabel,
openSettingsHostSection,
removeCurrentHostFromSettings,
openSidebarHostPicker,
sidebarHostSettingsButton,
expectStandaloneSidebarHostSettingsButton,
activateSidebarHostSettingsWithKeyboard,
bindCommandCenterToEnter,
} from "../support/helpers/settings";
import { getServerId } from "../support/helpers/server-id";
import { expectAppRoute } from "../support/helpers/route-assertions";
@@ -192,26 +187,6 @@ test.describe("Settings sidebar scroll position", () => {
});
test.describe("Settings sidebar navigation", () => {
test("the sidebar host gear opens Overview in one click", async ({ page, withWorkspace }) => {
const workspace = await withWorkspace({ prefix: "sidebar-host-settings-" });
await openWorkspace(page, workspace);
await openSidebarHostPicker(page);
await expectStandaloneSidebarHostSettingsButton(page);
await sidebarHostSettingsButton(page).click();
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "host"));
});
test("Enter opens the focused sidebar host gear", async ({ page, withWorkspace }) => {
await bindCommandCenterToEnter(page);
const workspace = await withWorkspace({ prefix: "keyboard-host-settings-" });
await openWorkspace(page, workspace);
await openSidebarHostPicker(page);
await activateSidebarHostSettingsWithKeyboard(page);
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "host"));
});
test("opening Settings closes the composer model selector until it is opened again", async ({
page,
withWorkspace,
+8 -112
View File
@@ -34,7 +34,6 @@ import {
openUsageFromItem,
pinRow,
openUsageOptions,
openUsageSources,
closeUsageOptions,
pickUsageHost,
usageModalHost,
@@ -251,15 +250,16 @@ test.describe("usage modal", () => {
await expect(alphaHandle).toHaveCSS("opacity", "1");
await alphaHandle.blur();
// Turning a source off in the dedicated Sources list removes its card and sidebar summary.
await setUsageCardOn(page, "beta:work", false);
await expectUsageCardOrder(page, ["alpha:a", "beta:home"]);
await expect(page.getByTestId("usage-report-beta:work")).toHaveCount(0);
// The off card collapses to its header, which still names the account.
await setUsageCardOn(page, "beta plan (work)", false);
const work = page.getByTestId("usage-report-beta:work");
await expect(work.getByText("12% used")).toHaveCount(0);
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"]);
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();
@@ -270,114 +270,10 @@ test.describe("usage modal", () => {
await page.reload();
await expectPinnedUsage(page, ["20% Weekly", "31% Weekly"]);
await openUsageFromItem(page);
await expectUsageCardOrder(page, ["beta:home", "alpha:a"]);
await expect(page.getByTestId("usage-report-beta:work")).toHaveCount(0);
await expectUsageCardOrder(page, ["beta:home", "alpha:a", "beta:work"]);
await expect(page.getByTestId("usage-report-beta:work").getByText("12% used")).toHaveCount(0);
});
for (const [size, viewport] of Object.entries({
desktop: { width: 1440, height: 900 },
compact: { width: 390, height: 844 },
})) {
test(`dedicated Sources list manages default-off sources without clutter (${size})`, async ({
page,
}) => {
test.setTimeout(120_000);
const [claude, codex] = claudeAndCodexReports();
const fetchedAt = twoHoursAgo();
await installUsageReportsFixture(page, {
lists: [
() => [
claude!,
codex!,
{
id: "copilot:default",
account: {},
fetchedAt,
sourceId: "copilot",
sourceLabel: "GitHub Copilot",
defaultEnabled: false,
report: {
status: "unavailable",
problem: { kind: "rejected", status: 403 },
},
},
{
id: "cursor:default",
account: { label: "dev@example.com" },
fetchedAt,
sourceId: "cursor",
sourceLabel: "Cursor",
defaultEnabled: false,
report: {
status: "available",
windows: [
{ id: "monthly", label: "Monthly", shortLabel: "mo", summary: true, usedPct: 18 },
],
},
},
],
],
});
await page.setViewportSize(viewport);
await gotoAppShell(page);
if (size === "compact") await openCompactSidebar(page);
// Only active sources appear in the sidebar summary and modal cards.
await expectPinnedUsage(page, ["31% 5h", "54% wk", "7% 5h", "12% wk"]);
await openUsageFromItem(page);
await expectUsageCardOrder(page, ["claude:default", "codex:default"]);
await expect(page.getByTestId("usage-report-copilot:default")).toHaveCount(0);
await expect(page.getByTestId("usage-report-cursor:default")).toHaveCount(0);
await qaScreenshot(page, `usage-sources-${size}-cards`);
await openUsageOptions(page);
await expect(page.getByTestId("usage-options-sources")).toContainText("2 of 4");
await qaScreenshot(page, `usage-sources-${size}-settings`);
if (size === "compact") {
// Compact sheets expose menu rows in the browser Tab order so keyboard users can open
// Sources and toggle checkboxes without a pointer.
await page.getByTestId("usage-options-sources").focus();
await expect(page.getByTestId("usage-options-sources")).toBeFocused();
await expect(page.getByTestId("usage-options-sources")).toHaveAttribute("tabindex", "0");
await page.keyboard.press("Enter");
} else {
await openUsageSources(page);
}
const claudeToggle = page.getByRole("checkbox", { name: /^Claude/ });
const copilotToggle = page.getByRole("checkbox", { name: /^GitHub Copilot/ });
const cursorToggle = page.getByRole("checkbox", { name: /^Cursor/ });
await expect(claudeToggle).toBeChecked();
await expect(copilotToggle).not.toBeChecked();
await expect(copilotToggle).toContainText("Provider inactive");
await qaScreenshot(page, `usage-sources-${size}-list`);
// Opting into a default-off source brings its card and summary window in immediately.
if (size === "compact") {
await cursorToggle.focus();
await expect(cursorToggle).toBeFocused();
await expect(cursorToggle).toHaveAttribute("tabindex", "0");
await page.keyboard.press("Space");
} else {
await cursorToggle.click();
}
await expect(cursorToggle).toBeChecked();
await closeUsageOptions(page);
await expectUsageCardOrder(page, ["claude:default", "codex:default", "cursor:default"]);
// Hiding every source shows a quiet empty state with a shortcut back to Settings.
await openUsageSources(page);
await page.getByTestId("usage-source-toggle-claude:default").click();
await page.getByTestId("usage-source-toggle-codex:default").click();
await page.getByTestId("usage-source-toggle-cursor:default").click();
await closeUsageOptions(page);
await expect(page.getByTestId("usage-all-hidden")).toBeVisible();
await expect(page.getByTestId("usage-choose-sources")).toBeVisible();
await qaScreenshot(page, `usage-sources-${size}-empty`);
await page.getByTestId("usage-choose-sources").click();
await expect(page.getByTestId("usage-options-sources")).toContainText("0 of 4");
});
}
test("refreshes one report from its card", async ({ page }) => {
test.setTimeout(120_000);
const serverId = getServerId();
@@ -291,12 +291,12 @@ test.describe("Usage item", () => {
await gotoAppShell(page);
const screen = page.getByTestId(`usage-host-${serverId}`);
await test.step("a fresh device shows default windows in the sidebar automatically", async () => {
// The Usage item starts on by default on every layout.
await expectPinnedUsage(page, ["31% 5h", "54% wk", "7% 5h", "12% wk"]);
await qaScreenshot(page, "desktop-footer-defaults", { kind: "footer" });
await test.step("a fresh device shows default windows once the Usage item is on", async () => {
// The Usage item starts off on every layout; turning it on stores the choice.
await expectNoUsageItem(page);
await openSidebarNavSettings(page);
await expectFooterItemSetting(page, "usage", true);
await expectFooterItemSetting(page, "usage", false);
await setFooterItemVisible(page, "usage", true);
await qaScreenshot(page, "desktop-settings-sidebar-footer");
await page.setViewportSize(COMPACT);
await expectFooterItemSetting(page, "usage", true);
@@ -308,6 +308,7 @@ test.describe("Usage item", () => {
await page.setViewportSize(WIDE);
await gotoAppShell(page);
await expectPinnedUsage(page, ["31% 5h", "54% wk", "7% 5h", "12% wk"]);
await qaScreenshot(page, "desktop-footer-defaults", { kind: "footer" });
await openUsageFromItem(page);
await qaScreenshot(page, "default-pins-card");
await expect(pinRow(screen, "Claude", "Session")).toBeChecked();
@@ -477,7 +478,7 @@ test("without summary data the footer drops the Usage item and keeps the Usage i
await openUsageFromIcon(page);
});
test("the Usage Settings switch turns the sidebar summary and pins off and back on", async ({
test("the Usage Settings switch turns on the sidebar summary and the pins with it", async ({
page,
}) => {
const serverId = getServerId();
@@ -487,17 +488,8 @@ test("the Usage Settings switch turns the sidebar summary and pins off and back
const screen = page.getByTestId(`usage-host-${serverId}`);
const claude = screen.getByTestId("usage-report-claude:default");
await test.step("on by default: the Usage item and pins appear", async () => {
await expectPinnedUsage(page, ["31% 5h", "54% wk", "7% 5h", "12% wk"]);
await openUsageFromItem(page);
await expect(pinRow(screen, "Claude", "Weekly")).toBeChecked();
await togglePin(screen, "Claude", "Weekly");
await expectPinnedUsage(page, ["31% 5h", "7% 5h", "12% wk"]);
await qaScreenshot(page, "usage-summary-on");
});
await test.step("off: no Usage item, and rows that do not pin", async () => {
await setSummaryInSidebar(page, false);
await test.step("off by default: no Usage item, and rows that do not pin", async () => {
await openUsageFromIcon(page);
await expectNoUsageItem(page);
await expect(claude.getByText("Session", { exact: true })).toBeVisible({ timeout: 10_000 });
await expectUnpinnableRows(claude);
@@ -506,7 +498,19 @@ test("the Usage Settings switch turns the sidebar summary and pins off and back
await qaScreenshot(page, "usage-summary-off");
});
await test.step("after a reload, turning it back on brings back the saved pins", async () => {
await test.step("on: the Usage item and the pins appear", async () => {
await setSummaryInSidebar(page, true);
await expectPinnedUsage(page, ["31% 5h", "54% wk", "7% 5h", "12% wk"]);
await expect(pinRow(screen, "Claude", "Weekly")).toBeChecked();
await togglePin(screen, "Claude", "Weekly");
await expectPinnedUsage(page, ["31% 5h", "7% 5h", "12% wk"]);
await qaScreenshot(page, "usage-summary-on");
});
await test.step("off then on again, after a reload, brings back the saved pins", async () => {
await setSummaryInSidebar(page, false);
await expectNoUsageItem(page);
await expectUnpinnableRows(claude);
await page.reload();
await openUsageFromIcon(page);
await expectSummaryInSidebar(page, false);
@@ -550,7 +554,6 @@ test("released hosts supply source logos through the client conversion", async (
test("hidden usage sends no requests until opened", async ({ page }) => {
test.setTimeout(180_000);
const usage = await installUsageReportsFixture(page, { lists: [() => claudeAndCodexReports()] });
await seedSidebarFooterPreferences(page, [{ key: "usage", visible: false }]);
await page.setViewportSize(WIDE);
await gotoAppShell(page);
await expectNoUsageItem(page);
@@ -566,9 +569,10 @@ test("hidden usage sends no requests until opened", async ({ page }) => {
expect(usage.listRequests()).toHaveLength(1);
});
test("visible usage summary requests reports on load by default", async ({ page }) => {
test("visible usage summary requests reports on load", async ({ page }) => {
test.setTimeout(180_000);
const usage = await installUsageReportsFixture(page, { lists: [() => claudeAndCodexReports()] });
await seedSidebarFooterPreferences(page, [{ key: "usage", visible: true }]);
await page.setViewportSize(WIDE);
await gotoAppShell(page);
await expectPinnedUsage(page, ["31% 5h", "54% wk", "7% 5h", "12% wk"]);
@@ -1,14 +0,0 @@
# Tab switcher sheet drag on iPhone
Run on a task-owned iPhone 17 simulator (402×874 points, portrait) with the development bundle loaded and a connected isolated host. Select a workspace whose first tab is an agent and whose next 11 tabs are terminals, and select the agent tab. Dismiss the notification entitlement toast.
The sheet exposes its rows to XCUITest as one "Bottom Sheet" element, so the flow taps fixed points and asserts which tab opens. The sheet opens at 60%, where its handle is at y=350, and expands to 90%, where its handle is at y=87.
1. A swipe up on the list must expand the sheet. The tap at y=300 then lands on the fourth row and opens a terminal. Without the expansion it lands on the backdrop, and no terminal opens.
2. A swipe down on the list at 90% must collapse the sheet. The tap at y=424 then lands on the first row and opens the agent. Without the collapse it lands on the sixth row, which is a terminal.
The flow ends on the agent tab, so you can replay it. Replay it on the Namespace Mac with an explicit device:
```sh
agent-device replay packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag.ios.ad --platform ios --device 'iPhone 17'
```
@@ -1,20 +0,0 @@
context platform=ios timeout=60000 retries=0
env APP_ID=sh.paseo.debug
open "${APP_ID}"
wait "id=\"agent-chat-scroll\"" 20000
press "id=\"workspace-tab-switcher-trigger\""
wait "label=\"Bottom Sheet\"" 10000
gesture pan 200 650 0 -300 500
wait 1000
press 200 300
wait "id=\"terminal-surface\"" 10000
press "id=\"workspace-tab-switcher-trigger\""
wait "label=\"Bottom Sheet\"" 10000
gesture pan 200 650 0 -300 500
wait 1000
gesture pan 200 400 0 300 500
wait 1000
press 200 424
wait "id=\"agent-chat-scroll\"" 10000
close
@@ -28,13 +28,12 @@ bounds cannot establish measurement parity.
compares them with the shipped headers. This catches missing C++ fields in the
measurement path, which the Kotlin tests cannot exercise.
The vendored library (`packages/react-native-enriched-markdown`) contains
`InlineCodeFormattingTest`, which exercises actual Android spans in Robolectric
native graphics mode, covering draw and measurement, span order, code inside
paragraph/heading sizes, bold/italic composition, and links preserving code and
emphasized prose fonts. It runs in `npm run test:android`; CI does not run it.
To run only this regression locally, from `packages/app/android` after Expo
prebuild:
The package patch contains `InlineCodeFormattingTest`, which exercises actual
Android spans in Robolectric native graphics mode, covering draw and measurement,
span order, code inside paragraph/heading sizes, bold/italic composition, and
links preserving code and emphasized prose fonts.
It runs in the existing `test:android` CI job. To run only this regression locally,
from `packages/app/android` after Expo prebuild:
```sh
./gradlew :react-native-enriched-markdown:testDebugUnitTest \
@@ -15,11 +15,6 @@ import { delayBrowserAgentCreatedStatus } from "./helpers/new-workspace";
export const test = base.extend<{
startup: { release(): Promise<void>; fail(): Promise<void> };
workspaceProvision: {
hold(): Promise<void>;
fail(): Promise<void>;
release(): Promise<void>;
};
promptRejection: void;
composerMetadata: { set(patch: Record<string, string>): Promise<void> };
creation: Awaited<ReturnType<typeof createCreationScenario>>;
@@ -75,57 +70,6 @@ export default function contribute(server) {
await client.close();
}
},
workspaceProvision: async ({ page }, provide) => {
void page;
const client = await connectNewWorkspaceDaemonClient();
const plugin = await copyPluginExample("lifecycle-logger");
const gate = path.join(plugin.directory, "workspace-provision.txt");
const holdFile = path.join(plugin.directory, "workspace-provision-hold.txt");
const failFile = path.join(plugin.directory, "workspace-provision-fail.txt");
const previous = await client.getDaemonConfig();
try {
await writeFile(
path.join(plugin.directory, "index.server.ts"),
`
import { readFile, rm } from "node:fs/promises";
export default function contribute(server) {
return server.before("workspace.create", async ({ request }) => {
const gate = ${JSON.stringify(gate)};
let command = await readFile(gate, "utf8").catch(() => "release");
while (command === "hold") {
await new Promise(resolve => setTimeout(resolve, 20));
command = await readFile(gate, "utf8").catch(() => "release");
}
if (command === "fail") {
await rm(gate, { force: true });
throw new Error("Workspace provisioning failed for test");
}
return request;
});
}
`,
);
await client.patchDaemonConfig({ pluginsEnabled: true });
await client.installDirectoryPlugin(plugin.directory);
await provide({
hold: async () => {
await writeFile(holdFile, "hold");
await rename(holdFile, gate);
},
fail: async () => {
await writeFile(failFile, "fail");
await rename(failFile, gate);
},
release: () => rm(gate, { force: true }),
});
} finally {
await rm(gate, { force: true });
await client.removePlugin("lifecycle-logger");
await client.patchDaemonConfig({ pluginsEnabled: previous.config.pluginsEnabled });
await plugin.cleanup();
await client.close();
}
},
promptRejection: async ({ page }, provide) => {
void page;
const client = await connectNewWorkspaceDaemonClient();
@@ -6,7 +6,6 @@ import {
type ChildProcess,
type SpawnOptions,
} from "node:child_process";
import { existsSync } from "node:fs";
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import net from "node:net";
import { tmpdir } from "node:os";
@@ -230,11 +229,7 @@ export async function startIsolatedHostDaemon(
stdio: ["ignore", "ignore", "pipe"],
detached: false,
};
const builtSupervisor = path.join(serverDir, "dist/scripts/supervisor-entrypoint.js");
const useBuiltSupervisor = Boolean(
publishedPackageRoot || (process.env.CI && existsSync(builtSupervisor)),
);
const spawned = useBuiltSupervisor
const spawned = publishedPackageRoot
? spawn(process.execPath, ["dist/scripts/supervisor-entrypoint.js"], spawnOptions)
: spawnTsx("scripts/supervisor-entrypoint.ts", ["--dev"], spawnOptions);
+1 -40
View File
@@ -12,43 +12,6 @@ const DISABLE_DEFAULT_SEED_ONCE_KEY = "@paseo:e2e-disable-default-seed-once";
const SEED_NONCE_KEY = "@paseo:e2e-seed-nonce";
const REGISTRY_KEY = "@paseo:daemon-registry";
export async function openSidebarHostPicker(page: Page) {
await page.getByRole("button", { name: "Hosts", exact: true }).click();
}
export function sidebarHostSettingsButton(page: Page) {
return page.getByRole("button", { name: `Open ${TEST_HOST_LABEL} settings`, exact: true });
}
export async function bindCommandCenterToEnter(page: Page) {
await page.addInitScript(() => {
localStorage.setItem(
"@paseo:keyboard-shortcut-overrides",
JSON.stringify({
"command-center-toggle-cmd-k-mac": "Enter",
"command-center-toggle-ctrl-k-non-mac": "Enter",
}),
);
});
}
export async function expectStandaloneSidebarHostSettingsButton(page: Page) {
const gear = sidebarHostSettingsButton(page);
await expect(gear).toBeVisible();
expect(await gear.evaluate((button) => button.parentElement?.closest("button") === null)).toBe(
true,
);
}
export async function activateSidebarHostSettingsWithKeyboard(page: Page) {
const host = page.getByRole("button", { name: TEST_HOST_LABEL, exact: true });
await expect(host).toBeFocused();
await page.keyboard.press("ArrowDown");
await page.keyboard.press("Tab");
await expect(sidebarHostSettingsButton(page)).toBeFocused();
await page.keyboard.press("Enter");
}
interface SavedSettingsHostInput {
serverId: string;
label: string;
@@ -604,9 +567,7 @@ export async function expectProviderPageLoaded(page: Page, providerName: string)
await expect(page.getByTestId("provider-detail-title")).toHaveText(providerName, {
timeout: 30_000,
});
await expect(page.getByRole("button", { name: "Diagnostic report" })).toBeVisible({
timeout: 30_000,
});
await expect(page.getByText("Provider status")).toBeVisible({ timeout: 30_000 });
}
export async function expectProviderNotOnHost(page: Page): Promise<void> {
@@ -160,23 +160,11 @@ export async function expectUsageCardOrder(page: Page, reportIds: string[]): Pro
.toEqual(reportIds);
}
/** Turns a source on or off from the Sources page in Usage Settings, by report id. */
export async function setUsageCardOn(page: Page, reportId: string, on: boolean): Promise<void> {
await openUsageSources(page);
const item = visible(page, `usage-source-toggle-${reportId}`);
const checked = (await item.getAttribute("aria-checked")) === "true";
if (checked !== on) {
await item.click();
await expect(item).toHaveAttribute("aria-checked", String(on));
}
await closeUsageOptions(page);
}
/** Opens the Sources submenu inside Usage Settings (flyout on wide, in-place page on compact). */
export async function openUsageSources(page: Page): Promise<void> {
await openUsageOptions(page);
await visible(page, "usage-options-sources").click();
await expect(page.locator('[data-testid^="usage-source-toggle-"]:visible').first()).toBeVisible();
/** Turns a card on or off from its header switch, named by its source and account. */
export async function setUsageCardOn(page: Page, name: string, on: boolean): Promise<void> {
const cardSwitch = usageModal(page).getByRole("switch", { name: `Show ${name}`, exact: true });
await cardSwitch.click();
await expect(cardSwitch).toBeChecked({ checked: on });
}
/** Drags a card by its handle until it sits above another card, with the mouse. */
@@ -257,14 +245,18 @@ export function pinRow(scope: Locator, source: string, window: string): Locator
/**
* A report card whose window rows do not pin: no pin toggle, no pin glyph, and nothing focusable
* but the header's buttons, so no row presses or highlights on hover.
* but the header's buttons and on/off switch, so no row presses or highlights on hover.
*/
export async function expectUnpinnableRows(card: Locator): Promise<void> {
await expect(card.getByRole("checkbox")).toHaveCount(0);
await expect(card.locator('[data-testid^="usage-pin-"]')).toHaveCount(0);
const focusable = await card
.locator("[tabindex]")
.evaluateAll((nodes) => nodes.filter((node) => node.getAttribute("role") !== "button").length);
.evaluateAll(
(nodes) =>
nodes.filter((node) => !["button", "switch"].includes(node.getAttribute("role") ?? ""))
.length,
);
expect(focusable).toBe(0);
}
@@ -396,7 +388,6 @@ export async function closeUsageOptions(page: Page): Promise<void> {
await waitForSettledPosition(usageOptionsSurface(page));
await page.mouse.click(0, 0);
await expect(page.getByTestId("usage-display-used")).toHaveCount(0);
await expect(page.locator('[data-testid^="usage-source-toggle-"]:visible')).toHaveCount(0);
}
export async function showUsageAs(page: Page, displayAs: "used" | "remaining") {
@@ -132,7 +132,7 @@ using namespace facebook::react;
if (!props.maintainVisibleContentPosition || scrollView.contentSize.width > self.frame.size.width) {
return nil;
}
NSArray<UIView *> *children = [self paseoScrollContentView].subviews;
NSArray<UIView *> *children = [self contentView].subviews;
NSUInteger first = props.maintainVisibleContentPosition.value().minIndexForVisible;
for (NSUInteger index = first; index < children.count; ++index) {
UIView *child = children[index];
@@ -149,11 +149,7 @@ using namespace facebook::react;
[((RCTViewComponentView *)view).nativeId isEqualToString:@"paseo-end-pin"];
}
// Not `contentView`: that name would override RCTViewComponentView's getter, which
// react-native-gesture-handler reads to pick the view a gesture binds to. Bound to the content
// child, a bottom sheet's scroll gesture loses its pairing with the scroll view, so body drags
// neither expand the sheet nor scroll the list until the sheet is at its top detent.
- (UIView *)paseoScrollContentView
- (UIView *)contentView
{
for (UIView *child in self.containerView.subviews) {
if (![child conformsToProtocol:@protocol(RCTCustomPullToRefreshViewProtocol)]) {
@@ -19,7 +19,6 @@ android {
dependencies {
implementation "androidx.customview:customview:1.1.0"
implementation "com.facebook.react:react-android"
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test:runner:1.6.2"
androidTestImplementation "androidx.test.ext:junit:1.2.1"
@@ -1,69 +0,0 @@
package sh.paseo.terminal
import android.text.InputType
import android.view.inputmethod.EditorInfo
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.facebook.react.bridge.BridgeReactContext
import com.facebook.react.uimanager.DisplayMetricsHolder
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.views.textinput.ReactEditText
import com.facebook.react.views.textinput.ReactTextInputManager
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Test
import org.junit.runner.RunWith
/**
* Builds React Native's own text input and applies `nativeID` through its view manager, which is
* how Fabric mounts the hidden terminal input. The app runs bridgeless, so the context is too.
*/
@RunWith(AndroidJUnit4::class)
class TerminalInputKeyboardTest {
private val instrumentation = InstrumentationRegistry.getInstrumentation()
@Test fun terminalInputAsksTheKeyboardNotToLearnWhatIsTyped() {
onInput("paseo-terminal-input") { input, editorInfo ->
assertNotEquals(
"The keyboard must not learn passwords typed at a terminal prompt",
0,
editorInfo.imeOptions and EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING,
)
assertEquals(
"Suggestions stay off and the input stays multiline",
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or InputType.TYPE_TEXT_FLAG_MULTI_LINE,
editorInfo.inputType and (InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or InputType.TYPE_TEXT_FLAG_MULTI_LINE),
)
val connection = checkNotNull(input.onCreateInputConnection(EditorInfo()))
connection.setComposingText("su", 1)
connection.commitText("sudo ls", 1)
connection.deleteSurroundingText(1, 0)
assertEquals("sudo l", input.text.toString())
}
}
@Test fun otherInputsKeepPersonalizedLearning() {
onInput("message-composer") { _, editorInfo ->
assertEquals(0, editorInfo.imeOptions and EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING)
}
}
private fun onInput(nativeId: String, check: (ReactEditText, EditorInfo) -> Unit) {
TerminalInputKeyboard.install()
instrumentation.runOnMainSync {
val app = instrumentation.targetContext
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(app)
val react = object : BridgeReactContext(app) {
override fun isBridgeless() = true
}
val input = ReactEditText(ThemedReactContext(react, app, null, -1))
input.inputType = InputType.TYPE_CLASS_TEXT or
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or
InputType.TYPE_TEXT_FLAG_MULTI_LINE
ReactTextInputManager().setNativeId(input, nativeId)
val editorInfo = EditorInfo()
input.onCreateInputConnection(editorInfo)
check(input, editorInfo)
}
}
}
@@ -7,8 +7,6 @@ class PaseoTerminalModule : Module() {
override fun definition() = ModuleDefinition {
Name("PaseoTerminal")
OnCreate { TerminalInputKeyboard.install() }
View(PaseoTerminalView::class) {
Events("onCellMetrics")
@@ -1,32 +0,0 @@
package sh.paseo.terminal
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.TextView
import com.facebook.react.bridge.UiThreadUtil
import com.facebook.react.uimanager.util.ReactFindViewUtil
// Matched against the hidden terminal input's `nativeID`
// (TERMINAL_INPUT_NATIVE_ID in terminal-input.native.tsx).
private const val TERMINAL_INPUT_NATIVE_ID = "paseo-terminal-input"
/**
* Keeps what is typed at a terminal prompt, such as a `sudo` password, out of the keyboard's
* learned words. React Native's TextInput has no prop for IME_FLAG_NO_PERSONALIZED_LEARNING, so the
* flag is added when the input receives its `nativeID`, before it can take focus.
*
* React Native replaces `imeOptions` when `returnKeyType` or `disableFullscreenUI` is set, so the
* terminal input sets neither.
*/
internal object TerminalInputKeyboard : ReactFindViewUtil.OnMultipleViewsFoundListener {
fun install() {
UiThreadUtil.runOnUiThread {
ReactFindViewUtil.addViewsListener(this, setOf(TERMINAL_INPUT_NATIVE_ID))
}
}
override fun onViewFound(view: View, nativeId: String) {
val input = view as? TextView ?: return
input.imeOptions = input.imeOptions or EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.17.3",
"version": "0.17.1",
"private": true,
"main": "index.ts",
"scripts": {
@@ -40,7 +40,7 @@
"dev:ios": "npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo run:ios",
"build:apk": "npm --prefix ../.. run build:apk",
"build:apk:arm64": "npm --prefix ../.. run build:apk:arm64",
"test:android": "expo prebuild --platform android --no-install && cd android && ./gradlew :paseo-native-trace:testReleaseUnitTest :paseo-hardware-keyboard:testReleaseUnitTest :react-native-enriched-markdown:testReleaseUnitTest --tests '*InlineCodeFormattingTest' --tests '*ListRenderingTest' --tests '*TaskListInteractionTest' --tests '*ListBlockquoteMeasurementTest' --tests '*BlockquoteCopyTest' --no-daemon --max-workers=2 -Dorg.gradle.parallel=false"
"test:android": "expo prebuild --platform android --no-install && cd android && ./gradlew :paseo-native-trace:testReleaseUnitTest :paseo-hardware-keyboard:testReleaseUnitTest :react-native-enriched-markdown:testReleaseUnitTest --tests '*InlineCodeFormattingTest' --no-daemon --max-workers=2 -Dorg.gradle.parallel=false"
},
"dependencies": {
"@codemirror/commands": "6.10.4",
@@ -125,7 +125,7 @@
"react-native": "0.86.3",
"react-native-draggable-flatlist": "^4.0.3",
"react-native-edge-to-edge": "^1.7.0",
"react-native-enriched-markdown": "*",
"react-native-enriched-markdown": "1.2.0-nightly-20261014-766fc0e67",
"react-native-gesture-handler": "~2.32.0",
"react-native-keyboard-controller": "1.21.12",
"react-native-nitro-modules": "0.35.5",
-19
View File
@@ -29,25 +29,6 @@ export function agentCommandsQueryRoot(serverId: string) {
return [AGENT_COMMANDS_QUERY_ROOT, serverId] as const;
}
function queryCommandsCwd(query: { queryKey: readonly unknown[]; meta?: Record<string, unknown> }) {
const isDraft = query.queryKey[2] === "draft";
const cwd = query.meta?.agentCommandCwd ?? (isDraft ? query.queryKey[4] : undefined);
return typeof cwd === "string" ? normalizeAgentCommandsCwd(cwd) : undefined;
}
/** Marks every catalog for a directory stale. Only observed catalogs refetch; the rest refetch
* when next mounted. Used when a provider change is announced without its new snapshot. */
export function invalidateCommandsForDirectory(input: {
queryClient: QueryClient;
serverId: string;
cwd: string | null;
}): Promise<void> {
return input.queryClient.invalidateQueries({
queryKey: agentCommandsQueryRoot(input.serverId),
predicate: (query) => !input.cwd || queryCommandsCwd(query) === input.cwd,
});
}
/** Snapshot announcements contain provider metadata, not command catalogs. Ignore initial
* discovery and unrelated providers; explicit refresh still invalidates every catalog. */
export function invalidateCommandsForProviderChange(input: {
@@ -393,39 +393,6 @@ describe("layoutStream", () => {
expect(findLayoutItem(layout, thinking.id).toolSequence).toBe("last");
});
it.each(["web", "android"] as const)(
"carries turn metrics from the footer's source row on %s",
(platform) => {
const metrics = [{ label: "Model", value: "opus" }];
const earlier = { ...assistantMessage("a1", 2), turnMetrics: metrics };
const latest = { ...toolCall("tool-2", 5), turnMetrics: [{ label: "Steps", value: "2" }] };
const layout = layoutFor({
platform,
tail: [userMessage("u1", 1), earlier, toolCall("tool-1", 3), userMessage("u2", 4), latest],
});
expect(findLayoutItem(layout, "tool-1").completedFooter?.turnMetrics).toBe(metrics);
expect(layout.auxiliaryTurnFooter?.turnMetrics).toBe(latest.turnMetrics);
},
);
it("lays out the footer again when its source row gains turn metrics", () => {
const assistant = assistantMessage("a1", 2);
const trailing = toolCall("tool-2", 4);
const tail = [userMessage("u1", 1), assistant, toolCall("tool-1", 3), trailing];
const next = userMessage("u2", 5);
const before = layoutFor({ platform: "android", tail: [...tail, next] });
const metrics = [{ label: "Model", value: "opus" }];
const stamped = [...tail];
stamped[1] = { ...assistant, turnMetrics: metrics };
const after = layoutFor({ platform: "android", tail: [...stamped, next] });
expect(findLayoutItem(before, trailing.id).completedFooter?.turnMetrics).toBeUndefined();
expect(findLayoutItem(after, trailing.id).completedFooter?.turnMetrics).toBe(metrics);
expect(findLayoutItem(after, next.id)).toBe(findLayoutItem(before, next.id));
});
it("keeps bottom and inline footer ownership mutually exclusive", () => {
const assistant = assistantMessage("a1", 2);
const layout = layoutFor({
-8
View File
@@ -1,4 +1,3 @@
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import type { TurnTiming } from "@/timeline/turn-time";
import type { StreamItem } from "@/types/stream";
import { getAssistantMessageSpacing, getGapBetweenStreamItems } from "./spacing";
@@ -11,7 +10,6 @@ export interface TurnFooterHost {
itemId: string;
items: StreamItem[];
timing?: TurnTiming;
turnMetrics?: AgentMetric[];
startIndex: number;
}
@@ -71,15 +69,10 @@ function createTurnFooterHost(input: {
index: number;
timingByItemId: Map<string, TurnTiming>;
}): TurnFooterHost {
const turnMetrics =
input.item.kind === "assistant_message" || input.item.kind === "tool_call"
? input.item.turnMetrics
: undefined;
return {
itemId: input.item.id,
items: input.items,
timing: input.timingByItemId.get(input.item.id),
...(turnMetrics ? { turnMetrics } : {}),
startIndex: input.index,
};
}
@@ -254,7 +247,6 @@ function areTurnFooterHostsEqual(
return (
left.itemId === right.itemId &&
left.timing === right.timing &&
left.turnMetrics === right.turnMetrics &&
left.startIndex === right.startIndex &&
left.items === right.items
);
@@ -1,10 +1,6 @@
import React, { act } from "react";
import { createRoot, type Root } from "react-dom/client";
import { PortalProvider } from "@gorhom/portal";
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { page } from "vitest/browser";
import { FloatingPanelPortalHost } from "@/components/ui/floating-panel-portal";
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { i18n } from "@/i18n/i18next";
import type { TurnTiming } from "@/timeline/turn-time";
import type { StreamItem } from "@/types/stream";
@@ -96,57 +92,3 @@ it.each([
"Friday 11:11 PM": 1,
});
});
const COMPLETED_TIMING: TurnTiming = { completedAt: FRIDAY_NIGHT, durationMs: 26_000 };
describe("turn stats", () => {
const metrics: AgentMetric[] = [
{ label: "Model", value: "opus" },
{ label: "Cost", value: "$0.42", tone: "warning" },
];
function renderFooterWithMetrics(turnMetrics?: AgentMetric[]): void {
act(() =>
root.render(
<PortalProvider>
<CompletedTurnFooterRow
strategy={createNativeStreamStrategy()}
items={[reply]}
timing={COMPLETED_TIMING}
startIndex={0}
supportsTimelineCursor={false}
turnMetrics={turnMetrics}
/>
<FloatingPanelPortalHost />
</PortalProvider>,
),
);
}
it("has no trigger when the provider reported nothing for the turn", () => {
renderFooterWithMetrics(undefined);
expect(page.getByRole("button", { name: "Turn stats" }).elements()).toHaveLength(0);
});
it("shows the turn's metrics while the pointer is on the trigger", async () => {
renderFooterWithMetrics(metrics);
await page.getByRole("button", { name: "Turn stats" }).hover();
const card = page.getByRole("dialog", { name: "Turn stats" });
await expect.element(card).toBeVisible();
await expect.element(card.getByText("Model")).toBeVisible();
await expect.element(card.getByText("opus")).toBeVisible();
await expect.element(card.getByText("$0.42")).toBeVisible();
});
it("keeps the footer's height when the trigger appears", () => {
renderFooterWithMetrics(undefined);
const without = host.getBoundingClientRect().height;
renderFooterWithMetrics(metrics);
expect(host.getBoundingClientRect().height).toBe(without);
});
});
@@ -1,4 +1,3 @@
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import React, { memo, useCallback, useMemo, type ReactNode } from "react";
import { View } from "react-native";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
@@ -82,7 +81,6 @@ export const TurnFooter = memo(function TurnFooter({
items={host.items}
timing={host.timing}
startIndex={host.startIndex}
turnMetrics={host.turnMetrics}
supportsTimelineCursor={supportsTimelineCursor}
onForkAssistantTurn={onForkAssistantTurn}
/>
@@ -94,7 +92,6 @@ export const CompletedTurnFooterRow = memo(function CompletedTurnFooterRow({
items,
timing,
startIndex,
turnMetrics,
supportsTimelineCursor,
onForkAssistantTurn,
}: {
@@ -102,7 +99,6 @@ export const CompletedTurnFooterRow = memo(function CompletedTurnFooterRow({
items: StreamItem[];
timing?: TurnTiming;
startIndex: number;
turnMetrics?: AgentMetric[];
supportsTimelineCursor: boolean;
onForkAssistantTurn?: AssistantTurnForkHandler;
}) {
@@ -113,7 +109,6 @@ export const CompletedTurnFooterRow = memo(function CompletedTurnFooterRow({
items={items}
timing={timing}
startIndex={startIndex}
turnMetrics={turnMetrics}
supportsTimelineCursor={supportsTimelineCursor}
onForkAssistantTurn={onForkAssistantTurn}
/>
@@ -170,7 +165,6 @@ function CompletedTurnFooter({
items,
timing,
startIndex,
turnMetrics,
supportsTimelineCursor,
onForkAssistantTurn,
}: {
@@ -178,7 +172,6 @@ function CompletedTurnFooter({
items: StreamItem[];
timing?: TurnTiming;
startIndex: number;
turnMetrics?: AgentMetric[];
supportsTimelineCursor: boolean;
onForkAssistantTurn?: AssistantTurnForkHandler;
}) {
@@ -212,7 +205,6 @@ function CompletedTurnFooter({
completedAt={timing?.completedAt}
durationMs={timing?.durationMs}
onFork={boundary && onForkAssistantTurn ? handleFork : undefined}
metrics={turnMetrics}
/>
</View>
);
-1
View File
@@ -188,7 +188,6 @@ function renderStreamItemWithTurnFooter(input: {
items={footerHost.items}
timing={footerHost.timing}
startIndex={footerHost.startIndex}
turnMetrics={footerHost.turnMetrics}
supportsTimelineCursor={input.supportsTimelineCursor}
onForkAssistantTurn={input.onForkAssistantTurn}
/>
@@ -1,20 +1,5 @@
import { createElement as h } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { flushSync } from "react-dom";
import { createRoot, type Root } from "react-dom/client";
import { within } from "@testing-library/dom";
import { EnrichedMarkdownText } from "react-native-enriched-markdown";
import { I18nextProvider } from "react-i18next";
import { afterEach, describe, expect, it, vi } from "vitest";
import { WEB_RENDERERS } from "@/components/markdown/renderers.web";
import type { ToastApi } from "@/components/toast-host";
import { ToastApiProvider } from "@/contexts/toast-api-context";
import { i18n } from "@/i18n/i18next";
import {
createAssistantSelectionClipboardContent,
createElementClipboardContent,
} from "./content.web";
import { MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE } from "./markup";
import { afterEach, describe, expect, it } from "vitest";
import { createAssistantSelectionClipboardContent } from "./content.web";
const fixture = `
<div data-testid="assistant-message">
@@ -968,158 +953,3 @@ it("copies a workspace image path instead of its temporary display URL", () => {
"![chart](assets/chart.png)",
);
});
describe("quote copy", () => {
let root: Root | undefined;
let host: HTMLDivElement | undefined;
const toast: ToastApi = { show: () => () => {}, copied: () => {}, error: () => {} };
const queryClient = new QueryClient();
afterEach(() => {
const mounted = root;
if (mounted) flushSync(() => mounted.unmount());
root = undefined;
host?.remove();
host = undefined;
});
/** Renders Markdown through the web engine with the app's renderers, as a message does. */
async function renderMarkdown(markdown: string, lastText: string): Promise<HTMLElement> {
if (!host || !root) {
host = document.createElement("div");
document.body.append(host);
root = createRoot(host);
}
const mounted = root;
flushSync(() =>
mounted.render(
h(
QueryClientProvider,
{ client: queryClient },
h(
I18nextProvider,
{ i18n },
h(ToastApiProvider, {
api: toast,
children: h(EnrichedMarkdownText, {
markdown,
flavor: "github",
md4cFlags: { latexMath: false, admonitions: true },
renderers: WEB_RENDERERS,
}),
}),
),
),
),
);
const rendered = host;
await vi.waitFor(() => expect(rendered.textContent).toContain(lastText));
return rendered;
}
it("copies a quote's body with its formatting and without the quote marker", async () => {
const rendered = await renderMarkdown(
"> Hello **team**, see [the PR](https://example.test/pr).\n>\n> - Review\n>\n> > Nested reply",
"Nested reply",
);
const content = createElementClipboardContent(fixtureElement(rendered, "blockquote"));
expect(content?.plainText).toBe(
"Hello **team**, see [the PR](https://example.test/pr).\n\n- Review\n\n> Nested reply",
);
expect(content?.html).toContain("<strong>team</strong>");
expect(content?.html).toContain("<blockquote>");
expect(content?.html).not.toContain("Copy quote");
});
it("gives a nested quote its own control that copies only the nested quote", async () => {
const rendered = await renderMarkdown("> Outer\n>\n> > Nested reply", "Nested reply");
const nested = fixtureElement(rendered, "blockquote", 1);
expect(within(rendered).getAllByRole("button", { name: "Copy quote" })).toHaveLength(2);
expect(within(nested).getAllByRole("button", { name: "Copy quote" })).toHaveLength(1);
expect(createElementClipboardContent(nested)?.plainText).toBe("Nested reply");
});
it("copies a code block inside a quote as its fence and keeps the code's own control", async () => {
const rendered = await renderMarkdown("> Run:\n>\n> ```sh\n> npm test\n> ```", "npm test");
const quote = fixtureElement(rendered, "blockquote");
expect(within(quote).getByRole("button", { name: "Copy code" })).toBeTruthy();
expect(createElementClipboardContent(quote)?.plainText).toBe("Run:\n\n```sh\nnpm test\n```");
});
it("copies what a streaming quote shows at the time of the copy", async () => {
const first = await renderMarkdown("> First draft", "First draft");
const quote = fixtureElement(first, "blockquote");
const revised = await renderMarkdown("> First draft, revised", "revised");
expect(fixtureElement(revised, "blockquote")).toBe(quote);
expect(createElementClipboardContent(quote)?.plainText).toBe("First draft, revised");
});
it("copies literal Markdown characters raw in text/plain and escaped in text/html", async () => {
const rendered = await renderMarkdown("> literal \\_word\\_ stays literal", "stays literal");
const content = createElementClipboardContent(fixtureElement(rendered, "blockquote"));
expect(content?.plainText).toBe("literal _word_ stays literal");
expect(content?.html).toContain("literal _word_ stays literal");
expect(content?.html).not.toContain("<em>");
});
it("gives an admonition no copy control", async () => {
const rendered = await renderMarkdown("> [!NOTE]\n> Heads up", "Heads up");
expect(within(rendered).queryByRole("button", { name: "Copy quote" })).toBeNull();
});
it("copies a nested admonition as its callout source", async () => {
const rendered = await renderMarkdown(
"> Before\n>\n> > [!WARNING]\n> > Do not deploy.\n>\n> After",
"After",
);
const content = createElementClipboardContent(fixtureElement(rendered, "blockquote"));
expect(content?.plainText).toBe("Before\n\n> [!WARNING]\n> Do not deploy.\n\nAfter");
});
it("copies a selection across an admonition as the text it shows, without a callout marker", async () => {
const rendered = await renderMarkdown(
"> Before\n>\n> > [!WARNING]\n> > Do not deploy.\n>\n> After",
"After",
);
rendered.setAttribute("data-testid", "assistant-message");
const body = tokenText(rendered, "Do not deploy.");
expect(
copyBetween([body, "Do not ".length], [tokenText(rendered, "After"), 5])?.plainText,
).toBe("deploy.\n\nAfter");
expect(
copyBetween([tokenText(rendered, "Before"), 0], [tokenText(rendered, "Warning"), 4])
?.plainText,
).toBe("Before\n\nWarn");
expect(
copyBetween([tokenText(rendered, "Before"), 0], [body, "Do not".length])?.plainText,
).not.toContain("[!WARNING]");
});
it("copies a rendered Mermaid diagram as its fence", () => {
const quote = document.createElement("blockquote");
quote.innerHTML = `<p>Before</p><div ${MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE}="graph TD; A-->B" data-paseo-markdown-language="mermaid"><svg aria-label="diagram"></svg></div><p>After</p>`;
expect(createElementClipboardContent(quote)?.plainText).toBe(
"Before\n\n```mermaid\ngraph TD; A-->B\n```\n\nAfter",
);
});
it("copies nothing from a quote that holds only its control", () => {
const quote = document.createElement("blockquote");
quote.innerHTML = '<button data-paseo-markdown-ignore="true">Copy quote</button>';
expect(createElementClipboardContent(quote)).toBeNull();
});
});
@@ -6,12 +6,9 @@ import {
type MarkdownClipboardContent,
} from "@/utils/rich-clipboard";
import {
MARKDOWN_ADMONITION_TITLE_ATTRIBUTE,
MARKDOWN_ADMONITION_TYPE_ATTRIBUTE,
MARKDOWN_COPY_IMAGE_SOURCES_ATTRIBUTE,
MARKDOWN_COPY_ALIGN_ATTRIBUTE,
MARKDOWN_COPY_ALT_ATTRIBUTE,
MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE,
MARKDOWN_COPY_IGNORE_ATTRIBUTE,
MARKDOWN_COPY_LANGUAGE_ATTRIBUTE,
MARKDOWN_COPY_LIST_MARKER_ATTRIBUTE,
@@ -94,17 +91,6 @@ function createTurndown(flavor: "markdown" | "plain"): TurndownService {
} else {
turndown.escape = (text) => text;
}
// An admonition copies as its `> [!TYPE]` source.
turndown.addRule("admonition", {
filter: (node) => node.hasAttribute(MARKDOWN_ADMONITION_TYPE_ATTRIBUTE),
replacement: (content, node) => {
const type = (node as Element)
.getAttribute(MARKDOWN_ADMONITION_TYPE_ATTRIBUTE)!
.toUpperCase();
const body = content.replace(/^\n+|\n+$/g, "");
return `\n\n${`[!${type}]\n${body}`.replace(/^/gm, "> ")}\n\n`;
},
});
turndown.addRule("gfmStrikethrough", {
filter: ["del", "s"],
replacement: (content) => `~~${content}~~`,
@@ -134,53 +120,6 @@ function isWebUrl(href: string): boolean {
const markdownTurndown = createTurndown("markdown");
const plainTurndown = createTurndown("plain");
/**
* A fence rendered as something other than its code, such as a Mermaid diagram, carries
* its source in an attribute. Put the code block back so the fence is what gets copied.
*/
function restoreFenceSources(container: Element): void {
for (const region of container.querySelectorAll(`[${MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE}]`)) {
const source = region.getAttribute(MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE);
if (source === null) continue;
const pre = document.createElement("pre");
const code = document.createElement("code");
const language = region.getAttribute(MARKDOWN_COPY_LANGUAGE_ATTRIBUTE);
if (language) code.className = `language-${language}`;
code.textContent = source;
pre.append(code);
region.replaceWith(pre);
}
}
/**
* Clipboard payload for everything inside `element`, without the element's own syntax:
* a quote's body carries no `>` prefix. Null when there is nothing to copy.
*/
export function createElementClipboardContent(element: Element): MarkdownClipboardContent | null {
const container = document.createElement("div");
container.append(...Array.from(element.childNodes, (child) => child.cloneNode(true)));
const originals = element.querySelectorAll("*");
const copies = container.querySelectorAll("*");
originals.forEach((original, index) => copySemanticAttributes(original, copies[index]!));
restoreFenceSources(container);
restoreAdmonitions(container);
restoreMarkdownElements(container);
return clipboardContentFromMarkup(container);
}
function clipboardContentFromMarkup(container: HTMLElement): MarkdownClipboardContent | null {
const markdown = markdownTurndown.turndown(container).trim();
if (!markdown) {
return null;
}
// text/plain carries unescaped Markdown: a plain target shows backslashes literally.
// text/html is rendered from escaped Markdown, so literal Markdown characters stay
// literal in a rich target.
const plainText = plainTurndown.turndown(container).trim();
const content = createSelectionClipboardContent(markdown, plainText);
return { ...content, html: flattenClipboardListMarkup(content.html) };
}
export function createAssistantSelectionClipboardContent(
selection: Selection | null,
): MarkdownClipboardContent | null {
@@ -206,7 +145,17 @@ export function createAssistantSelectionClipboardContent(
container.append(cloneMarkdownSelection(part.range, part.message));
}
restoreMarkdownElements(container);
return clipboardContentFromMarkup(container);
const markdown = markdownTurndown.turndown(container).trim();
if (!markdown) {
return null;
}
// text/plain carries unescaped Markdown: a plain target shows backslashes literally.
// text/html is rendered from escaped Markdown, so literal Markdown characters stay
// literal in a rich target.
const plainText = plainTurndown.turndown(container).trim();
const content = createSelectionClipboardContent(markdown, plainText);
return { ...content, html: flattenClipboardListMarkup(content.html) };
}
/**
@@ -753,28 +702,6 @@ function numberOrderedListItems(list: Element, start: number): void {
});
}
/**
* The library renders an admonition as a box with a generated title. Keep it a quote
* with its type, so it copies as its callout source rather than as the title's prose.
* Only a whole-element copy does this: a selection cannot tell from its cloned markup
* whether it holds the whole callout, so it copies the text it shows.
*/
function restoreAdmonitions(container: Element): void {
const admonitions = Array.from(
container.querySelectorAll(`[${MARKDOWN_ADMONITION_TYPE_ATTRIBUTE}]`),
);
for (const admonition of admonitions.toReversed()) {
admonition.querySelector(`:scope > [${MARKDOWN_ADMONITION_TITLE_ATTRIBUTE}]`)?.remove();
const quote = document.createElement("blockquote");
quote.setAttribute(
MARKDOWN_ADMONITION_TYPE_ATTRIBUTE,
admonition.getAttribute(MARKDOWN_ADMONITION_TYPE_ATTRIBUTE) ?? "note",
);
quote.append(...admonition.childNodes);
admonition.replaceWith(quote);
}
}
function unwrapIncompleteTables(container: HTMLElement): void {
for (const table of container.querySelectorAll("table")) {
if (hasUsableTableColumnContract(table)) {
@@ -6,13 +6,9 @@ export const MARKDOWN_COPY_UNWRAP_ATTRIBUTE = "data-paseo-markdown-unwrap";
export const MARKDOWN_COPY_RECOGNIZED_LINK_ATTRIBUTE = "data-paseo-markdown-recognized-link";
export const MARKDOWN_COPY_LIST_START_ATTRIBUTE = "data-paseo-markdown-list-start";
export const MARKDOWN_COPY_LANGUAGE_ATTRIBUTE = "data-paseo-markdown-language";
export const MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE = "data-paseo-markdown-fence-source";
export const MARKDOWN_COPY_ALIGN_ATTRIBUTE = "data-paseo-markdown-align";
export const MARKDOWN_COPY_SRC_ATTRIBUTE = "data-paseo-markdown-src";
export const MARKDOWN_COPY_ALT_ATTRIBUTE = "data-paseo-markdown-alt";
/** Set by the Markdown library's web admonition renderer on the box and on its generated title. */
export const MARKDOWN_ADMONITION_TYPE_ATTRIBUTE = "data-enrm-admonition-type";
export const MARKDOWN_ADMONITION_TITLE_ATTRIBUTE = "data-enrm-admonition-title";
/**
* Trailing line breaks, with any indentation that followed the last one.
@@ -1,65 +0,0 @@
import React, { act } from "react";
import { createRoot, type Root } from "react-dom/client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { page } from "vitest/browser";
import { i18n } from "@/i18n/i18next";
import { ContextWindowDetails } from "./context-window-details";
const CONTEXT = { percentage: 40, usedTokens: 80_000, maxTokens: 200_000 };
let root: Root;
let host: HTMLDivElement;
beforeEach(async () => {
await i18n.changeLanguage("en");
vi.stubGlobal("React", React);
vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
host = document.createElement("div");
document.body.appendChild(host);
root = createRoot(host);
});
afterEach(() => {
act(() => root.unmount());
host.remove();
vi.unstubAllGlobals();
});
function renderDetails(sessionMetrics: AgentMetric[]): void {
act(() =>
root.render(
<QueryClientProvider client={new QueryClient()}>
<ContextWindowDetails
serverId="server"
agentId="agent"
context={CONTEXT}
sessionCost="$1.20"
sessionMetrics={sessionMetrics}
showTitle
refreshable={false}
/>
</QueryClientProvider>,
),
);
}
it("shows what the provider reports about the session", async () => {
renderDetails([
{ label: "Model", value: "opus" },
{ label: "Requests", value: "12" },
]);
await expect.element(page.getByText("Model")).toBeVisible();
await expect.element(page.getByText("opus")).toBeVisible();
await expect.element(page.getByText("Requests")).toBeVisible();
await expect.element(page.getByText("Session cost $1.20")).toBeVisible();
});
it("leaves the cost to the provider when it reports one", async () => {
renderDetails([{ label: "Cost", value: "$1.25" }]);
await expect.element(page.getByText("$1.25")).toBeVisible();
expect(page.getByText("Session cost $1.20").elements()).toHaveLength(0);
});
@@ -1,10 +1,8 @@
import { Text, View } from "react-native";
import { StyleSheet } from "react-native-unistyles";
import { useTranslation } from "react-i18next";
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import { AgentUsage } from "@/usage";
import { formatTokenCount } from "./context-window-meter.utils";
import { MetricsList } from "./metrics-list";
interface ContextWindowDetailsProps {
serverId: string;
@@ -15,8 +13,6 @@ interface ContextWindowDetailsProps {
maxTokens: number;
} | null;
sessionCost: string | null;
/** What the provider reports about the session. A reported cost replaces `sessionCost`. */
sessionMetrics: AgentMetric[];
/** The hover card and tooltip title themselves; the sheet's header carries the title instead. */
showTitle: boolean;
/** Whether the usage cards have a Refresh button; without one they show their freshness. */
@@ -24,22 +20,18 @@ interface ContextWindowDetailsProps {
}
/**
* What the context window meter opens: how full the window is, what the provider reports about the
* session, then the usage of the agent's account. The desktop hover card, the native wide tooltip, and the compact sheet all render it.
* What the context window meter opens: how full the window is, then the usage of the agent's
* account. The desktop hover card, the native wide tooltip, and the compact sheet all render it.
*/
export function ContextWindowDetails({
serverId,
agentId,
context,
sessionCost,
sessionMetrics,
showTitle,
refreshable,
}: ContextWindowDetailsProps) {
const { t } = useTranslation();
const providerReportsCost = sessionMetrics.some(
(metric) => metric.label.toLowerCase() === "cost",
);
return (
<>
<View style={styles.summary}>
@@ -59,11 +51,10 @@ export function ContextWindowDetails({
) : (
<Text style={styles.detail}>{t("contextWindow.noData")}</Text>
)}
{sessionCost && !providerReportsCost ? (
{sessionCost ? (
<Text style={styles.detail}>{t("contextWindow.sessionCost", { cost: sessionCost })}</Text>
) : null}
</View>
{sessionMetrics.length > 0 ? <MetricsList metrics={sessionMetrics} /> : null}
<AgentUsage serverId={serverId} agentId={agentId} refreshable={refreshable} />
</>
);
@@ -13,12 +13,11 @@ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/h
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { useIsCompactFormFactor } from "@/constants/layout";
import { isNative } from "@/constants/platform";
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import { useHostReportsUsage } from "@/usage";
import type { Theme } from "@/styles/theme";
import { TOOLBAR_DISC_SIZE, type ToolbarRing } from "@/components/ui/control-geometry";
import { ContextWindowDetails } from "./context-window-details";
import { DetailsSheet } from "./details-sheet";
import { ContextWindowSheet } from "./context-window-sheet";
import { formatContextPercentage } from "./context-window-meter.utils";
interface ContextWindowMeterProps {
@@ -27,14 +26,11 @@ interface ContextWindowMeterProps {
maxTokens: number | null;
usedTokens: number | null;
totalCostUsd?: number | null;
/** What the provider reports about the session, shown in the details. */
sessionMetrics?: AgentMetric[];
showPercentage?: boolean;
/** The ring's box and stroke when it sits in an icon toolbar. */
toolbarRing?: ToolbarRing;
}
const EMPTY_METRICS: AgentMetric[] = [];
const SVG_SIZE = 14;
const USAGE_POPOVER_WIDTH = 300;
const COMPACT_SVG_SIZE = 12;
@@ -160,16 +156,13 @@ export function ContextWindowMeter({
maxTokens,
usedTokens,
totalCostUsd,
sessionMetrics = EMPTY_METRICS,
showPercentage = false,
toolbarRing,
}: ContextWindowMeterProps) {
const { t, i18n } = useTranslation();
const { width } = useWindowDimensions();
// Usage cards and session metrics need a wider popover; without them it keeps the plain tooltip
// shape.
// Usage cards need a wider popover; without them it keeps the plain tooltip shape.
const showsUsage = useHostReportsUsage(serverId);
const isWide = showsUsage || sessionMetrics.length > 0;
const popoverWidth = Math.min(USAGE_POPOVER_WIDTH, width - 24);
// Compact screens open the details in a sheet, which can hold a pressable Refresh.
const isCompact = useIsCompactFormFactor();
@@ -233,22 +226,21 @@ export function ContextWindowMeter({
{ring}
{percentageLabel}
</Pressable>
<DetailsSheet open={isSheetOpen} onClose={closeSheet} title={t("contextWindow.title")}>
<ContextWindowSheet open={isSheetOpen} onClose={closeSheet}>
<ContextWindowDetails
serverId={serverId}
agentId={agentId}
context={context}
sessionCost={formattedSessionCost}
sessionMetrics={sessionMetrics}
showTitle={false}
refreshable
/>
</DetailsSheet>
</ContextWindowSheet>
</>
);
}
const popoverStyle = isWide
const popoverStyle = showsUsage
? [styles.usagePopover, { width: popoverWidth }]
: styles.plainPopover;
@@ -272,7 +264,7 @@ export function ContextWindowMeter({
side="top"
align="center"
offset={8}
maxWidth={isWide ? popoverWidth : undefined}
maxWidth={showsUsage ? popoverWidth : undefined}
style={popoverStyle}
testID="context-window-meter-tooltip"
>
@@ -281,7 +273,6 @@ export function ContextWindowMeter({
agentId={agentId}
context={context}
sessionCost={formattedSessionCost}
sessionMetrics={sessionMetrics}
showTitle
refreshable={false}
/>
@@ -316,7 +307,6 @@ export function ContextWindowMeter({
agentId={agentId}
context={context}
sessionCost={formattedSessionCost}
sessionMetrics={sessionMetrics}
showTitle
refreshable
/>
@@ -1,6 +1,7 @@
import { useMemo, type ReactNode } from "react";
import { View, useWindowDimensions } from "react-native";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import { useTranslation } from "react-i18next";
import { BottomSheetScrollView } from "@gorhom/bottom-sheet";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { SheetHeaderView, SHEET_HORIZONTAL_PADDING_SCALE } from "@/components/adaptive-modal-sheet";
@@ -22,24 +23,23 @@ const ThemedBottomSheetModal = withUnistyles(IsolatedBottomSheetModal, (theme) =
}));
/**
* What a hover card or tooltip shows on wide screens, shown on compact screens in a sheet as tall
* as its content. Gorhom mounts the content only while the sheet is presented, so whatever it
* fetches stops once the sheet closes.
* The context window meter's details on compact screens, in a sheet as tall as its content.
* Gorhom mounts the content only while the sheet is presented, so whatever it fetches stops once
* the sheet closes.
*/
export function DetailsSheet({
export function ContextWindowSheet({
open,
onClose,
title,
children,
}: {
open: boolean;
onClose: () => void;
title: string;
children: ReactNode;
}) {
const { t } = useTranslation();
const { height } = useWindowDimensions();
const insets = useSafeAreaInsets();
const header = useMemo(() => ({ title }), [title]);
const header = useMemo(() => ({ title: t("contextWindow.title") }), [t]);
const scrollContentStyle = useMemo(() => ({ paddingBottom: insets.bottom }), [insets.bottom]);
const { sheetRef, handleSheetChange, handleSheetDismiss } = useIsolatedBottomSheetVisibility({
visible: open,
@@ -50,8 +50,7 @@ export function DetailsSheet({
<ThemedBottomSheetModal
ref={sheetRef}
contextBridge={null}
// Content-sized rather than fixed snap points: a few rows of details, or usage cards that
// stream in one at a time.
// Content-sized rather than fixed snap points: the usage cards stream in one at a time.
enableDynamicSizing
maxDynamicContentSize={height * 0.8}
onChange={handleSheetChange}
@@ -1,9 +1,17 @@
import React, { useCallback, useMemo, useState } from "react";
import { View, Text, type StyleProp, type TextStyle, type ViewStyle } from "react-native";
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
Pressable,
View,
Text,
type StyleProp,
type TextStyle,
type ViewStyle,
} from "react-native";
import { StyleSheet } from "react-native-unistyles";
import * as Clipboard from "expo-clipboard";
import { Check, Copy } from "lucide-react-native";
import { useTranslation } from "react-i18next";
import type { HighlightToken } from "@getpaseo/highlight";
import { BlockCopyButton } from "@/components/markdown/block-copy-button";
import { isNative, isWeb } from "@/constants/platform";
import { useIsCompactFormFactor } from "@/constants/layout";
import { syntaxTokenStyleFor } from "@/styles/syntax-token-styles";
@@ -77,7 +85,6 @@ export const HighlightedCodeBlock = React.memo(function HighlightedCodeBlock({
[renderedCode, language],
);
const { t } = useTranslation();
const isCompact = useIsCompactFormFactor();
const [isHovered, setIsHovered] = useState(false);
const handlePointerEnter = useCallback(() => setIsHovered(true), []);
@@ -86,11 +93,7 @@ export const HighlightedCodeBlock = React.memo(function HighlightedCodeBlock({
// Copy the code without its trailing blank lines. A fence body ends in a newline,
// and ends in more than one when the author left a blank line before the closing
// fence; pasting any of them into a terminal runs the last line.
const copyCode = useCallback(async () => {
const content = code.replace(TRAILING_CODE_LINE_BREAKS, "");
if (!content) return false;
return Clipboard.setStringAsync(content);
}, [code]);
const getCode = useCallback(() => code.replace(TRAILING_CODE_LINE_BREAKS, ""), [code]);
return (
<View
@@ -108,11 +111,7 @@ export const HighlightedCodeBlock = React.memo(function HighlightedCodeBlock({
{renderedCode}
</Text>
)}
<BlockCopyButton
onCopy={copyCode}
visible={controlsVisible}
label={t("message.actions.copyCode")}
/>
<CopyButton getCode={getCode} visible={controlsVisible} />
</View>
);
});
@@ -169,3 +168,87 @@ function splitFenceStyle(inheritedStyles: TextStyle, textStyle: TextStyle): Spli
innerTextStyle: [inheritedStyles, textOnly],
};
}
interface CopyButtonProps {
getCode: () => string;
visible: boolean;
}
const COPIED_RESET_MS = 1500;
const CopyButton = React.memo(function CopyButton({ getCode, visible }: CopyButtonProps) {
const { t } = useTranslation();
const [copied, setCopied] = useState(false);
const resetRef = useRef<ReturnType<typeof setTimeout> | null>(null);
useEffect(
() => () => {
if (resetRef.current) clearTimeout(resetRef.current);
},
[],
);
const handlePress = useCallback(async () => {
const content = getCode();
if (!content) return;
await Clipboard.setStringAsync(content);
setCopied(true);
if (resetRef.current) clearTimeout(resetRef.current);
resetRef.current = setTimeout(() => {
setCopied(false);
resetRef.current = null;
}, COPIED_RESET_MS);
}, [getCode]);
const visibilityStyle = visible
? copyButtonStyles.containerVisible
: copyButtonStyles.containerHidden;
const wrapperStyle = useMemo(
() => [copyButtonStyles.container, visibilityStyle],
[visibilityStyle],
);
return (
<Pressable
onPress={handlePress}
style={wrapperStyle}
pointerEvents={visible ? "auto" : "none"}
accessibilityRole="button"
accessibilityLabel={copied ? t("message.actions.copied") : t("message.actions.copyCode")}
hitSlop={8}
dataSet={markdownCopyDataSet.ignore}
>
{({ hovered }) => {
const iconColor = hovered
? copyButtonStyles.iconHoveredColor.color
: copyButtonStyles.iconColor.color;
return copied ? (
<Check size={14} color={iconColor} />
) : (
<Copy size={14} color={iconColor} />
);
}}
</Pressable>
);
});
const copyButtonStyles = StyleSheet.create((theme) => ({
container: {
position: "absolute",
top: theme.spacing[2],
right: theme.spacing[2],
padding: theme.spacing[1],
},
containerVisible: {
opacity: 1,
},
containerHidden: {
opacity: 0,
},
iconColor: {
color: theme.colors.foregroundMuted,
},
iconHoveredColor: {
color: theme.colors.foreground,
},
}));
@@ -1,5 +1,6 @@
import { useCallback, useMemo, type ReactElement, type ReactNode } from "react";
import { Pressable, View } from "react-native";
import type { GestureResponderEvent } from "react-native";
import { Plus, Server, Settings } from "lucide-react-native";
import { StyleSheet, useUnistyles } from "react-native-unistyles";
import { HostStatusDot } from "@/components/host-status-dot";
@@ -79,15 +80,19 @@ export function HostPickerOption({
? formatActiveConnectionLabel(activeConnection)
: undefined;
const leadingSlot = useMemo(() => <HostStatusDotSlot serverId={serverId} />, [serverId]);
const handleSettingsPress = useCallback(() => {
onOpenHostSettings?.(serverId);
}, [onOpenHostSettings, serverId]);
const trailingAction = useMemo(() => {
const handleSettingsPress = useCallback(
(event: GestureResponderEvent) => {
event.stopPropagation();
onOpenHostSettings?.(serverId);
},
[onOpenHostSettings, serverId],
);
const trailingSlot = useMemo(() => {
if (!onOpenHostSettings) return undefined;
return (
<Pressable
onPress={handleSettingsPress}
style={styles.settingsAction}
hitSlop={8}
accessibilityRole="button"
accessibilityLabel={`Open ${label} settings`}
>
@@ -107,7 +112,7 @@ export function HostPickerOption({
label={label}
description={connectionLabel}
leadingSlot={leadingSlot}
trailingAction={trailingAction}
trailingSlot={trailingSlot}
selected={selected}
active={active}
onPress={onPress}
@@ -314,12 +319,6 @@ export function HostPicker({
}
const styles = StyleSheet.create((theme) => ({
settingsAction: {
flex: 1,
justifyContent: "center",
paddingLeft: theme.spacing[1],
paddingRight: theme.spacing[3],
},
statusDotSlot: {
width: theme.iconSize.sm,
height: theme.iconSize.sm,
@@ -1,119 +0,0 @@
import { flushSync } from "react-dom";
import { createRoot, type Root } from "react-dom/client";
import { within } from "@testing-library/dom";
import { userEvent } from "vitest/browser";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { I18nextProvider } from "react-i18next";
import type { ToastApi } from "@/components/toast-host";
import { ToastApiProvider } from "@/contexts/toast-api-context";
import { i18n } from "@/i18n/i18next";
import { BlockCopyButton } from "./block-copy-button";
const LABEL = "Copy quote";
let errors: string[] = [];
const toast: ToastApi = {
show: () => () => {},
copied: () => {},
error: (message) => errors.push(message),
};
describe("BlockCopyButton", () => {
let root: Root;
let host: HTMLDivElement;
beforeEach(async () => {
await i18n.changeLanguage("en");
errors = [];
host = document.createElement("div");
document.body.append(host);
root = createRoot(host);
});
afterEach(() => {
flushSync(() => root.unmount());
host.remove();
});
function render(onCopy: () => Promise<boolean>, visible = true) {
flushSync(() =>
root.render(
<I18nextProvider i18n={i18n}>
<ToastApiProvider api={toast}>
<BlockCopyButton onCopy={onCopy} visible={visible} label={LABEL} />
</ToastApiProvider>
</I18nextProvider>,
),
);
}
function button(name = LABEL): HTMLElement {
return within(host).getByRole("button", { name });
}
it("shows Copied after a write and returns to its label", async () => {
let calls = 0;
render(async () => {
calls += 1;
return true;
});
await userEvent.click(button());
await vi.waitFor(() => expect(button("Copied")).toBeTruthy());
await vi.waitFor(() => expect(button()).toBeTruthy(), { timeout: 2500 });
expect(calls).toBe(1);
expect(errors).toEqual([]);
});
it.each([
["resolves false", async () => false],
[
"rejects",
async (): Promise<boolean> => {
throw new Error("Clipboard denied");
},
],
])("tells the user and never shows Copied when the write %s", async (_case, failure) => {
let calls = 0;
render(() => {
calls += 1;
return calls === 1 ? failure() : Promise.resolve(true);
});
await userEvent.click(button());
await vi.waitFor(() => expect(errors).toEqual(["Unable to copy"]));
expect(within(host).queryByRole("button", { name: "Copied" })).toBeNull();
await userEvent.click(button());
await vi.waitFor(() => expect(button("Copied")).toBeTruthy());
expect(calls).toBe(2);
});
it("does not write twice while a write is pending", async () => {
let finish!: (written: boolean) => void;
let calls = 0;
render(() => {
calls += 1;
return new Promise<boolean>((resolve) => {
finish = resolve;
});
});
await userEvent.click(button());
await userEvent.click(button());
expect(calls).toBe(1);
finish(true);
await vi.waitFor(() => expect(button("Copied")).toBeTruthy());
expect(calls).toBe(1);
});
it("stays hidden until its block reveals it or it takes keyboard focus", async () => {
render(async () => true, false);
expect(getComputedStyle(button()).opacity).toBe("0");
await userEvent.tab();
expect(document.activeElement).toBe(button());
await vi.waitFor(() => expect(getComputedStyle(button()).opacity).toBe("1"));
});
});
@@ -1,109 +0,0 @@
import { memo, useCallback, useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { Check, Copy } from "lucide-react-native";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import { useTranslation } from "react-i18next";
import { markdownCopyDataSet } from "@/assistant-selection-copy/markup";
import { mutedIconColorMapping } from "@/components/ui/icon-color";
import { smallIconButtonChromeFrameSize } from "@/components/ui/icon-button-chrome";
import { paneContentToolbarIconSize, ToolbarButton } from "@/components/ui/pane-content-toolbar";
import { useIsCompactFormFactor } from "@/constants/layout";
import { useToast } from "@/contexts/toast-api-context";
import type { Theme } from "@/styles/theme";
const ThemedCopy = withUnistyles(Copy, mutedIconColorMapping);
const ThemedCheck = withUnistyles(Check, mutedIconColorMapping);
const COPIED_RESET_MS = 1500;
/** How far the copy glyph sits from the top and trailing edges of its block. */
export function blockCopyGlyphInset(theme: Theme): number {
return theme.spacing[2] + theme.spacing[1];
}
interface BlockCopyButtonProps {
/** Writes the block to the clipboard. Resolves false, or rejects, when nothing was written. */
onCopy: () => Promise<boolean>;
/** The block's own reveal state. Keyboard focus shows the button regardless. */
visible: boolean;
label: string;
}
/**
* The copy control in the top trailing corner of a Markdown block. The block is its
* positioned ancestor.
*/
export const BlockCopyButton = memo(function BlockCopyButton({
onCopy,
visible,
label,
}: BlockCopyButtonProps) {
const { t } = useTranslation();
const toast = useToast();
const compact = useIsCompactFormFactor();
const [copied, setCopied] = useState(false);
const [focused, setFocused] = useState(false);
const writing = useRef(false);
const resetRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const focus = useCallback(() => setFocused(true), []);
const blur = useCallback(() => setFocused(false), []);
useEffect(
() => () => {
if (resetRef.current) clearTimeout(resetRef.current);
},
[],
);
const handlePress = useCallback(async () => {
// A slow clipboard must not queue a second write behind the first.
if (writing.current) return;
writing.current = true;
const written = await onCopy()
.catch(() => false)
.finally(() => {
writing.current = false;
});
if (!written) {
toast.error(t("common.errors.unableToCopy"));
return;
}
setCopied(true);
if (resetRef.current) clearTimeout(resetRef.current);
resetRef.current = setTimeout(() => setCopied(false), COPIED_RESET_MS);
}, [onCopy, t, toast]);
const shown = visible || focused;
const Glyph = copied ? ThemedCheck : ThemedCopy;
return (
<View style={styles.corner(compact)} dataSet={markdownCopyDataSet.ignore}>
<ToolbarButton
compact={compact}
label={copied ? t("message.actions.copied") : label}
onPress={handlePress}
onFocus={focus}
onBlur={blur}
style={shown ? styles.shown : styles.hidden}
>
<Glyph size={paneContentToolbarIconSize(compact)} />
</ToolbarButton>
</View>
);
});
const styles = StyleSheet.create((theme) => ({
// The glyph, not the button frame, sits on the inset; the frame overhangs it.
corner: (compact: boolean) => {
const frameOverhang =
(smallIconButtonChromeFrameSize(compact) - paneContentToolbarIconSize(compact)) / 2;
const inset = blockCopyGlyphInset(theme) - frameOverhang;
return {
position: "absolute" as const,
top: inset,
right: inset,
pointerEvents: "box-none" as const,
};
},
shown: { opacity: 1, pointerEvents: "auto" },
hidden: { opacity: 0, pointerEvents: "none" },
}));
@@ -5,10 +5,6 @@ import { useTranslation } from "react-i18next";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import { HighlightedCodeBlock } from "@/components/highlighted-code-block";
import { ZoomableViewport } from "@/components/zoomable-viewport";
import {
MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE,
MARKDOWN_COPY_LANGUAGE_ATTRIBUTE,
} from "@/assistant-selection-copy/markup";
import type { Theme } from "@/styles/theme";
import type { MarkdownFenceRendererProps } from "./types";
import { MermaidFullscreenViewer } from "./fullscreen-viewer.web";
@@ -85,16 +81,6 @@ function MermaidFenceHostImpl({
[visible],
);
const sourceVisible = !diagramVisible;
// A visible diagram stands in for its fence, so copying the surrounding block takes
// the source from here: the revision on screen, which lags `code` while a streamed
// revision renders. The source view copies as its own code block.
const diagramCopyAttributes =
diagramVisible && visible
? {
[MARKDOWN_COPY_FENCE_SOURCE_ATTRIBUTE]: visible.source,
[MARKDOWN_COPY_LANGUAGE_ATTRIBUTE]: "mermaid",
}
: null;
const viewportStyle = diagramVisible ? diagramStyle : measuringStyle;
return (
@@ -125,7 +111,7 @@ function MermaidFenceHostImpl({
) : null}
</View>
) : null}
<div inert={!diagramVisible} style={boundaryStyle} {...diagramCopyAttributes}>
<div inert={!diagramVisible} style={boundaryStyle}>
<ZoomableViewport
accessibilityLabel={t("message.diagram.diagram")}
actions={actions}
@@ -1,71 +0,0 @@
import { useCallback, useMemo, useRef, useState } from "react";
import { withUnistyles } from "react-native-unistyles";
import type { BlockquoteRendererProps } from "react-native-enriched-markdown";
import { useTranslation } from "react-i18next";
import { createElementClipboardContent } from "@/assistant-selection-copy/content.web";
import { smallIconButtonChromeFrameSize } from "@/components/ui/icon-button-chrome";
import { paneContentToolbarIconSize } from "@/components/ui/pane-content-toolbar";
import { useIsCompactFormFactor } from "@/constants/layout";
import { writeClipboardContent } from "@/utils/rich-clipboard";
import { getDefaultMarkdownClipboardEnvironment } from "@/utils/rich-clipboard-default-environment";
import { BlockCopyButton, blockCopyGlyphInset } from "./block-copy-button";
interface WebBlockquoteProps extends BlockquoteRendererProps {
copyGlyphInset: number;
}
/**
* Room the quote reserves so the control never covers its text. Compact layouts always
* show the control, so it gets a band above the body and the text keeps the full width.
* Wide layouts reveal it on hover, where a band would leave an empty strip above every
* quote, so the text wraps short of it instead.
*/
function copyRoom(compact: boolean, glyphInset: number) {
if (compact) {
return { paddingTop: glyphInset + paneContentToolbarIconSize(compact) + glyphInset };
}
return { paddingRight: smallIconButtonChromeFrameSize(compact) + glyphInset };
}
/** A quote with a control that copies its body, for drafts an agent wrote to be pasted elsewhere. */
export const WebBlockquote = withUnistyles(
function WebBlockquote({ blockquoteProps, children, copyGlyphInset }: WebBlockquoteProps) {
const { t } = useTranslation();
const quote = useRef<HTMLQuoteElement>(null);
const [hovered, setHovered] = useState(false);
const compact = useIsCompactFormFactor();
const enter = useCallback(() => setHovered(true), []);
const leave = useCallback(() => setHovered(false), []);
const style = useMemo(
() => ({
...blockquoteProps.style,
position: "relative" as const,
...copyRoom(compact, copyGlyphInset),
}),
[blockquoteProps.style, compact, copyGlyphInset],
);
const copy = useCallback(async () => {
// Read the rendered body at press time: a streaming quote copies what it shows now.
const content = quote.current && createElementClipboardContent(quote.current);
if (!content) return false;
return writeClipboardContent(content, getDefaultMarkdownClipboardEnvironment());
}, []);
return (
<blockquote
{...blockquoteProps}
ref={quote}
style={style}
onPointerEnter={enter}
onPointerLeave={leave}
>
<BlockCopyButton
onCopy={copy}
visible={hovered || compact}
label={t("message.actions.copyQuote")}
/>
{children}
</blockquote>
);
},
(theme) => ({ copyGlyphInset: blockCopyGlyphInset(theme) }),
);
@@ -14,7 +14,6 @@ import { HighlightedCodeBlock } from "@/components/highlighted-code-block";
import type { Theme } from "@/styles/theme";
import { MermaidFence } from "./fence/mermaid";
import { isRecognizedLink, markdownLinkSource } from "./source";
import { WebBlockquote } from "./quote-block.web";
const ThemedCodeBlock = withUnistyles(HighlightedCodeBlock);
const codeStyle = (theme: Theme) => ({
@@ -112,8 +111,4 @@ const styles = StyleSheet.create((theme) => ({
},
}));
export const WEB_RENDERERS: MarkdownRenderers = {
codeBlock: WebCodeBlock,
link: WebLink,
blockquote: WebBlockquote,
};
export const WEB_RENDERERS: MarkdownRenderers = { codeBlock: WebCodeBlock, link: WebLink };
+2 -14
View File
@@ -3,7 +3,6 @@ import { MessagePreview, MessageSender } from "@/components/user-message";
import { useStableEvent } from "@/hooks/use-stable-event";
import { getAgentAttachmentPillContent } from "@/attachments/attachment-pill-content";
import { AssistantForkMenu, type AssistantForkTarget } from "@/components/assistant-fork-menu";
import { TurnMetricsButton } from "@/components/turn-metrics";
import { AttachmentLightbox, type ImageLightboxSource } from "@/components/attachment-lightbox";
import {
AttachmentFrame,
@@ -37,11 +36,7 @@ import { useToolCallExpanded } from "@/tool-calls/expansion-context";
import { useTargetAgentTitle } from "@/tool-calls/use-target-agent-title";
import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
import type { AgentMessage } from "@getpaseo/protocol/agent-message";
import type {
AgentCapabilityFlags,
AgentMetric,
ToolCallDetail,
} from "@getpaseo/protocol/agent-types";
import type { AgentCapabilityFlags, ToolCallDetail } from "@getpaseo/protocol/agent-types";
import type { AgentAttachment } from "@getpaseo/protocol/messages";
import MaskedView from "@react-native-masked-view/masked-view";
import {
@@ -565,8 +560,6 @@ interface AssistantTurnFooterProps {
completedAt?: Date;
durationMs?: number | null;
onFork?: (target: AssistantForkTarget) => Promise<void> | void;
/** What the provider reported about the turn. Without any, the footer has no stats button. */
metrics?: AgentMetric[];
}
const assistantTurnFooterStylesheet = StyleSheet.create((theme) => ({
@@ -603,8 +596,6 @@ const assistantTurnFooterStylesheet = StyleSheet.create((theme) => ({
flexShrink: 0,
color: theme.colors.foregroundMuted,
fontSize: STREAM_METADATA_FONT_SIZE,
// React Native Web preserves trailing spaces at line wraps by default.
...(isWeb ? { whiteSpace: "normal" } : {}),
},
overlappingLabel: {
marginLeft: "-100%",
@@ -626,7 +617,6 @@ export const AssistantTurnFooter = memo(function AssistantTurnFooter({
completedAt,
durationMs,
onFork,
metrics,
}: AssistantTurnFooterProps) {
const { t } = useTranslation();
const [hovered, setHovered] = useState(false);
@@ -676,11 +666,10 @@ export const AssistantTurnFooter = memo(function AssistantTurnFooter({
[onFork],
);
const canFork = Boolean(onFork);
const hasMetrics = metrics !== undefined && metrics.length > 0;
return (
<View style={assistantTurnFooterStylesheet.container}>
{getContent || canFork || hasMetrics ? (
{getContent || canFork ? (
<View style={assistantTurnFooterStylesheet.actions}>
{getContent ? (
<TurnCopyButton
@@ -689,7 +678,6 @@ export const AssistantTurnFooter = memo(function AssistantTurnFooter({
/>
) : null}
{canFork ? <AssistantForkMenu onFork={handleFork} /> : null}
{hasMetrics ? <TurnMetricsButton metrics={metrics} /> : null}
</View>
) : null}
{primaryLabel ? (
@@ -1,72 +0,0 @@
import { memo } from "react";
import { Text, View } from "react-native";
import { StyleSheet } from "react-native-unistyles";
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
/**
* Label and value rows a provider reports for a session or a turn. The provider owns the words and
* the tone; the list only lines them up.
*/
export const MetricsList = memo(function MetricsList({
metrics,
testID,
}: {
metrics: AgentMetric[];
testID?: string;
}) {
return (
<View style={styles.list} testID={testID}>
{metrics.map((metric) => (
<View key={metric.label} style={styles.row}>
<Text style={styles.label} numberOfLines={1}>
{metric.label}
</Text>
<Text style={[styles.value, toneStyle(metric.tone)]} numberOfLines={1}>
{metric.value}
</Text>
</View>
))}
</View>
);
});
function toneStyle(tone: AgentMetric["tone"]) {
switch (tone) {
case "ok":
return styles.ok;
case "warning":
return styles.warning;
case "danger":
return styles.danger;
default:
return null;
}
}
const styles = StyleSheet.create((theme) => ({
list: {
gap: theme.spacing[1.5],
},
row: {
flexDirection: "row",
alignItems: "baseline",
gap: theme.spacing[6],
},
label: {
flexShrink: 1,
color: theme.colors.foregroundMuted,
fontSize: theme.fontSize.sm,
lineHeight: theme.fontSize.sm * 1.4,
},
value: {
flex: 1,
textAlign: "right",
color: theme.colors.foreground,
fontSize: theme.fontSize.sm,
lineHeight: theme.fontSize.sm * 1.4,
fontVariant: ["tabular-nums"],
},
ok: { color: theme.colors.statusSuccess },
warning: { color: theme.colors.statusWarning },
danger: { color: theme.colors.statusDanger },
}));
@@ -1,15 +1,13 @@
import { AppearanceText as Text } from "@/appearance/text";
import { ChevronRight } from "lucide-react-native";
import { useMemo, type ReactNode } from "react";
import { Platform, ScrollView, View, type PressableStateCallbackType } from "react-native";
import { Platform, ScrollView, View } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import { StyleSheet } from "react-native-unistyles";
import { BackHeader } from "@/components/headers/back-header";
import { MenuHeader } from "@/components/headers/menu-header";
import { PressHighlight } from "@/components/ui/press-highlight";
import { useIsCompactFormFactor } from "@/constants/layout";
import { ICON_SIZE, SPACING, type Theme } from "@/styles/theme";
import { SPACING } from "@/styles/theme";
const PageScrollView = Platform.OS === "android" ? KeyboardAwareScrollView : ScrollView;
@@ -60,7 +58,14 @@ export function PageLayout({
testID={testID}
>
<View style={width === "wide" ? styles.contentWide : styles.content}>
{showTitle ? <PageTitle title={title} actions={actions} testID={titleTestID} /> : null}
{showTitle ? (
<View style={styles.titleRow} testID={titleTestID}>
<Text style={styles.title} testID="page-title">
{title}
</Text>
{actions}
</View>
) : null}
{children}
</View>
</PageScrollView>
@@ -68,77 +73,6 @@ export function PageLayout({
);
}
/** The page that holds this one. Its name is the first part of the title and goes back to it. */
export interface PageTitleParent {
label: string;
/** What the press does, such as "Back to providers". */
accessibilityLabel: string;
onPress: () => void;
testID?: string;
}
interface PageTitleProps {
parent?: PageTitleParent;
/** Drawn before the title, such as the icon of the thing the page is about. */
icon?: ReactNode;
title?: string;
/** A control that belongs to the title, drawn right after it. */
adornment?: ReactNode;
/** Controls for the whole page, drawn at the trailing edge. */
actions?: ReactNode;
testID?: string;
titleTestID?: string;
}
/**
* The heading of a desktop page. A page that opens from another page, such as one provider from
* Providers, names that page first: "Providers > Antigravity".
*/
export function PageTitle({
parent,
icon,
title,
adornment,
actions,
testID,
titleTestID = "page-title",
}: PageTitleProps) {
return (
<View style={styles.titleRow} testID={testID}>
<View style={styles.titleParts}>
{parent ? (
<PressHighlight
accessibilityRole="button"
accessibilityLabel={parent.accessibilityLabel}
onPress={parent.onPress}
testID={parent.testID}
>
{({ hovered }: PressableStateCallbackType & { hovered?: boolean }) => (
<Text style={[styles.title, styles.parent, hovered && styles.parentHovered]}>
{parent.label}
</Text>
)}
</PressHighlight>
) : null}
{parent && title !== undefined ? (
<ThemedChevronRight size={ICON_SIZE.lg} uniProps={separatorColor} />
) : null}
{icon}
{title !== undefined ? (
<Text style={[styles.title, styles.titleLeaf]} numberOfLines={1} testID={titleTestID}>
{title}
</Text>
) : null}
{adornment}
</View>
{actions}
</View>
);
}
const ThemedChevronRight = withUnistyles(ChevronRight);
const separatorColor = (theme: Theme) => ({ color: theme.colors.foregroundMuted });
const styles = StyleSheet.create((theme) => ({
container: {
flex: 1,
@@ -168,27 +102,11 @@ const styles = StyleSheet.create((theme) => ({
gap: theme.spacing[4],
marginBottom: theme.spacing[6],
},
titleParts: {
title: {
// Line up with the section titles, which sit inset from their cards.
marginLeft: theme.spacing[1],
flexDirection: "row",
alignItems: "center",
gap: theme.spacing[2],
flexShrink: 1,
minWidth: 0,
},
title: {
fontSize: theme.fontSize["4xl"],
fontWeight: theme.fontWeight.medium,
color: theme.colors.foreground,
},
titleLeaf: {
flexShrink: 1,
},
parent: {
color: theme.colors.foregroundMuted,
},
parentHovered: {
color: theme.colors.foreground,
},
}));
@@ -2,9 +2,7 @@ import { ArrowLeft } from "lucide-react-native";
import type { ReactNode } from "react";
import { Text, View } from "react-native";
import { StyleSheet } from "react-native-unistyles";
import { PageTitle, type PageTitleParent } from "@/components/page-layout";
import { Button } from "@/components/ui/button";
import { useIsCompactFormFactor } from "@/constants/layout";
/**
* "Back to …" above a settings detail page on wide layouts, where the page has no header of its
@@ -34,43 +32,32 @@ export function SettingsBackLink({
}
/**
* The top of a settings detail page: the icon and name of the thing the page is about, with an
* optional action after the name. On wide layouts it is the page's title and names the parent page
* first, which goes back to it. On compact layouts the back header already names the parent.
* The top of a settings detail page: "Back to …" when the page has no header of its own, then the
* icon and name the page is about, with an optional action after the name.
*/
export function SettingsDetailHeader({
parent,
back,
icon,
title,
trailing,
titleTestID,
}: {
parent: PageTitleParent;
icon?: ReactNode;
/** Absent while the page has nothing to name, such as a project that no longer exists. */
title?: string;
back?: { label: string; onPress: () => void; testID?: string };
icon: ReactNode;
title: string;
trailing?: ReactNode;
titleTestID?: string;
}) {
const isCompact = useIsCompactFormFactor();
if (!isCompact)
return (
<PageTitle
parent={parent}
icon={icon}
title={title}
adornment={trailing}
titleTestID={titleTestID}
/>
);
if (title === undefined) return null;
return (
<View style={styles.titleRow}>
{icon}
<Text style={styles.title} numberOfLines={1} testID={titleTestID}>
{title}
</Text>
{trailing}
<View style={styles.header}>
{back ? <SettingsBackLink {...back} /> : null}
<View style={styles.titleRow}>
{icon}
<Text style={styles.title} numberOfLines={1} testID={titleTestID}>
{title}
</Text>
{trailing}
</View>
</View>
);
}
@@ -80,13 +67,15 @@ const styles = StyleSheet.create((theme) => ({
alignSelf: "flex-start",
paddingHorizontal: 0,
},
header: {
gap: theme.spacing[2],
marginBottom: theme.spacing[4],
},
titleRow: {
// Line up with the section titles, which sit inset from their cards.
marginLeft: theme.spacing[1],
marginTop: theme.spacing[2],
flexDirection: "row",
alignItems: "center",
gap: theme.spacing[3],
marginBottom: theme.spacing[4],
},
title: {
color: theme.colors.foreground,
@@ -1,22 +0,0 @@
import type { ReactNode } from "react";
import { View } from "react-native";
import { StyleSheet } from "react-native-unistyles";
/**
* The action at a heading's end. It adds no height, so a heading with a button is as tall as one
* without and both sit the same distance from their cards. The button stays centered on the title
* and its hit area grows past the heading.
*/
export function HeadingTrailing({ children }: { children: ReactNode }) {
if (children === null || children === undefined || children === false) return null;
return <View style={styles.trailing}>{children}</View>;
}
const styles = StyleSheet.create({
trailing: {
height: 0,
justifyContent: "center",
// A long trailing gives way to the title.
flexShrink: 1,
},
});
@@ -1,7 +1,6 @@
import { useMemo, type ReactNode } from "react";
import { Text, View, type StyleProp, type ViewStyle } from "react-native";
import { StyleSheet } from "react-native-unistyles";
import { HeadingTrailing } from "./heading-trailing";
import { SettingsInfoTip } from "./settings-info-tip";
interface SettingsGroupProps {
@@ -41,7 +40,7 @@ export function SettingsGroup({
/>
) : null}
</View>
<HeadingTrailing>{trailing}</HeadingTrailing>
{trailing}
</View>
{children}
</View>
@@ -3,7 +3,6 @@ import { useMemo, type ReactNode } from "react";
import { View, type StyleProp, type ViewStyle } from "react-native";
import { StyleSheet } from "react-native-unistyles";
import { ExternalLink, type ExternalLinkProps } from "@/components/ui/external-link";
import { HeadingTrailing } from "./heading-trailing";
import { SettingsInfoTip } from "./settings-info-tip";
import { settingsStyles } from "@/styles/settings";
@@ -68,7 +67,7 @@ export function SettingsSection({
<ExternalLink {...link} />
</View>
) : null}
<HeadingTrailing>{trailing}</HeadingTrailing>
{trailing}
</View>
<View style={styles.content}>{children}</View>
</View>
@@ -7,7 +7,6 @@ import {
SettingsCollapsibleRow,
SettingsDetailRow,
SettingsRow,
SettingsSwitch,
} from "@/components/settings";
let root: Root | null = null;
@@ -21,7 +20,6 @@ afterEach(() => {
});
function openNothing() {}
function toggleNothing() {}
function mountRows() {
container = document.createElement("div");
@@ -35,13 +33,6 @@ function mountRows() {
Download
</Button>
</SettingsRow>
<SettingsRow label="Text only" testID="text-row" />
<SettingsSwitch
label="Toggles"
value={false}
onValueChange={toggleNothing}
testID="switch-row"
/>
<SettingsDetailRow label="Opens a page" onPress={openNothing} testID="detail-row" />
<SettingsCollapsibleRow label="Group" defaultExpanded testID="group">
<SettingsRow label="Nested with a button" testID="nested-with-button">
@@ -83,13 +74,11 @@ describe("settings row density", () => {
expect(heightOf("group-toggle")).toBeGreaterThan(heightOf("nested-without-button"));
});
it("lines up text, switch, and opening rows below a row holding a button", () => {
it("keeps a row that opens something as tall as a row holding a control", () => {
mountRows();
expect(heightOf("switch-row")).toBe(heightOf("text-row"));
expect(heightOf("detail-row")).toBe(heightOf("text-row"));
expect(heightOf("group-toggle")).toBe(heightOf("text-row"));
expect(heightOf("card-row")).toBeGreaterThan(heightOf("text-row"));
expect(heightOf("detail-row")).toBe(heightOf("card-row"));
expect(heightOf("group-toggle")).toBe(heightOf("card-row"));
});
it("sizes nested text and controls one step below card rows", () => {
@@ -27,6 +27,11 @@ export function MenuSettingsRows({ children }: { children: ReactNode }) {
export interface SettingsRowLayout {
row: StyleProp<ViewStyle>;
/**
* A row as tall as one holding a control of `controlSize`, whether or not it holds one. In a menu
* it keeps the menu's row height.
*/
controlRow: StyleProp<ViewStyle>;
title: StyleProp<TextStyle>;
hint: StyleProp<TextStyle>;
/** The size of the controls in the row's trailing slot. */
@@ -38,6 +43,7 @@ function layoutFor(placement: RowPlacement): SettingsRowLayout {
case "nested":
return {
row: [settingsStyles.row, styles.nestedRow],
controlRow: [settingsStyles.row, styles.nestedRow],
title: [settingsStyles.rowTitle, styles.nestedText],
hint: [settingsStyles.rowHint, styles.nestedText],
controlSize: "sm",
@@ -45,6 +51,7 @@ function layoutFor(placement: RowPlacement): SettingsRowLayout {
case "menu":
return {
row: [settingsStyles.row, styles.menuRow],
controlRow: [settingsStyles.row, styles.menuRow],
title: settingsStyles.rowTitle,
hint: settingsStyles.rowHint,
controlSize: "md",
@@ -52,6 +59,7 @@ function layoutFor(placement: RowPlacement): SettingsRowLayout {
case "card":
return {
row: settingsStyles.row,
controlRow: [settingsStyles.row, styles.cardControlRow],
title: settingsStyles.rowTitle,
hint: settingsStyles.rowHint,
controlSize: "md",
@@ -66,6 +74,9 @@ export function useSettingsRowLayout(): SettingsRowLayout {
}
const styles = StyleSheet.create((theme) => ({
cardControlRow: {
minHeight: mapLayout(CONTROL_HEIGHTS.md, (height) => height + theme.spacing[4] * 2),
},
// Every nested row is as tall as one holding an `sm` control, so rows with and without a
// trailing button line up.
nestedRow: {
@@ -86,7 +86,7 @@ export function SettingsRowHeader({
const handlePointerEnter = useCallback(() => setPointerOver(true), []);
const handlePointerLeave = useCallback(() => setPointerOver(false), []);
const hovered = pointerOver && !disabled;
const rowStyle = useMemo(() => [layout.row, hovered && styles.hovered], [hovered, layout]);
const rowStyle = useMemo(() => [layout.controlRow, hovered && styles.hovered], [hovered, layout]);
const chevronStyle = useMemo(
() => [styles.chevron, expanded && styles.chevronExpanded],
[expanded],
@@ -1,148 +0,0 @@
import { memo, useCallback, useState } from "react";
import { useTranslation } from "react-i18next";
import { Text, View } from "react-native";
import { ChartNoAxesColumn } from "lucide-react-native";
import { StyleSheet, withUnistyles } from "react-native-unistyles";
import type { AgentMetric } from "@getpaseo/protocol/agent-types";
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
useHoverCardOpen,
} from "@/components/ui/hover-card";
import { PressHighlight } from "@/components/ui/press-highlight";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { useIsCompactFormFactor } from "@/constants/layout";
import { isNative } from "@/constants/platform";
import { ICON_SIZE, type Theme } from "@/styles/theme";
import { DetailsSheet } from "./details-sheet";
import { MetricsList } from "./metrics-list";
const ThemedChart = withUnistyles(ChartNoAxesColumn);
const foregroundColorMapping = (theme: Theme) => ({ color: theme.colors.foreground });
const foregroundMutedColorMapping = (theme: Theme) => ({ color: theme.colors.foregroundMuted });
/**
* The turn footer's stats button: what the provider reported about this turn, in a hover card on
* web, a tooltip opened by press on native wide screens, and a sheet on compact screens.
*/
export const TurnMetricsButton = memo(function TurnMetricsButton({
metrics,
}: {
metrics: AgentMetric[];
}) {
const isCompact = useIsCompactFormFactor();
if (isCompact) return <TurnMetricsSheetButton metrics={metrics} />;
if (isNative) return <TurnMetricsTooltipButton metrics={metrics} />;
return <TurnMetricsHoverCardButton metrics={metrics} />;
});
function TurnMetricsSheetButton({ metrics }: { metrics: AgentMetric[] }) {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const openSheet = useCallback(() => setOpen(true), []);
const closeSheet = useCallback(() => setOpen(false), []);
return (
<>
<PressHighlight
style={styles.trigger}
accessibilityRole="button"
accessibilityLabel={t("message.actions.turnStats")}
onPress={openSheet}
testID="turn-metrics-trigger"
>
{({ hovered }) => <TurnMetricsIcon active={open || Boolean(hovered)} />}
</PressHighlight>
<DetailsSheet open={open} onClose={closeSheet} title={t("message.actions.turnStats")}>
<MetricsList metrics={metrics} />
</DetailsSheet>
</>
);
}
function TurnMetricsTooltipButton({ metrics }: { metrics: AgentMetric[] }) {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
return (
<Tooltip open={open} onOpenChange={setOpen} delayDuration={0} enabledOnDesktop enabledOnMobile>
<TooltipTrigger asChild triggerRefProp="ref">
<PressHighlight
style={styles.trigger}
accessibilityRole="button"
accessibilityLabel={t("message.actions.turnStats")}
testID="turn-metrics-trigger"
>
{({ hovered }) => <TurnMetricsIcon active={open || Boolean(hovered)} />}
</PressHighlight>
</TooltipTrigger>
<TooltipContent side="top" align="start" offset={8} style={styles.popover}>
<TurnMetricsDetails metrics={metrics} />
</TooltipContent>
</Tooltip>
);
}
function TurnMetricsHoverCardButton({ metrics }: { metrics: AgentMetric[] }) {
const { t } = useTranslation();
return (
<HoverCard>
<HoverCardTrigger focusable accessibilityLabel={t("message.actions.turnStats")}>
<View style={styles.trigger} testID="turn-metrics-trigger">
<HoverCardTurnMetricsIcon />
</View>
</HoverCardTrigger>
<HoverCardContent
placement="top"
alignment="start"
offset={8}
role="dialog"
accessibilityLabel={t("message.actions.turnStats")}
testID="turn-metrics-details"
style={styles.popover}
>
<TurnMetricsDetails metrics={metrics} />
</HoverCardContent>
</HoverCard>
);
}
function HoverCardTurnMetricsIcon() {
return <TurnMetricsIcon active={useHoverCardOpen()} />;
}
function TurnMetricsIcon({ active }: { active: boolean }) {
return (
<ThemedChart
size={ICON_SIZE.sm}
uniProps={active ? foregroundColorMapping : foregroundMutedColorMapping}
/>
);
}
function TurnMetricsDetails({ metrics }: { metrics: AgentMetric[] }) {
const { t } = useTranslation();
return (
<>
<Text style={styles.title}>{t("message.actions.turnStats")}</Text>
<MetricsList metrics={metrics} />
</>
);
}
const styles = StyleSheet.create((theme) => ({
// Matches the Copy and Fork buttons beside it, so the glyphs share one row and one spacing.
trigger: {
alignSelf: "center",
padding: theme.spacing[1],
borderRadius: theme.borderRadius.md,
},
popover: {
minWidth: 220,
padding: theme.spacing[3],
gap: theme.spacing[2],
},
title: {
color: theme.colors.foreground,
fontSize: theme.fontSize.base,
},
}));
+10 -88
View File
@@ -72,7 +72,6 @@ import { buildDesktopFrameStyle } from "./combobox-frame-style";
export { buildDesktopFrameStyle } from "./combobox-frame-style";
const IS_WEB = isWeb;
const TRAILING_ACTION_DATASET = { comboboxTrailingAction: true };
export type ComboboxOption = ComboboxOptionModel;
export type ComboboxDesktopPlacement = "top-start" | "bottom-start";
@@ -236,11 +235,6 @@ export interface ComboboxItemProps {
kind?: "directory" | "file";
leadingSlot?: ReactNode;
trailingSlot?: ReactNode;
/**
* A button shown outside the row's own pressable. The button owns its spacing
* and hit area.
*/
trailingAction?: ReactNode;
selected?: boolean;
active?: boolean;
disabled?: boolean;
@@ -258,7 +252,6 @@ export function ComboboxItem({
kind,
leadingSlot,
trailingSlot,
trailingAction,
selected,
active,
disabled,
@@ -307,29 +300,15 @@ export function ComboboxItem({
[labelPrefix],
);
const [hovered, setHovered] = useState(false);
const handleHoverIn = useCallback(() => setHovered(true), []);
const handleHoverOut = useCallback(() => setHovered(false), []);
const splitPressableStyle = useCallback(
({ pressed }: PressableStateCallbackType) => [
styles.comboboxItemSplitPressable,
pressed && (elevated ? styles.comboboxItemPressedElevated : styles.comboboxItemPressed),
],
[elevated],
);
const splitRowStyle = useMemo(
() => [
styles.comboboxItem,
styles.comboboxItemSplitRow,
hovered && (elevated ? styles.comboboxItemHoveredElevated : styles.comboboxItemHovered),
active && styles.comboboxItemActive,
disabled && styles.comboboxItemDisabled,
],
[active, disabled, elevated, hovered],
);
const content = (
<>
return (
<Pressable
testID={testID}
disabled={disabled}
onPress={onPress}
style={itemPressableStyle}
accessibilityRole="button"
accessibilityLabel={accessibilityLabel ?? label}
>
{leadingContent}
<View style={itemContentStyle}>
{labelPrefix ? (
@@ -354,40 +333,7 @@ export function ComboboxItem({
{trailingSlot}
</View>
) : null}
</>
);
if (!trailingAction) {
return (
<Pressable
testID={testID}
disabled={disabled}
onPress={onPress}
style={itemPressableStyle}
accessibilityRole="button"
accessibilityLabel={accessibilityLabel ?? label}
>
{content}
</Pressable>
);
}
return (
<View style={splitRowStyle} onPointerEnter={handleHoverIn} onPointerLeave={handleHoverOut}>
<Pressable
testID={testID}
disabled={disabled}
onPress={onPress}
style={splitPressableStyle}
accessibilityRole="button"
accessibilityLabel={accessibilityLabel ?? label}
>
{content}
</Pressable>
<View style={styles.comboboxItemActionSlot} dataSet={TRAILING_ACTION_DATASET}>
{trailingAction}
</View>
</View>
</Pressable>
);
}
@@ -952,10 +898,6 @@ function dispatchDesktopKey(
return true;
}
if (key === "Enter") {
// Consume the shortcut but keep the browser's default button activation.
if (isWeb && document.activeElement?.matches("[data-combobox-trailing-action] button")) {
return true;
}
if (input.orderedVisibleOptions.length === 0) return false;
event?.preventDefault();
handleDesktopEnterKey(input);
@@ -1800,26 +1742,6 @@ const styles = StyleSheet.create((theme) => ({
marginBottom: theme.spacing[1],
}),
},
// Share the highlight while each control owns its padding and hit area.
comboboxItemSplitRow: {
gap: 0,
paddingHorizontal: 0,
paddingVertical: 0,
},
comboboxItemSplitPressable: {
flex: 1,
alignSelf: "stretch",
minWidth: 0,
flexDirection: "row",
alignItems: "center",
gap: theme.spacing[2],
paddingLeft: theme.spacing[3],
paddingRight: theme.spacing[1],
paddingVertical: theme.spacing[2],
},
comboboxItemActionSlot: {
alignSelf: "stretch",
},
comboboxItemHovered: {
backgroundColor: theme.colors.surface1,
},
@@ -302,23 +302,23 @@ describe("control geometry", () => {
trackHeight: 20,
thumbSize: 16,
thumbTravel: 14,
hitHeight: 32,
reservedHeight: 32,
});
expect(switchGeometryForLayout("md", true)).toEqual({
trackWidth: 44,
trackHeight: 26,
thumbSize: 22,
thumbTravel: 18,
hitHeight: 44,
reservedHeight: 44,
});
// Tight chrome keeps the pointer-sized track on every layout and takes presses over its row's control height.
// Tight chrome keeps the pointer-sized track on every layout and reserves its row's height.
expect(switchGeometryForLayout("sm", true)).toMatchObject({
trackWidth: 34,
hitHeight: 32,
reservedHeight: 32,
});
expect(switchGeometryForLayout("sm", false)).toMatchObject({
trackWidth: 34,
hitHeight: 28,
reservedHeight: 28,
});
});
@@ -223,11 +223,8 @@ export interface SwitchGeometry {
thumbSize: number;
/** How far the thumb slides between off and on. */
thumbTravel: number;
/**
* The height of the area that takes the press: the control height of the switch's size. The
* switch itself is only as tall as its track, so it never makes a row taller.
*/
hitHeight: number;
/** The control height the switch reserves, so its row lines up with one holding a button. */
reservedHeight: number;
}
function switchSize(trackWidth: number, trackHeight: number, thumbSize: number) {
@@ -238,15 +235,6 @@ function switchSize(trackWidth: number, trackHeight: number, thumbSize: number)
const SWITCH_POINTER = switchSize(34, 20, 16);
const SWITCH_TOUCH = switchSize(44, 26, 22);
/**
* The height of a default switch. Exported so a row can be as tall as one holding a switch whether
* or not it holds one. A breakpoint value, so it only works inside a Unistyles stylesheet.
*/
export const SWITCH_HEIGHT = bySizing({
touch: SWITCH_TOUCH.trackHeight,
pointer: SWITCH_POINTER.trackHeight,
});
/**
* A switch follows the same two sizes as every other control. Its thumb travel feeds an
* animation, so the size is resolved to plain numbers here instead of a stylesheet breakpoint.
@@ -254,7 +242,7 @@ export const SWITCH_HEIGHT = bySizing({
export function switchGeometryForLayout(size: ControlSize, isCompact: boolean): SwitchGeometry {
const touchSized = controlSizingForLayout(isCompact) === "touch";
const track = size === "md" && touchSized ? SWITCH_TOUCH : SWITCH_POINTER;
return { ...track, hitHeight: controlHeightForLayout(size, isCompact) };
return { ...track, reservedHeight: controlHeightForLayout(size, isCompact) };
}
function fieldLineHeight(fontSize: number): number {
@@ -1,6 +1,5 @@
import { useCallback, type ReactElement } from "react";
import {
MenuCheckboxItem,
MenuHint,
MenuItem,
MenuLabel,
@@ -24,16 +23,11 @@ import {
export { MenuRoot as DropdownMenu };
export { MenuTrigger as DropdownMenuTrigger };
export { MenuItem as DropdownMenuItem };
export { MenuCheckboxItem as DropdownMenuCheckboxItem };
export { MenuLabel as DropdownMenuLabel };
export { MenuSeparator as DropdownMenuSeparator };
export { MenuHint as DropdownMenuHint };
export type { MenuTriggerProps as DropdownMenuTriggerProps };
export type {
ActionStatus,
MenuCheckboxItemProps as DropdownMenuCheckboxItemProps,
MenuItemProps as DropdownMenuItemProps,
} from "@/components/ui/menu";
export type { ActionStatus, MenuItemProps as DropdownMenuItemProps } from "@/components/ui/menu";
export type { MenuPageDefinition } from "@/components/ui/menu";
export { MenuSubTrigger as DropdownMenuSubTrigger } from "@/components/ui/menu";
@@ -1,65 +0,0 @@
import { describe, expect, it } from "vitest";
import {
createFloatingPanelHosts,
type FloatingPanelHostRect,
type MeasurableFloatingPanelHost,
} from "./floating-panel-hosts";
function createHost(rect: FloatingPanelHostRect): MeasurableFloatingPanelHost {
return {
measureInWindow: (callback) => callback(rect.x, rect.y, rect.width, rect.height),
};
}
const WORKSPACE_RECT: FloatingPanelHostRect = { x: 10, y: 20, width: 800, height: 600 };
const RETAINED_VIEWPORT: FloatingPanelHostRect = { x: 0, y: 0, width: 1200, height: 900 };
describe("floating panel hosts", () => {
it("measures the newest host registered under the name", async () => {
const hosts = createFloatingPanelHosts();
hosts.register("workspace", createHost(WORKSPACE_RECT));
hosts.register("workspace", createHost(RETAINED_VIEWPORT));
expect(await hosts.measure("workspace")).toEqual(RETAINED_VIEWPORT);
});
it("keeps measuring a survivor after the newest host unregisters", async () => {
const hosts = createFloatingPanelHosts();
const unregisterSurvivor = hosts.register("workspace", createHost(WORKSPACE_RECT));
const unregisterNewest = hosts.register("workspace", createHost(RETAINED_VIEWPORT));
unregisterNewest();
expect(await hosts.measure("workspace")).toEqual(WORKSPACE_RECT);
unregisterSurvivor();
});
it("returns null once every host under the name is gone", async () => {
const hosts = createFloatingPanelHosts();
const unregisterFirst = hosts.register("workspace", createHost(WORKSPACE_RECT));
const unregisterSecond = hosts.register("workspace", createHost(RETAINED_VIEWPORT));
unregisterFirst();
unregisterSecond();
expect(await hosts.measure("workspace")).toBeNull();
});
it("skips hosts that are not laid out", async () => {
const hosts = createFloatingPanelHosts();
hosts.register("workspace", createHost(WORKSPACE_RECT));
hosts.register("workspace", createHost({ x: 0, y: 0, width: 0, height: 0 }));
expect(await hosts.measure("workspace")).toEqual(WORKSPACE_RECT);
});
it("ignores a repeated unregister of the same host", async () => {
const hosts = createFloatingPanelHosts();
const unregister = hosts.register("workspace", createHost(WORKSPACE_RECT));
unregister();
unregister();
expect(await hosts.measure("workspace")).toBeNull();
});
});
@@ -1,57 +0,0 @@
export interface FloatingPanelHostRect {
x: number;
y: number;
width: number;
height: number;
}
export interface MeasurableFloatingPanelHost {
measureInWindow(callback: (x: number, y: number, width: number, height: number) => void): void;
}
export interface FloatingPanelHosts<T extends MeasurableFloatingPanelHost> {
register(name: string, host: T): () => void;
measure(name: string): Promise<FloatingPanelHostRect | null>;
}
function measureHost(host: MeasurableFloatingPanelHost): Promise<FloatingPanelHostRect> {
return new Promise((resolve) => {
host.measureInWindow((x, y, width, height) => resolve({ x, y, width, height }));
});
}
/**
* Hosts are addressed by name, and one name can have several live hosts: a workspace
* screen mounts its own host while retained copies of that screen stay mounted. Track
* every host so unmounting one leaves the others measurable.
*/
export function createFloatingPanelHosts<
T extends MeasurableFloatingPanelHost,
>(): FloatingPanelHosts<T> {
const hostsByName = new Map<string, T[]>();
function register(name: string, host: T): () => void {
const hosts = hostsByName.get(name) ?? [];
hostsByName.set(name, hosts);
hosts.push(host);
return () => {
const index = hosts.indexOf(host);
if (index === -1) return;
hosts.splice(index, 1);
if (hosts.length === 0 && hostsByName.get(name) === hosts) {
hostsByName.delete(name);
}
};
}
async function measure(name: string): Promise<FloatingPanelHostRect | null> {
const hosts = hostsByName.get(name);
if (!hosts || hosts.length === 0) return null;
const rects = await Promise.all(hosts.toReversed().map(measureHost));
return rects.find((rect) => rect.width > 0 && rect.height > 0) ?? rects[0];
}
return { register, measure };
}
@@ -1,40 +0,0 @@
import React, { act } from "react";
import { createRoot } from "react-dom/client";
import { describe, expect, test } from "vitest";
import { Portal, PortalProvider } from "@gorhom/portal";
import { FloatingPanelPortalHost, measureFloatingPanelPortalHost } from "./floating-panel-portal";
describe("Floating panel host lifetime", () => {
test("removing the newest host preserves the surviving host measurement", async () => {
const container = document.createElement("div");
container.style.cssText = "position:relative;width:800px;height:600px";
document.body.appendChild(container);
const root = createRoot(container);
function Content({ overlap }: { overlap: boolean }) {
return (
<PortalProvider shouldAddRootHost={false}>
<FloatingPanelPortalHost name="workspace" />
{overlap && <FloatingPanelPortalHost name="workspace" />}
<Portal hostName="workspace" name="picker">
<div data-testid="picker">Commands</div>
</Portal>
</PortalProvider>
);
}
try {
await act(async () => root.render(<Content overlap={true} />));
expect(await measureFloatingPanelPortalHost("workspace")).toMatchObject({
width: 800,
height: 600,
});
await act(async () => root.render(<Content overlap={false} />));
expect(await measureFloatingPanelPortalHost("workspace")).toMatchObject({
width: 800,
height: 600,
});
} finally {
await act(async () => root.unmount());
container.remove();
}
});
});
@@ -8,21 +8,32 @@ import {
} from "react";
import { StyleSheet, View } from "react-native";
import { PortalHost } from "@gorhom/portal";
import {
createFloatingPanelHosts,
type FloatingPanelHostRect,
} from "@/components/ui/floating-panel-hosts";
export const DEFAULT_FLOATING_PANEL_PORTAL_HOST = "content-floating-panels";
const FloatingPanelPortalHostNameContext = createContext(DEFAULT_FLOATING_PANEL_PORTAL_HOST);
const portalHosts = createFloatingPanelHosts<View>();
interface Rect {
x: number;
y: number;
width: number;
height: number;
}
export function measureFloatingPanelPortalHost(
name: string,
): Promise<FloatingPanelHostRect | null> {
return portalHosts.measure(name);
const portalHostElements = new Map<string, View>();
function measureElement(element: View): Promise<Rect> {
return new Promise((resolve) => {
element.measureInWindow((x, y, width, height) => {
resolve({ x, y, width, height });
});
});
}
export function measureFloatingPanelPortalHost(name: string): Promise<Rect | null> {
const element = portalHostElements.get(name);
if (!element) return Promise.resolve(null);
return measureElement(element);
}
export function FloatingPanelPortalHostNameProvider({
@@ -53,7 +64,12 @@ export function FloatingPanelPortalHost({
useEffect(() => {
const host = hostRef.current;
if (!host) return undefined;
return portalHosts.register(name, host);
portalHostElements.set(name, host);
return () => {
if (portalHostElements.get(name) === host) {
portalHostElements.delete(name);
}
};
}, [name]);
return (
@@ -267,11 +267,6 @@ function WebHoverCard({
);
}
/** Whether the enclosing card is open, so its trigger can look active while it is. */
export function useHoverCardOpen(): boolean {
return useContext(HoverCardContext)?.open ?? false;
}
export function HoverCardTrigger({
children,
focusable = false,
@@ -19,7 +19,6 @@ export {
} from "./menu-surface";
export { MenuSubTrigger } from "./menu-sub";
export {
MenuCheckboxItem,
MenuHint,
MenuItem,
MenuLabel,
@@ -27,7 +26,6 @@ export {
MenuTextField,
menuRowContentInset,
type ActionStatus,
type MenuCheckboxItemProps,
type MenuItemProps,
} from "./menu-item";
export { MENU_ITEM_HEIGHT } from "./menu-geometry";
@@ -18,7 +18,6 @@ import { Check, CheckCircle } from "lucide-react-native";
import { AdaptiveTextInput } from "@/components/adaptive-modal-sheet";
import { LoadingSpinner } from "@/components/ui/loading-spinner";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { isWeb } from "@/constants/platform";
import type { Theme } from "@/styles/theme";
import { MenuDepthProvider, useMenuContext } from "./menu-context";
import { MENU_ITEM_HEIGHT } from "./menu-geometry";
@@ -222,36 +221,6 @@ function resolveItemLabel(input: {
return children;
}
function resolveTrailingContent(input: {
trailing: ReactElement | null | undefined;
showSelectedCheck: boolean;
selected: boolean | undefined;
}): ReactElement | null {
if (input.trailing !== undefined) return input.trailing;
if (!input.showSelectedCheck && input.selected) {
return <ThemedCheck size={16} uniProps={mutedMapping} />;
}
return null;
}
function useSheetSpaceKeyProps(
enabled: boolean,
onPress: () => void,
): { onKeyDown?: (event: { key?: string; preventDefault?: () => void }) => void } {
return useMemo(() => {
if (!isWeb || !enabled) return {};
return {
// React Native Web's Pressable activates Space only for role="button", not menuitem/checkbox.
onKeyDown: (event: { key?: string; preventDefault?: () => void }) => {
if (event.key === " " || event.key === "Spacebar") {
event.preventDefault?.();
onPress();
}
},
};
}, [enabled, onPress]);
}
export interface MenuItemProps {
description?: string;
onSelect?: () => void;
@@ -284,37 +253,7 @@ export interface MenuItemProps {
tooltip?: string;
}
export function MenuItem(props: PropsWithChildren<MenuItemProps>): ReactElement {
return <MenuRow {...props} accessibilityRole="menuitem" />;
}
export interface MenuCheckboxItemProps extends Omit<MenuItemProps, "selected" | "onSelect"> {
checked: boolean;
onToggle: () => void;
}
/**
* A toggleable menu row that stays open on press by default and exposes `checkbox` semantics so
* screen readers announce its checked state.
*/
export function MenuCheckboxItem({
checked,
onToggle,
closeOnSelect = false,
...rest
}: PropsWithChildren<MenuCheckboxItemProps>): ReactElement {
return (
<MenuRow
{...rest}
selected={checked}
onSelect={onToggle}
closeOnSelect={closeOnSelect}
accessibilityRole="checkbox"
/>
);
}
function MenuRow({
export function MenuItem({
children,
description,
onSelect,
@@ -333,11 +272,8 @@ function MenuRow({
closeOnSelect = true,
testID,
tooltip,
accessibilityRole,
}: PropsWithChildren<
MenuItemProps & { accessibilityRole: "menuitem" | "checkbox" }
>): ReactElement {
const { selectItem, presentation } = useMenuContext("MenuItem");
}: PropsWithChildren<MenuItemProps>): ReactElement {
const { selectItem } = useMenuContext("MenuItem");
const isPending = status === "pending" || loading;
const isSuccess = status === "success";
const isDisabled = disabled || isPending || isSuccess;
@@ -350,14 +286,14 @@ function MenuRow({
const label = resolveItemLabel({ children, isPending, isSuccess, pendingLabel, successLabel });
const trailingContent = resolveTrailingContent({ trailing, showSelectedCheck, selected });
const trailingContent =
trailing ??
(!showSelectedCheck && selected ? <ThemedCheck size={16} uniProps={mutedMapping} /> : null);
const handleItemPress = useCallback(() => {
if (isDisabled) return;
selectItem(onSelect, closeOnSelect);
}, [isDisabled, selectItem, onSelect, closeOnSelect]);
const isSheet = presentation === "sheet";
const sheetKeyProps = useSheetSpaceKeyProps(isSheet, handleItemPress);
// A row that draws a check has to say so as well: a multi-select page is a list of things that
// are on or off, and the check is the only thing telling a sighted user which. Rows that answer
@@ -400,13 +336,11 @@ function MenuRow({
const content = (
<Pressable
{...sheetKeyProps}
testID={testID}
accessibilityRole={accessibilityRole}
accessibilityRole="menuitem"
accessibilityState={accessibilityState}
aria-checked={selected}
// Popovers manage focus via arrow keys; compact sheets rely on the browser's Tab order.
tabIndex={isSheet ? 0 : -1}
tabIndex={-1}
dataSet={itemDataSet}
disabled={isDisabled}
onPress={handleItemPress}
@@ -25,8 +25,6 @@ export interface SearchFieldProps {
/** Falls back to `placeholder`, which already names the field. */
accessibilityLabel?: string;
clearAccessibilityLabel: string;
/** Fill the container, for a search that heads one list. Defaults to the filter rail's width. */
fullWidth?: boolean;
testID?: string;
clearTestID?: string;
}
@@ -44,7 +42,6 @@ export function SearchField({
placeholder,
accessibilityLabel,
clearAccessibilityLabel,
fullWidth = false,
testID,
clearTestID,
}: SearchFieldProps): ReactElement {
@@ -58,9 +55,7 @@ export function SearchField({
}, [onChangeText]);
return (
<View
style={[styles.field, fullWidth && styles.fieldFullWidth, isFocused && styles.fieldFocused]}
>
<View style={[styles.field, isFocused && styles.fieldFocused]}>
<ThemedSearch size={14} uniProps={mutedColorMapping} />
<ThemedTextInput
testID={testID}
@@ -108,9 +103,6 @@ const styles = StyleSheet.create((theme) => ({
borderWidth: theme.borderWidth[1],
borderColor: theme.colors.border,
},
fieldFullWidth: {
maxWidth: "100%",
},
fieldFocused: {
borderColor: theme.colors.borderAccent,
backgroundColor: theme.colors.surface2,
+2 -7
View File
@@ -123,16 +123,11 @@ export function Switch({
const pressableStyle = useMemo(
() => [
styles.switchControl,
// The press area is a full control tall and grows out of the track; the layout only sees
// the track.
{
minHeight: geometry.hitHeight,
marginVertical: (geometry.trackHeight - geometry.hitHeight) / 2,
},
{ minHeight: geometry.reservedHeight },
disabled ? styles.disabled : null,
style,
],
[disabled, geometry.hitHeight, geometry.trackHeight, style],
[disabled, geometry.reservedHeight, style],
);
return (
@@ -12,7 +12,6 @@ import { Composer } from "@/composer";
import { ProjectIconView } from "@/components/project-icon-view";
import { ICON_SIZE } from "@/styles/theme";
import { useToast } from "@/contexts/toast-context";
import { draftCreationKey } from "@/composer/draft/creation-key";
import { useAgentInputDraft } from "@/composer/draft/input-draft";
import { useProjectIcon } from "@/projects/icons";
import { useHostRuntimeClient, useHostRuntimeIsConnected } from "@/runtime/host-runtime";
@@ -97,16 +96,13 @@ async function callWorkspaceCreation({
worktreeSlug: string;
input: { cwd: string; agent?: CreateWorkspaceRequestOptions["agent"] };
}) {
const request: Omit<CreateWorkspaceRequestOptions, "idempotencyKey"> = {
return connectedClient.createWorkspace({
idempotencyKey: creationId,
agent: input.agent,
source:
creationMethod === "create_worktree"
? { kind: "worktree", cwd: input.cwd, worktreeSlug }
: { kind: "directory", path: input.cwd },
};
return connectedClient.createWorkspace({
...request,
idempotencyKey: draftCreationKey(creationId, request),
});
}
@@ -367,9 +363,7 @@ export function WorkspaceSetupDialog() {
} catch (error) {
const message = toErrorMessage(error);
setErrorMessage(message);
if (!getIsStillActive()) {
toast.error(message);
}
toast.error(message);
} finally {
if (getIsStillActive()) {
setPendingAction(null);
@@ -461,10 +455,11 @@ export function WorkspaceSetupDialog() {
commandDraft={composerState?.commandDraft}
agentControls={agentControlsWithDisabled}
inputWrapperStyle={styles.composerInputWrapper}
error={errorMessage}
/>
</KeyboardTranslateView>
</FileDropZone>
{errorMessage ? <Text style={styles.errorText}>{errorMessage}</Text> : null}
</AdaptiveModalSheet>
);
}
@@ -487,6 +482,11 @@ const styles = StyleSheet.create((theme) => ({
marginHorizontal: -theme.spacing[6],
marginVertical: -theme.spacing[2],
},
errorText: {
fontSize: theme.fontSize.base,
color: theme.colors.destructive,
lineHeight: 20,
},
composerSlot: {
paddingBottom: theme.spacing[4],
},
@@ -8,21 +8,6 @@ const request = {
clientMessageId: "draft-1:initial-message",
};
const workspaceRequest = {
source: {
kind: "worktree" as const,
cwd: "/repo",
projectId: "prj_1",
worktreeSlug: "clever-fox",
},
firstAgentContext: { prompt: "Start the original task.", attachments: [] },
agent: {
config: { provider: "codex", cwd: "/repo", model: "gpt-6" },
initialPrompt: "Start the original task.",
clientMessageId: "draft-1:initial-message",
},
};
describe("draftCreationKey", () => {
it("keeps the key for a retry of the same request, whatever its key order", () => {
const reordered = {
@@ -42,52 +27,4 @@ describe("draftCreationKey", () => {
expect(key).not.toBe(draftCreationKey("draft-1", request));
expect(key.startsWith("draft-1:")).toBe(true);
});
it.each([
{
name: "isolation",
edited: {
...workspaceRequest,
source: { kind: "directory" as const, path: "/repo", projectId: "prj_1" },
},
},
{
name: "project",
edited: {
...workspaceRequest,
source: { ...workspaceRequest.source, projectId: "prj_2", cwd: "/other" },
},
},
{
name: "prompt",
edited: {
...workspaceRequest,
firstAgentContext: { prompt: "hi", attachments: [] },
agent: { ...workspaceRequest.agent, initialPrompt: "hi" },
},
},
])(
"gives a New workspace request with edited $name a new key on the same draft",
({ edited }) => {
const key = draftCreationKey("draft-1", edited);
expect(key).not.toBe(draftCreationKey("draft-1", workspaceRequest));
expect(key.startsWith("draft-1:")).toBe(true);
},
);
it("gives a New workspace request with a changed launch target a new key even when the wire request matches", () => {
const emptyRequest = {
source: { kind: "directory" as const, path: "/repo", projectId: "prj_1" },
};
const chatKey = draftCreationKey("draft-1", {
request: emptyRequest,
launchTarget: { kind: "chat" },
});
const terminalKey = draftCreationKey("draft-1", {
request: emptyRequest,
launchTarget: { kind: "terminal", profileId: "shell" },
});
expect(terminalKey).not.toBe(chatKey);
expect(terminalKey.startsWith("draft-1:")).toBe(true);
});
});

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