The floating pet still does not appear, and the two explanations offered
so far are not sufficient. The rebuild path genuinely never called
show(), which is fixed and correct on its own reading of the code, but it
did not resolve the symptom. A missing Suspense boundary around the lazy
pet view looked like a second cause and is not one: removing the wrapper
still renders the pet, so React 19 tolerates it. That claim is retracted
in the comment rather than left standing.
The window is transparent and undecorated, so "did not appear" covers a
window placed off-screen, a window that reports hidden, and a window
present with nothing painted in it. Log the monitor work area, the
position and size after placement, and the visibility the window
reports, at default level so no filter is needed to read it.
The Suspense wrapper stays. Relying on React tolerating a lazy component
with no boundary is not a contract, and the bubble and quick views
already have their own.
Refs: N-11, F-61.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The chat panel opened with three stacked blocks above the messages: a
title and subtitle naming the panel, a strip repeating the profile id,
session id and connection state, and the session pills. Only the last
carried anything the reader needed.
Move the slot tabs into the window title bar and delete the rest. The
tabs go there through a portal rather than by lifting state into the
shell, which keeps the slot selection and its status polling in the
panel that owns them; the quick chat and bubble windows have no title
bar, and they are slot-fixed already, so the tabs simply do not render
there.
The connection actions move onto the session row, which costs no height
because that row already exists. 刷新 is dropped: the status refreshes on
a 500ms poll, so the button did nothing the panel was not already doing.
重连, 断开 and 新对话 stay, since losing them would leave no way to
recover a dropped connection or start a conversation.
The panel now puts 82px above the messages instead of three blocks. The
title-bar rules carry [role="tab"] on purpose — the panel's own
.chat-slot[role=tab] rule sets a 2.75rem minimum and sits later in the
sheet, so an unqualified selector loses to it and the tabs overflow a
44px bar.
Verified against the real stylesheet: tabs 33px inside a 44px bar,
vertically centred, clear of both the title text and the window
controls; the removed blocks are absent from the DOM.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The minimize, maximize and close buttons did nothing. They were wired
correctly; the ACL rejected them. core:default resolves to
core🪟default, which grants only read-only queries — is-maximized
is in it, which is why the maximize icon tracked state correctly, but
minimize, toggle-maximize, close and start-dragging are not. Both
windows are decorations: false, so with close denied the main window
could not be closed at all except through the tray.
Add two capabilities rather than widening the shared one: the main
window gets the four controls it draws, and the pet window gets dragging
alone, since it is moved by dragging its body and must not be able to
close or resize itself.
Every one of these calls was a bare void expression, so the rejection
was swallowed and looked identical to an unwired button. Route them
through a helper that reports the failure in the shell error banner.
This is the second time a missing capability has surfaced as a silent
no-op — the pet window previously had no entry at all. Add tests that
read the shipped capability files and assert each permission the UI
calls is granted to the window that calls it.
Also translate the TypeError the Tauri shim throws outside the
application into a sentence a user can act on. The dev server is
reachable at 127.0.0.1:1420, so opening it in a browser and hitting save
produced "Cannot read properties of undefined (reading 'invoke')".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
All four listen() call sites assigned the resolved unregister function
unconditionally. When the effect was cleaned up before the promise
settled, that assignment landed on a dead closure and the listener was
never unregistered. React StrictMode mounts, cleans up and mounts again,
so the first listener leaked on every development mount. In ChatPanel
that meant applyRuntimeEvents ran twice per event and, because a delta
is appended to the existing content, every character of a streamed reply
was doubled.
Track whether the effect is still live and unregister immediately when
the promise settles late. Each site also gains a catch, since these were
all bare void listen(...).then(...) chains — a rejected listen, such as
the missing desktop-pet capability, became an unhandled rejection rather
than anything observable.
The listener mock in src/test/setup.ts resolved eagerly, which made the
race impossible to express. Replace it with a controllable double in
src/test/tauriEvent.ts that defers resolution until the test asks for
it, tracks each registration separately, and only dispatches to handlers
that have not been unregistered. The registry is plain module state, so
setup.ts resets it after each test.
ChatPanel had no test file; this adds one. Both new tests were checked
against a mutation restoring the old assignment, and both fail under it.
Refs: F-15 (audit P1-10).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Historical UTF-8 corruption left question-mark runs in user-visible copy and in
one accessible name: the sprite load failure message, the canvas context
failure message, the pet window's `aria-label`, and the page loading state.
A separate spot had the "desktop floating" option label hard-coded as numeric
HTML entities.
Refs P1-17 / F-09.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tauri rejects `invoke` with the deserialized Rust error value, which for
`RuntimeCommandError { code, message }` is a plain object rather than an
`Error`. Nine call sites used `reason instanceof Error ? reason.message :
String(reason)`, so every send, reconnect, stop, and settings failure showed
the user `[object Object]`.
`ProfileManager` already had a correct implementation; this lifts it into
`src/lib/errorMessage.ts` and routes the other call sites through it. The
module also exports `isCancelledError`, which a later batch needs to tell a
deliberate stop apart from a real failure.
Refs P1-16 / F-08.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>