Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions apps/desktop/electron/handoff-result.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ function write(home: string, body: any) {

test('consumes and returns a fresh failure result', () => {
const home = tempHome()
write(home, { ok: false, exit_code: 6, message: 'rebuild failed', branch: 'main', finished_at: Math.floor(Date.now() / 1000) })
write(home, {
ok: false,
exit_code: 6,
message: 'rebuild failed',
branch: 'main',
finished_at: Math.floor(Date.now() / 1000)
})

const result = readAndConsumeHandoffResult(home)

Expand All @@ -38,7 +44,13 @@ test('reports each result at most once', () => {

test('discards stale results but still consumes the file', () => {
const home = tempHome()
write(home, { ok: false, exit_code: 5, message: 'old', branch: 'main', finished_at: Math.floor(Date.now() / 1000) - 3600 })
write(home, {
ok: false,
exit_code: 5,
message: 'old',
branch: 'main',
finished_at: Math.floor(Date.now() / 1000) - 3600
})

assert.equal(readAndConsumeHandoffResult(home), null)
assert.equal(fs.existsSync(handoffResultPath(home)), false)
Expand Down
5 changes: 4 additions & 1 deletion apps/desktop/electron/hyprland.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ describe('parseHyprlandClients', () => {

it('keeps everything when it cannot find our own window', () => {
const parsed = parseHyprlandClients(
payload(client({ class: 'a', pid: 2, workspace: { id: 1 } }), client({ class: 'b', pid: 3, workspace: { id: 7 } })),
payload(
client({ class: 'a', pid: 2, workspace: { id: 1 } }),
client({ class: 'b', pid: 3, workspace: { id: 7 } })
),
SELF_PID
)

Expand Down
20 changes: 17 additions & 3 deletions apps/desktop/electron/updater-process.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ test('resolveUpdateScriptHandoff is Windows-only (POSIX updates in place)', () =
test('wrapHandoffForDetachedConsole routes through cmd start with own console', () => {
const root = String.raw`C:\Users\hermes\AppData\Local\hermes\hermes-agent`
const expected = path.join(root, 'scripts', 'desktop-update.ps1')

const handoff = resolveUpdateScriptHandoff(root, {
isWindows: true,
fileExists: candidate => candidate === expected
Expand All @@ -214,8 +215,21 @@ test('wrapHandoffForDetachedConsole routes through cmd start with own console',

assert.equal(wrapped.command, 'cmd.exe')
assert.deepEqual(wrapped.args, [
'/d', '/s', '/c', 'start', '', '/min',
'powershell', '-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', expected,
'-InstallRoot', root, '-Branch', 'main'
'/d',
'/s',
'/c',
'start',
'',
'/min',
'powershell',
'-NoProfile',
'-ExecutionPolicy',
'Bypass',
'-File',
expected,
'-InstallRoot',
root,
'-Branch',
'main'
])
})
5 changes: 4 additions & 1 deletion apps/desktop/electron/updater-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ export function resolveUpdateScriptHandoff(
* callers must not use it as a marker owner (the script claims the marker
* itself with its own $PID).
*/
export function wrapHandoffForDetachedConsole(handoff: UpdateScriptHandoff, extraArgs: string[]): {
export function wrapHandoffForDetachedConsole(
handoff: UpdateScriptHandoff,
extraArgs: string[]
): {
command: string
args: string[]
} {
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/app/chat/session-status-dot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export function SessionStatusDot({ storedSessionId, session, branchStem, classNa
const dotState = useStoreSelector($sessionDotStateById, states =>
storedSessionId ? (states[storedSessionId] ?? 'idle') : 'draft'
)

const variant = DOT_VARIANTS[dotState]

return (
Expand Down
3 changes: 1 addition & 2 deletions apps/desktop/src/app/chat/session-tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,7 @@ export const watchSessionTiles = paneMirror<SessionTile>({
),
// Until the first turn lists a row there is no title to register, so the tab
// takes its name from the composer instead — live, without re-registering.
tabTitle: storedSessionId =>
tileStoredRow(storedSessionId) ? null : <SessionDraftTitle scope={storedSessionId} />,
tabTitle: storedSessionId => (tileStoredRow(storedSessionId) ? null : <SessionDraftTitle scope={storedSessionId} />),
render: storedSessionId => <SessionTilePane storedSessionId={storedSessionId} />,
tabWrap: (storedSessionId, tab) => (
<SessionTabMenu
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export function useGatewayBoot({
const override = windowProfileOverride()

try {
const profileKey = override ?? ((await desktop.profile?.get?.())?.profile ?? '')
const profileKey = override ?? (await desktop.profile?.get?.())?.profile ?? ''
const key = normalizeProfileKey(profileKey)
$activeGatewayProfile.set(key)
setPrimaryGateway(gateway, key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ export function TreeGroup({
const closeableTab = (paneId: string) => !paneChrome(paneFor(paneId)).uncloseable || panesWithCloser.has(paneId)

// A pane's own live label when it has one, else its registered string.
const tabLabel = (paneId: string) =>
paneChrome(paneFor(paneId)).tabTitle?.() ?? paneFor(paneId)?.title ?? paneId
const tabLabel = (paneId: string) => paneChrome(paneFor(paneId)).tabTitle?.() ?? paneFor(paneId)?.title ?? paneId

// Collapse/restore a tool panel (or plain minimize elsewhere) — the header
// chevron + tap gesture, routed so ⌃`/the titlebar toggle stay truthful.
Expand Down
6 changes: 5 additions & 1 deletion apps/desktop/src/lib/draft-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const MAX_DRAFT_TITLE_CHARS = 48
* rather than showing a title that says less than the placeholder.
*/
export function deriveDraftTitle(text: string): string {
const line = text.split('\n').find(candidate => candidate.trim())?.trim() ?? ''
const line =
text
.split('\n')
.find(candidate => candidate.trim())
?.trim() ?? ''

if (!line) {
return ''
Expand Down
Loading