agent ui: add a clickable new-session menu entry
Same gap #4611 fixed for logout: the Preact rewrite's StatusChips menu never picked up new-session as a click path, only /new-session typed twice into the terminal. postNewSession already existed in termActions.ts. Wire it into the status menu with the same arm-then- confirm click pattern logout/cancel-turn already use. Closes #4612
This commit is contained in:
parent
3b8df27dcf
commit
9a444c27fa
2 changed files with 43 additions and 2 deletions
|
|
@ -27,7 +27,11 @@ import { fmtAge, fmtTokens } from "./lib/format.js";
|
|||
import { resolveDashboardBase } from "./lib/dashboardBase.js";
|
||||
import { submitPauseResume } from "./lib/pauseAction.js";
|
||||
import { postModel, postEffort } from "./lib/modelEffort.js";
|
||||
import { postCancelTurn, postLogout } from "./lib/termActions.js";
|
||||
import {
|
||||
postCancelTurn,
|
||||
postLogout,
|
||||
postNewSession,
|
||||
} from "./lib/termActions.js";
|
||||
import type { TokenUsage } from "./types.js";
|
||||
|
||||
type OpenPanel = "inbox" | "todos" | null;
|
||||
|
|
@ -225,6 +229,7 @@ export function Root() {
|
|||
onTogglePause={() => {}}
|
||||
thinking={false}
|
||||
onCancelTurn={() => Promise.resolve()}
|
||||
onNewSession={() => Promise.resolve()}
|
||||
onLogout={() => Promise.resolve()}
|
||||
/>
|
||||
</Header>
|
||||
|
|
@ -332,6 +337,15 @@ export function Root() {
|
|||
refresh();
|
||||
})
|
||||
}
|
||||
onNewSession={() =>
|
||||
postNewSession().then((r) => {
|
||||
if (!r.ok)
|
||||
liveStreamRef.current?.pushNote(
|
||||
`✗ /new-session failed${r.detail ? ": " + r.detail : ""}`,
|
||||
);
|
||||
refresh();
|
||||
})
|
||||
}
|
||||
onLogout={() =>
|
||||
postLogout().then((r) => {
|
||||
if (!r.ok)
|
||||
|
|
|
|||
Loading…
Reference in a new issue