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
27 changes: 15 additions & 12 deletions apps/desktop/electron/windows-hermes-path.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ test('buildPathExtCandidates: non-Windows only tries the bare name', () => {
})

test('chooseUpdaterArgs: gentle --update when both updater runtime files exist', () => {
assert.deepEqual(
chooseUpdaterArgs({ hasBootstrapMarker: true, hasVenvHermes: true, hasVenvPython: true }, 'main'),
['--update', '--branch', 'main']
)
assert.deepEqual(chooseUpdaterArgs({ hasBootstrapMarker: true, hasVenvHermes: true, hasVenvPython: true }, 'main'), [
'--update',
'--branch',
'main'
])
})

test('chooseUpdaterArgs: marker-only install uses --repair when the venv is gone', () => {
Expand All @@ -60,14 +61,16 @@ test('chooseUpdaterArgs: marker-only install uses --repair when the venv is gone
})

test('chooseUpdaterArgs: partial updater runtimes use --repair', () => {
assert.deepEqual(
chooseUpdaterArgs({ hasBootstrapMarker: true, hasVenvHermes: false, hasVenvPython: true }, 'main'),
['--repair', '--branch', 'main']
)
assert.deepEqual(
chooseUpdaterArgs({ hasBootstrapMarker: true, hasVenvHermes: true, hasVenvPython: false }, 'main'),
['--repair', '--branch', 'main']
)
assert.deepEqual(chooseUpdaterArgs({ hasBootstrapMarker: true, hasVenvHermes: false, hasVenvPython: true }, 'main'), [
'--repair',
'--branch',
'main'
])
assert.deepEqual(chooseUpdaterArgs({ hasBootstrapMarker: true, hasVenvHermes: true, hasVenvPython: false }, 'main'), [
'--repair',
'--branch',
'main'
])
})

test('chooseUpdaterArgs: passes the branch through unchanged in both modes', () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/app/chat/composer/focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ export const requestComposerSubmit = (
}

const resolvedTarget = resolve(target)
const surfaceId =
requestedSurfaceId === undefined ? getVisibleComposerSurfaceId(resolvedTarget) : requestedSurfaceId

const surfaceId = requestedSurfaceId === undefined ? getVisibleComposerSurfaceId(resolvedTarget) : requestedSurfaceId

// Fail closed: without an exact visible surface identity, broadcasting a
// submit could make more than one keep-alive/new-chat composer claim it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ describe('useComposerSubmit external request routing', () => {
const visibleMain = renderSubmitHook({ sessionKey: 'session-a' })
const hiddenMain = renderSubmitHook({ sessionKey: 'session-b', visible: false })
const visibleTile = renderSubmitHook({ scopeTarget: 'tile:project-b', sessionKey: 'tile-session' })

const hiddenTile = renderSubmitHook({
scopeTarget: 'tile:project-c',
sessionKey: 'other-tile',
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/store/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export function toggleReview(scopeCwd: null | string = null, scopeTarget = 'main
// — never the docked open state, which a 0px track would render invisibly.
if (matchesQuery(SIDEBAR_COLLAPSE_MEDIA_QUERY)) {
const target = scopeTarget.trim() || 'main'

const originChanged =
($reviewScopeCwd.get() ?? null) !== (scopeCwd?.trim() || null) || $reviewScopeTarget.get() !== target

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/store/translucency.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('glass mode', () => {
setTranslucency(TRANSLUCENCY_MIN)
})

it('rejects glass when the platform cannot back it', () => {
it('rejects glass when the platform cannot back it', () => {
setTranslucency(50)
setTranslucencyMode('glass')

Expand Down
5 changes: 1 addition & 4 deletions ui-tui/packages/hermes-ink/src/ink/ansi-transition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ describe('transitionAnsiCodes weight family', () => {
const compound = (params: string) => ({ type: 'ansi' as const, code: `${ESC}[${params}m`, endCode: `${ESC}[0m` })

it('compound bold → compound dim resets the weight family', () => {
expect(codes(transitionAnsiCodes([compound('1;31')], [compound('2;37')]))).toEqual([
`${ESC}[22m`,
`${ESC}[2;37m`
])
expect(codes(transitionAnsiCodes([compound('1;31')], [compound('2;37')]))).toEqual([`${ESC}[22m`, `${ESC}[2;37m`])
})

it('compound bold → compound bold (color change) stays minimal', () => {
Expand Down
7 changes: 6 additions & 1 deletion ui-tui/packages/hermes-ink/src/ink/ansi-transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function weightAtoms(code: AnsiCode): string[] {
// Extended color: consume the argument sub-params so their literal
// 2/5 aren't read as weight atoms.
i += parts[i + 1] === '5' ? 2 : parts[i + 1] === '2' ? 4 : 0

continue
}

Expand Down Expand Up @@ -80,6 +81,7 @@ export function transitionAnsiCodes(from: AnsiCode[], to: AnsiCode[]): AnsiCode[
for (const atom of fromAtoms) {
if (!toAtoms.has(atom)) {
removesWeight = true

break
}
}
Expand All @@ -94,7 +96,10 @@ export function transitionAnsiCodes(from: AnsiCode[], to: AnsiCode[]): AnsiCode[
// in full (a compound re-asserts its color too — redundant bytes, never
// wrong). The rest of the style diffs normally with the weight carriers
// stripped from both sides.
const rest = diffAnsiCodes(from.filter(code => !carriesWeight(code)), to.filter(code => !carriesWeight(code)))
const rest = diffAnsiCodes(
from.filter(code => !carriesWeight(code)),
to.filter(code => !carriesWeight(code))
)

return [WEIGHT_RESET, ...rest, ...to.filter(carriesWeight)]
}
Loading