fmt(js): npm run fix on merge (#66460)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
cf52edbb59
commit
29dac61d77
4 changed files with 35 additions and 10 deletions
|
|
@ -93,6 +93,7 @@ export function ModelPill({
|
|||
const baseTitle = currentProvider
|
||||
? copy.modelTitle(currentProvider, currentModel || copy.modelNone)
|
||||
: copy.switchModel
|
||||
|
||||
const title = pinnedOverride ? `${baseTitle} — ${copy.modelPinned}` : baseTitle
|
||||
|
||||
if (!model.modelMenuContent) {
|
||||
|
|
|
|||
|
|
@ -248,7 +248,11 @@ export function useSessionStateCache({
|
|||
)
|
||||
|
||||
const updateSessionState = useCallback(
|
||||
(sessionId: string, updater: (state: ClientSessionState) => ClientSessionState, storedSessionId?: string | null) => {
|
||||
(
|
||||
sessionId: string,
|
||||
updater: (state: ClientSessionState) => ClientSessionState,
|
||||
storedSessionId?: string | null
|
||||
) => {
|
||||
const previous = ensureSessionState(sessionId, storedSessionId)
|
||||
const next = updater({ ...previous, messages: previous.messages })
|
||||
sessionStateByRuntimeIdRef.current.set(sessionId, next)
|
||||
|
|
|
|||
|
|
@ -377,6 +377,7 @@ describe('refreshShipInfo', () => {
|
|||
ghReady: true,
|
||||
pr: { url: 'https://example.com/pr/3' }
|
||||
} as HermesReviewShipInfo
|
||||
|
||||
stubReview({ shipInfo: vi.fn(async () => info) })
|
||||
|
||||
await refreshShipInfo()
|
||||
|
|
|
|||
|
|
@ -30,7 +30,12 @@ import {
|
|||
import { readJson, writeJson } from '@/lib/storage'
|
||||
|
||||
import { $activeGatewayProfile, normalizeProfileKey } from './profile'
|
||||
import { $activeSessionId, $selectedStoredSessionId, $unreadFinishedSessionIds, setActiveSessionStoredId } from './session'
|
||||
import {
|
||||
$activeSessionId,
|
||||
$selectedStoredSessionId,
|
||||
$unreadFinishedSessionIds,
|
||||
setActiveSessionStoredId
|
||||
} from './session'
|
||||
import { isSecondaryWindow } from './windows'
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -53,7 +58,9 @@ export function setWatchdogClearFn(fn: WatchdogClearFn | null) {
|
|||
function armWatchdog(runtimeId: string) {
|
||||
const existing = sessionWatchdogTimers.get(runtimeId)
|
||||
|
||||
if (existing) {clearTimeout(existing)}
|
||||
if (existing) {
|
||||
clearTimeout(existing)
|
||||
}
|
||||
sessionWatchdogTimers.set(
|
||||
runtimeId,
|
||||
setTimeout(() => {
|
||||
|
|
@ -89,8 +96,11 @@ export function getRecentlySettledSessionIds(now: number = Date.now()): string[]
|
|||
const live: string[] = []
|
||||
|
||||
for (const [id, expiry] of settledExpiry) {
|
||||
if (expiry > now) {live.push(id)}
|
||||
else {settledExpiry.delete(id)}
|
||||
if (expiry > now) {
|
||||
live.push(id)
|
||||
} else {
|
||||
settledExpiry.delete(id)
|
||||
}
|
||||
}
|
||||
|
||||
return live
|
||||
|
|
@ -100,17 +110,24 @@ export function getRecentlySettledSessionIds(now: number = Date.now()): string[]
|
|||
function handleTransition(previous: ClientSessionState | null, next: ClientSessionState, runtimeId: string) {
|
||||
// Compression id rotation: signal the route-follow effect.
|
||||
if (previous?.storedSessionId && next.storedSessionId && previous.storedSessionId !== next.storedSessionId) {
|
||||
if (runtimeId === $activeSessionId.get()) {setActiveSessionStoredId(next.storedSessionId)}
|
||||
if (runtimeId === $activeSessionId.get()) {
|
||||
setActiveSessionStoredId(next.storedSessionId)
|
||||
}
|
||||
clearSettled(previous.storedSessionId)
|
||||
}
|
||||
|
||||
// Watchdog: arm on any busy publish, disarm on idle.
|
||||
if (next.busy) {armWatchdog(runtimeId)}
|
||||
else {clearWatchdog(runtimeId)}
|
||||
if (next.busy) {
|
||||
armWatchdog(runtimeId)
|
||||
} else {
|
||||
clearWatchdog(runtimeId)
|
||||
}
|
||||
|
||||
const storedId = next.storedSessionId
|
||||
|
||||
if (!storedId) {return}
|
||||
if (!storedId) {
|
||||
return
|
||||
}
|
||||
const wasWorking = previous?.busy ?? false
|
||||
|
||||
if (next.busy && !wasWorking) {
|
||||
|
|
@ -121,7 +138,9 @@ function handleTransition(previous: ClientSessionState | null, next: ClientSessi
|
|||
if (storedId !== $selectedStoredSessionId.get()) {
|
||||
const cur = $unreadFinishedSessionIds.get()
|
||||
|
||||
if (!cur.includes(storedId)) {$unreadFinishedSessionIds.set([...cur, storedId])}
|
||||
if (!cur.includes(storedId)) {
|
||||
$unreadFinishedSessionIds.set([...cur, storedId])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue