airi/docs
蓝莓🫐 0dd243f55a
Some checks are pending
CI / Type Check (web) (push) Blocked by required conditions
CI / Build Test (stage-tamagotchi) (push) Blocked by required conditions
CI / Detect changes (push) Waiting to run
CI / Lint (push) Blocked by required conditions
CI / Build Test (stage-web) (push) Blocked by required conditions
CI / Build Test (ui-playgrounds) (push) Blocked by required conditions
CI / Build Test (stage-tamagotchi-godot) (push) Blocked by required conditions
CI / Unit Test (others) (push) Blocked by required conditions
CI / Unit Test (api-server-1) (push) Blocked by required conditions
CI / Unit Test (api-server-2) (push) Blocked by required conditions
CI / Unit Test (stage-tamagotchi) (push) Blocked by required conditions
CI / Unit Test (stage-ui-1) (push) Blocked by required conditions
CI / Unit Test (stage-ui-2) (push) Blocked by required conditions
CI / Unit Test (push) Blocked by required conditions
CI / Type Check (others) (push) Blocked by required conditions
CI / Type Check (desktop) (push) Blocked by required conditions
CI / Type Check (push) Blocked by required conditions
CI / Check Provenance (push) Blocked by required conditions
Crowdin upload changed translations / upload-translations-to-crowdin (push) Waiting to run
Cloudflare Pages (Auth UI) / Deploy - ui-server-auth (push) Waiting to run
Cloudflare Workers / Build - docs (push) Waiting to run
Cloudflare Workers / Deploy - stage-web (push) Blocked by required conditions
Release Tamagotchi / Build-4 (push) Blocked by required conditions
Release Tamagotchi / Publish Bundle (push) Blocked by required conditions
Release Tamagotchi / Promote Canary to Stable (push) Blocked by required conditions
Release Tamagotchi / Plan Updates (push) Waiting to run
Release Tamagotchi / Build (push) Blocked by required conditions
Release Tamagotchi / Build-1 (push) Blocked by required conditions
Release Tamagotchi / Build-2 (push) Blocked by required conditions
Release Tamagotchi / Build-3 (push) Blocked by required conditions
Release Tamagotchi / Publish GitCode Release Mirror (push) Blocked by required conditions
Release Tamagotchi / Publish Distribution (push) Blocked by required conditions
Release Tamagotchi / Publish Distribution-1 (push) Blocked by required conditions
Release Tamagotchi / Publish Distribution-2 (push) Blocked by required conditions
Release Tamagotchi / Publish Distribution-3 (push) Blocked by required conditions
E2E Test - Tamagotchi (Linux) / X11 window render (Xvfb) (push) Waiting to run
E2E Test - Tamagotchi (Linux) / Wayland window render (weston headless) (push) Waiting to run
feat(stage-tamagotchi,stage-ui,ui,i18n): add swipe back and right-click menus to the chat views (#3631)
## Summary

The chat views of the desktop app take common desktop gestures: a swipe
back in the floating chat, a swipe that pins a chat row, and right-click
menus on the chat rows and on the character rail.

- **Swipe back.** In the floating chat, a swipe to the right with two
fingers on the trackpad goes back from the conversation to the list. It
starts only on a blank part of the conversation. The two levels follow
the fingers through the same states as the click, and finish from there.
Past half the width, or with a quick swipe, the list opens. Else the
conversation goes back. The message feed is transparent, so it has no
swipe.
- **Row menu on a right click.** A right click on a chat row opens its
menu at the pointer. The compact pointer rows of the desktop app show no
menu button. Stage Web keeps the button. The trigger of the menu shows
on keyboard focus, and the menu key opens the menu at the end of the
row.
- **Pin on a swipe to the right.** A swipe to the left archives a
compact pointer row. A swipe to the right shows Pin, and a full swipe
pins the row. An archived row shows no Pin, as in its menu. The menu
keeps its Pin item.
- **Character menu on a right click.** In the classic chat window and
beside the floating chat, a right click on an avatar opens a menu with
Edit character, beside the avatar. Edit opens the page of that
character.
- **The target of a menu stays marked.** While a menu shows, its row
keeps the hover fill, and its avatar keeps the hover ring or fill.
- **Time of a row.** A row without end marks centers its time on both
lines, so the time lines up with the buttons that a hover shows. A
pinned row keeps the time on its title line, above the pin.

The PR stands on `main`. It is not stacked.

## Context

- Request: Make the chat views of the desktop app work like a desktop
messenger: a swipe back in the floating chat, a swipe to the right that
pins a row, right-click menus on rows and avatars, and no extra menu
button on desktop rows.
- Scenario: The floating chat and the classic chat window of the desktop
app, on macOS with a trackpad.
- Scope: Stage Web keeps the menu button of its rows. The message feed
has no swipe back. The rail over the stage has no character menu.

## Change map

| Module | Before | After | Description |
| --- | --- | --- | --- |
| `DropdownMenu` (`packages/ui`) | Opened at its trigger only. | Takes
`reference`, a point or an element to open at. Mounts its content again
when a reference comes. | reka forwards a prop to its inner menu parts
only when the prop had a value at their first render
(`useForwardProps`). The key works around it, with a `NOTICE`. |
| `SessionRow` | The menu opened from its button or a long press. A
compact pointer row took a swipe to the left only. | A swipe to the
right shows Pin, on a second swipe list at the start side. A right click
opens the menu at the pointer. Compact pointer rows of the desktop app
hide the button and keep the trigger for the keyboard. The row keeps its
hover fill while its menu shows. | `isStageWeb()` keeps the button on
Stage Web, as the message action menu already checks the platform. |
| `SessionRowSummary` | The time stood at the end of the title line in
every row. | Without end marks, the time stands at the end of the row,
centered on both lines. | A row with a pin, the archive mark of a search
match, or the current mark keeps the old layout. |
| `CharacterRail` | Emitted `select` and `manage`. | Takes `editable`
and emits `edit`. A right click on an avatar opens one shared menu
beside it. The avatar keeps its hover look while the menu shows. | The
trigger of the menu is hidden, because a menu trigger opens on a left
click, and the left click picks the character. |
| `useSwipeBack` (new, stage-tamagotchi) | None | Tracks a swipe to the
right with two fingers through `useSwipeGesture` and gives a progress
from 0 to 1. | A point is blank when no element between it and the level
paints a background. The click-through of the floating chat uses the
same rule (`paintsBackground`). |
| Floating chat page | A click on the chat island opened the list. | A
swipe back opens it too. The avatars of the rail take a right click. |
The levels take the progress as inline styles and turn off their
transitions while the fingers drive them. |
| Classic chat page | The docked rail activated characters. | The docked
rail also takes a right click. | Edit opens the settings page of the
character. |

## Architecture and behavior

```mermaid
stateDiagram-v2
  [*] --> Idle
  Idle --> Pending: wheel gesture starts on a blank point
  Idle --> Ignored: wheel gesture starts on content
  Pending --> Tracking: 16px with a clear axis to the right
  Pending --> Ignored: vertical, or to the left
  Tracking --> List: release past half the width, or momentum to the right
  Tracking --> Idle: release before half the width
  Ignored --> Idle: gesture ends
  List --> [*]
```

- The axis rules copy `Swipeable`: 16px of movement before a decision,
and a ratio of 1.5 to 1.
- While the fingers drive the levels, the conversation moves by the
progress, and the list moves in from `-25%` and fades in by the same
progress. These are the states of the click transition. On release, the
inline styles go away, and the CSS transitions run from the current
place.
- The gesture is off in the message feed and while the list is open.

## Boundaries and risks

| Invariant or boundary | Failure mode | Protection | Evidence or gap |
| --- | --- | --- | --- |
| A swipe over content keeps its meaning | A swipe over a bubble or a
code block goes back. | The gesture starts only where no element between
the point and the conversation paints a background. | Read from the
code: the history layer and the viewport paint nothing. Bubbles, the
composer, the islands, code, and scrollbars paint a background. Not
covered by a test. |
| A menu opens at its reference | The menu stays at its trigger. |
`DropdownMenu` mounts its content again when a reference comes. | Probe
in the stage-web dev server, with a docked rail mounted in the page:
before the fix, a right click on the second avatar opened the menu
beside the hidden trigger. After it, the menu opened 6px right of each
avatar, centered on it. |
| Keyboard access without the menu button | Keyboard users lose the row
menu. | The trigger stays in the tab order and shows on keyboard focus.
The menu key opens the menu at the end of the row. | Read from the code.
Not tried with a screen reader. |
| Stage Web keeps its menu button | The rows of Stage Web lose the
button. | `isStageWeb()` is true for the browser build. | Read from the
code (`RUNTIME_ENVIRONMENT`). |
| A narrow list keeps its preview | The centered time takes width from
the preview line too. | A row without end marks gives the time its own
column. | Seen in a capture of the chat drawer of the stage-web phone
layout: the preview ends a few words earlier. |

## Verification

- `pnpm exec eslint` on the changed files: no errors. Two warnings for
comments over 50 words predate this PR.
- No local typecheck or tests. CI runs the typecheck, the lint, and the
tests on the head of this PR, browser projects included.
- The swipe back, the row menu, the character menu, and the marked
targets were tried by hand in the desktop dev app on macOS with a
trackpad.
- The swipe to pin ran in the stage-web dev server at 1280×800. Wheel
events to the right on a row of the chat popover showed Pin. A full
swipe pinned the row and moved it to the top.
- The probe for `reference` ran in the stage-web dev server. It mounted
the real `CharacterRail` with the app context, sent a `contextmenu`
event to each avatar, and read the rects of the avatar and of the menu.

## Visual changes

The floating chat of the desktop app on `main` (755d0358a) and on this
branch (7d92833bc): macOS, light theme, English, 15 sample characters,
and sample chats with Iru on the stage. Each run started from an empty
profile. The classic chat window uses the same row and rail components.

| Before | After |
|---|---|
|
![](https://github.com/user-attachments/assets/35f5f950-76b5-4b59-bc44-9f02ec765cfb)
|
![](https://github.com/user-attachments/assets/8d782e1c-7438-492e-bfca-05bc1015c1fe)
|
| Floating chat / list | Floating chat / list |
| Absent |
![](https://github.com/user-attachments/assets/6c733e7b-5623-4acf-bf07-c53b6631a148)
|
| Floating chat / right click on a row | Floating chat / right click on
a row |
| Absent |
![](https://github.com/user-attachments/assets/f0497cb2-812f-4d36-87d2-c25aa16ad9ad)
|
| Floating chat / right click on an avatar | Floating chat / right click
on an avatar |

## Agent

- Harness: Claude Code
- Model: claude-opus-5-5

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-11-28 09:33:20 +00:00
..
ai feat(stage-tamagotchi,stage-ui,ui,i18n): add swipe back and right-click menus to the chat views (#3631) 2026-11-28 09:33:20 +00:00
assets chore(docs): move the documentation site to moeru-ai/airi-docs (#2924) 2026-10-12 14:30:33 +08:00
desktop-lane-status.md test(computer-use-mcp): add desktop v3 smoke coverage (#1780) 2026-05-13 12:08:38 +08:00
README.fr.md chore: update README release artifacts to v0.15.4 (#3519) 2026-11-14 11:08:27 +00:00
README.ja-JP.md chore: update README release artifacts to v0.15.4 (#3519) 2026-11-14 11:08:27 +00:00
README.ko-KR.md chore: update README release artifacts to v0.15.4 (#3519) 2026-11-14 11:08:27 +00:00
README.md docs: updated 2025-06-16 01:52:54 +08:00
README.ru-RU.md chore: update README release artifacts to v0.15.4 (#3519) 2026-11-14 11:08:27 +00:00
README.vi.md chore: update README release artifacts to v0.15.4 (#3519) 2026-11-14 11:08:27 +00:00
README.zh-CN.md feat(photon-bot,stage-ui): add Photon iMessage integration and settings page (#3558) 2026-11-23 01:22:47 +00:00
wechat.md chore(docs): move the documentation site to moeru-ai/airi-docs (#2924) 2026-10-12 14:30:33 +08:00

Please refer to README.md for the main documentation.