Skip to content

Open a pane's terminal first, chat on request - #25

Merged
devswha merged 1 commit into
mainfrom
feat/terminal-first
Sep 24, 2026
Merged

devswha merged 1 commit into
mainfrom
feat/terminal-first

Conversation

@devswha

@devswha devswha commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Summary

Before this PR, a pane selected for the first time opened in Chat if an agent ran in it. A shell pane also flipped to Chat as soon as an agent started in it, because the view effect re-ran on selectedAgent. Now a pane seen for the first time opens its Terminal, whatever runs in it.

  • The lens the user picks is still remembered per pane (herdr-web-ui:view:<pane>). Choose Chat once and that pane keeps opening in chat.
  • storedView drops its hasAgent parameter, and the effect no longer depends on selectedAgent, so an agent starting doesn't switch the view.
  • scripts/chat-browser-qa.ts set no view and relied on the old default. It now asks for the chat lens itself, as ui-regression.ts already does.

Testing

  • bun run typecheck passes, bun test passes 296/296, bun run test:ui passes 7/7, and scripts/chat-browser-qa.ts passes 5/5.
  • Browser check (scratch script, owned herdr pane reported as a Claude agent):
    • The pane opened with Live terminal pressed and no conversation log.
    • After choosing Chat and reloading, the pane opened in chat.

🤖 Generated with Claude Code

Agent panes opened in the chat view the first time they were selected,
and a shell pane flipped to chat once an agent started in it. A pane seen
for the first time now opens its terminal whatever runs in it; the lens
the user picks is still remembered per pane.

The chat QA script set no view and relied on the old default, so it now
asks for the chat lens itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@devswha
devswha merged commit adb5e74 into main Sep 24, 2026
@devswha
devswha deleted the feat/terminal-first branch September 26, 2026 14:48
devswha added a commit that referenced this pull request Nov 21, 2026
…eaves the relay tab its sign-in buttons alone

Owner #25 (packaged Mac app, preview.19): after a sign-out and sign-in the relay tab showed 'Add from account', 'Sign in to this PC's account.' and the revoke-every-device paragraph: the window was signed in to another account than the one the PC is in (the account service makes a new account for a way in the PC's account does not have, src/accounts.ts accountFor), so #11's close never fired. Such a sign-in is no sign-in to this PC: the tab stays the sign-in buttons (keyed by the account, so they come back) and the phone's QR / pairing code, with no prompt, no line and no paragraph; a sign-in to the PC's account then closes onto the main screen as before. The QR part's notice after a scan still names another account.
devswha added a commit that referenced this pull request Nov 23, 2026
…#4510)

## What changed

A sign-in on **Settings → Devices and PCs → Add a connection → Ovis
relay** to the account this PC is
already in (with its relay on) no longer closes Settings. The Add a
connection sheet still closes,
since nothing is left to add there, and Settings stays on Devices and
PCs. That page now shows the
account and its PCs. Only a sheet that the setup checklist's **Connect
your phone** opened still goes
on to the main screen after that sign-in, because that flow started from
the main screen.

The decision is `closedBySignIn(home, asked)` in
`ConnectPhoneDialog.tsx`. `DevicesPage` passes it
`connectAsked` (set only by the setup checklist's `askAddConnection`,
cleared by the page's own
Add a connection button).

## Why

The owner tested the Mac app preview (0.5.10-preview.22). He opened
Settings, pressed Continue with
Google, finished in the system browser, and came back to a closed
Settings, so he had to open it again
to see the account and its PCs.

Cause: `DevicesPage` closed Settings on purpose (`onHome` → `onClose`)
for any relay-tab sign-in that
`RelayTab` reports as `home` (an account this PC is already in, relay
on). #4435 added that for owner
#25 ("sign in again → straight to the main screen without the connect
dialog"). Nothing reloads or
navigates the page. The desktop app's loopback sign-in (`desktop.ts`), a
PC's own window
(`ownWindow.ts`) and the link page's code (`deviceSignIn.ts`) all end in
the same `onSignedIn(home)`.
The fix keeps #25's "no connect dialog" and drops only the Settings
close.

## Each way in and out of the account in Settings

| Path | Before | After |
|---|---|---|
| Relay tab: Google, Apple or GitHub, account this PC is in, relay on |
Settings closed | **fixed**: sheet closes, Settings stays on Devices and
PCs |
| Same, sheet opened by the setup checklist's Connect your phone |
Settings closed | unchanged: goes to the main screen |
| Relay tab: sign-in to another account, PC in no account, or relay off
| stayed (tab shows Add this PC or the buttons) | unchanged |
| Relay tab: sign-in failed, refused or cancelled | stayed (the error
shows on the tab) | unchanged |
| Account card's own provider buttons (relay not offered) | stayed |
unchanged |
| Sign in again (Manage account), add a way to sign in | stayed |
unchanged |
| Sign out (and its unsent-block question) | stayed | unchanged |

E-mail sign-in is not offered (`ACCOUNT_PROVIDERS` is GitHub, Google and
Apple). The phone app and
the hosted page do not reach this code: there `accountServiceHere()` is
null, so the sheet gets no
`account` and draws no relay-tab sign-in. Their behaviour is unchanged.
No change to the sign-in
itself, to what the account service is asked, or to any HTTP/WS
contract.

## Validation

- Red first: `closedBySignIn` in
`src/components/ConnectPhoneDialog.test.tsx` failed as not a
function. The `DevicesPage` wiring check in
`src/components/AccountPcRows.test.tsx` failed on the
old `if (home) { setConnecting(false); onHome(); }`. Both pass now,
along with
`src/components/RelaySignIn.test.tsx` (the owner #25 `home` signal
itself is unchanged).
- `bun run check fast`: green.
- Browser regressions in the CI runner image (`herdr-ci-runner:local`,
fresh clone of this branch),
all exit 0: `settings-pages-demo-regression`,
`settings-palette-search-demo-regression`,
  `settings-rows-demo-regression`, `settings-segmented-demo-regression`,
`cliproxy-settings-regression`, `setup-row-demo-regression`,
`connect-dialog-scroll-regression`,
`relay-first-link-regression`, `settings-tabs-regression`,
`settings-unload-regression`, and
`ui-contexts-regression`. That last one runs
`push-settings-regression`'s checks, which do nothing
  when that file runs alone.
- Second commit: CI's first run failed `relay-account-pcs-regression`,
which encoded the old
behaviour by waiting for Settings to detach after a link-page sign-in to
this PC's account. It now
waits for Add a connection to close and for Settings to stay on Devices
and PCs, signed in with
GitHub and listing the account's PC "Away", which a signed-out Settings
does not list. It passes in
the CI runner image (exit 0, through `dori heavy`). `bun run check fast`
is green again.
`RelaySignIn.test.tsx` titles now call `home` "nothing is left to add".
No other browser script
waits for Settings to close after a sign-in: every other
`.settings-dialog` detach follows
  Escape, Close, a tap outside or "Open terminal".
- Skipped: a real sign-in in the packaged Mac app (needs a notarized
preview build on eamac).

## Known limits

- No browser script drives the setup checklist's sign-in that still goes
to the main screen: that
  case has only the `closedBySignIn` unit test.
- The only `connectAsked` left stale is a setup-checklist sheet that is
closed and then reopened by
the account QR watch. A `home` sign-in there still goes to the main
screen, as the setup flow does.

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

---------

Co-authored-by: Claude Opus <[email protected]>
devswha added a commit that referenced this pull request Nov 27, 2026
…ount (#4882)

## What

Signed in to another Ovis account than the one this PC is in, the relay
tab showed the same sign-in buttons again with no word on why, so a
finished sign-in looked like it did nothing (seen on a Mac added under
GitHub and signed in with Google: each way of signing in is its own
account until linked). The tab now keeps the owner #25 layout (sign-in
buttons and the phone's QR code, no prompt) and adds one line above the
buttons:

- the PC knows how its owner signed in: "This PC is in another account.
Sign in with GitHub."
- it does not (a PC added by an older Ovis, `ovis add`): "This PC is in
another account. Sign in the way you used when you first added this PC."

## HTTP contract (additive only)

- `POST /api/account/relay-account` takes an optional `provider`
(`github` | `google` | `apple`). The PC keeps it in `relay/account.json`
beside the account. Any other value counts as none; a naming without one
(older apps, `ovis add`, server-side one-press) keeps the provider said
before for the same account, and naming another account drops it.
- `GET /api/account/status` adds `account_provider` while the PC is in
the account that naming was for. Older apps ignore it; a new app talking
to an older PC gets no field and shows the generic line.
- The page's "Add this PC" and one-press paths send the stored sign-in's
provider. No account service (ovis-sh/account) change.

docs/account.md documents both fields.

## Design reference

No other app's screen is followed here: the maintainer's approved mockup
keeps the tab as it is and adds one inline line in the tab's existing
`settings-hint` style, the smallest change that says why. The provider
buttons stay as they are (no highlight).

## Screenshots (light, Korean UI)

| | Desktop 1280 | Phone 390 |
|---|---|---|
| Before | ![before
desktop](https://raw.githubusercontent.com/devswha/ovis/6ed66ab9f453766ec139a3ce430af87620baeffe/before-desktop.png)
| ![before
phone](https://raw.githubusercontent.com/devswha/ovis/6ed66ab9f453766ec139a3ce430af87620baeffe/before-phone.png)
|
| After (PC knows the way) | ![after
desktop](https://raw.githubusercontent.com/devswha/ovis/6ed66ab9f453766ec139a3ce430af87620baeffe/after-desktop.png)
| ![after
phone](https://raw.githubusercontent.com/devswha/ovis/6ed66ab9f453766ec139a3ce430af87620baeffe/after-phone.png)
|
| After (PC does not know) | ![after unknown
desktop](https://raw.githubusercontent.com/devswha/ovis/6ed66ab9f453766ec139a3ce430af87620baeffe/after-unknown-desktop.png)
| ![after unknown
phone](https://raw.githubusercontent.com/devswha/ovis/6ed66ab9f453766ec139a3ce430af87620baeffe/after-unknown-phone.png)
|

Rendered from a fixture of `RelayTab` against main and this branch with
a stubbed PC and account service (no live session).

## Tests

- `ConnectPhoneDialog.test.tsx`: the owner #25 case now shows the
generic line; a new case shows "Sign in with GitHub." for
`account_provider: "github"` and the generic line for an unknown value;
the PC's own account shows no line.
- `account.contract.test.ts`: `relay-account` with a provider shows in
status; a naming without one, or with an unknown value, keeps it;
another provider replaces it.
- `bun run check fast`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant