Commit Graph

4143 Commits

Author SHA1 Message Date
Teknium aaaea589f6 test+style: align session.new binding pin with #76185 and eslint --fix 2026-08-15 01:04:06 -07:00
Teknium a9361cfaae fix(desktop): add zh locale strings for the Disable F12 toggle
zh.ts is typed strictly against Translations, so the new
disableF12Title/Desc keys must exist there (other locales fall back via
defineLocale).
2026-08-15 01:04:06 -07:00
Teknium dacb99d5b8 fix(desktop): keep the deliberate mod+N chord for session.new
#76185 removed both defaults; only the bare shift+n chord hijacks normal
typing (uppercase N / IME input outside an input field). Cmd/Ctrl+N is a
deliberate two-key chord that matches every browser and chat app, so it
stays. Follow-up narrowing of the salvaged fix.
2026-08-15 01:04:06 -07:00
kas-cor 3b5d5e48d1 fix: address review feedback on Disable F12 DevTools PR
- Add disableF12Title/disableF12Desc to i18n/types.ts contract
- Use focused BrowserWindow from menu click callback
- Persist and restore disable-f12 from main process (cold-launch)
2026-08-15 01:04:06 -07:00
Hermes Agent d4fa3f7352 feat(desktop): add option to disable F12 DevTools shortcut
- Replace built-in menu role 'toggleDevTools' (which had F12 accelerator)
  with explicit menu item using Ctrl+Shift+I / Cmd+Opt+I only
- Add f12Blocked flag in main process, controllable via IPC
- Add 'Disable F12 DevTools' toggle in Settings → Advanced
- F12 still opens DevTools by default; toggle blocks it
- Ctrl+Shift+I (or Cmd+Opt+I on Mac) always works regardless
2026-08-15 01:04:06 -07:00
Brian Sweatt 89f9375bc0 feat(desktop): archive the current session via hotkey and ⌥+⇧-click
Adds a rebindable 'session.archive' keybind action (shipped unbound, like
session.togglePin) plus an ⌥+⇧-click gesture on sidebar session rows,
extracted into a pure, unit-tested click resolver so modifier precedence
(⌥⇧ archive vs ⇧ pin vs ⌘/⌃⇧ new window) stays correct.

Salvaged from #59759. Closes #59308.
2026-08-15 01:04:06 -07:00
273-B_L0 34f484542e fix(desktop): show platform Kanban modifier 2026-08-15 01:04:06 -07:00
273-B_L0 f61fb52f94 fix(desktop): show platform layout modifier 2026-08-15 01:04:06 -07:00
273-B_L0 a590321de2 fix(desktop): show platform commit shortcut 2026-08-15 01:04:06 -07:00
pierrenode 245efdaaa3 fix(desktop): dispose the HUD snap shortcut on native window close
9c75e4863f added the global ⌘⇧G snap-to-cursor shortcut and wired its
dispose() into closeHudWindow() and before-quit. It missed the HUD's
own 'closed' listener (spawnHudWindow's win.on('closed', ...)), which
fires when the window is closed from its own side — e.g. ⌘W — without
going through closeHudWindow() first.

After a ⌘W close, the shortcut stays registered with no HUD left to
apply it to: harmless (applyHudSnapToPointer guards on a destroyed/null
hudWindow) but it keeps CommandOrControl+Shift+G claimed until the HUD
is reopened (register() releases first) or the app quits.

dispose() is idempotent (guards on its own `active` chord), so calling
it unconditionally in the 'closed' handler is safe even on paths where
closeHudWindow() already released it.
2026-08-15 01:04:06 -07:00
Vladimir Rogozhin Assistant 101dfd782d Add PageUp and PageDown keybind support 2026-08-15 01:04:06 -07:00
BAS Lam 13acf7759e fix(desktop): remove session.new keybind hijacking typed N keys
The session.new default keybindings included 'mod+n' and 'shift+n',
which fired when users typed uppercase N (Shift+N) or accidentally
pressed Ctrl+N while using an IME to type Chinese — silently creating
new sessions mid-conversation.

Remove both combos so New Session is only reachable via the sidebar
button. Ctrl+Shift+N (session.newWindow) is unaffected.
2026-08-15 01:04:06 -07:00
Teknium 1c9de87ffb fix: drop duplicate composingRef declaration from rebase weave 2026-08-15 01:03:57 -07:00
Teknium 89df391580 fix(desktop): keybinds skip IME composition keys; pin draft survival across Settings navigation
- use-keybinds: bail out of the global keydown dispatcher while an IME
  composition is active. Windows Chinese IMEs use Ctrl+, as their
  punctuation toggle, which also matched nav.settings and navigated away
  mid-word — destroying the unsent composer draft (#41079).
- use-composer-draft.test: regression-pin the unmount-stash/remount-restore
  contract so route navigation (Settings) can never again drop an unsent
  draft with the React tree.
- use-composer-actions.test: the bounded-preview pipeline keys attachments
  to the durable path and resolves thumbnails asynchronously; the dropped-
  screenshot test now asserts the durable-path contract instead of the
  retired full-res previewUrl field.
2026-08-15 01:03:57 -07:00
Jakub Wolniewicz d0642e61e5 fix(desktop): preserve legacy attachment replacements 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz e2a2fba4aa fix(desktop): preserve in-flight attachment replacements 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz 462e7d8e6b fix(desktop): preserve tile attachment ownership 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz 193c199b23 fix(desktop): make image attachment updates occurrence-safe 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz 7d5e9757ec fix(desktop): preserve image preview ownership across drafts 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz 6dfe63e1e2 fix(desktop): preserve image attachment occurrence ownership 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz 5e09b4008b fix(desktop): serialize composer image previews 2026-08-15 01:03:57 -07:00
Jakub Wolniewicz d345f0831f fix(desktop): bound multi-image thumbnail raster cost 2026-08-15 01:03:57 -07:00
David Metcalfe 485e1e8f69 fix(desktop): keep full-res previewUrl separate from downscaled thumbnail
Addresses review feedback on #68744: downscaling inside
attachmentPreviewDataUrl made previewUrl the 2048px PNG, but current main
(d8cb73b4ab) feeds that field to ImageLightbox and useImageDownload, so
large attachments would open and download at reduced resolution.

- attachmentPreviewDataUrl returns the full-resolution data URL again
- ComposerAttachment gains thumbnailUrl?: string (store/composer.ts)
- attachImagePath stores previewUrl (full-res) + thumbnailUrl (downscaled)
- Attachment pill renders thumbnailUrl ?? previewUrl; lightbox/download
  keep the full-res previewUrl
- optimisticAttachmentRef prefers thumbnailUrl for the in-flight bubble
  display ref (same main-thread decode freeze at send time)
- Attachment-level regression test in use-composer-actions.test.ts:
  full-res previewUrl preserved while thumbnailUrl is a separate
  downscaled value (4000x3000 -> 2048x1536)
2026-08-15 01:03:57 -07:00
David Metcalfe 24fc613318 fix(desktop): downscale large images in composer preview to prevent UI freeze 2026-08-15 01:03:57 -07:00
Johnny 0d447712a0 fix(desktop): keep composer stable across compression 2026-08-15 01:03:57 -07:00
Gille 224530211e fix(desktop): let composer status titles use row width 2026-08-15 01:03:57 -07:00
xrwang8 47970a9e4c fix(desktop): clear edit-composer submitting latch after 200ms cooldown
- Add submitting state + IME composition guard to prevent double-submit
- submitEdit() sets latch, then clears after 200ms timeout
- handleKeyDown() guards on composing so IME Enter doesn't submit
- Shift+Enter inserts newline without submitting
- Test validates Enter calls onEdit, latch clears for second session

Fixes #70771

Signed-off-by: xrwang8 <xrwang8@gmail.com>
2026-08-15 01:03:57 -07:00
mollusk 652ae4877a fix(desktop): let the edit composer scroll long prompts
The inline edit composer caps height at max-h-48 but had no overflow
rule, so long prompts were clipped with no way to reach the tail.
Add overflow-y-auto to match the main composer editor.
2026-08-15 01:03:57 -07:00
Lester Liang 49fbca1880 fix(desktop): prevent accidental composer popout 2026-08-15 01:03:57 -07:00
Denis 354abd7c57 fix(desktop): keep empty composer from collapsing
Fixes #68134\nFixes #68095
2026-08-15 01:03:57 -07:00
infinitycrew39 2a82c6ffbc style(desktop): align empty-state width with full chat column 2026-08-15 01:03:57 -07:00
infinitycrew39 006a4a8873 fix(desktop): restore full-width chat composer column 2026-08-15 01:03:57 -07:00
hermes-seaeye[bot] af585de28e fmt(js): npm run fix on merge (#86801)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 07:46:57 +00:00
Teknium 03c85a1c7c test(desktop): port gateway-file-download tests to vitest electron project
The salvaged branch predates the electron test project's node:test -> vitest
migration (test:desktop:platforms is now `vitest run --project electron`).
Import `test` from vitest so the suites are collected; assertions stay on
node:assert/strict per the existing electron test convention.
2026-08-15 00:37:00 -07:00
Paul Armbruster 27b003996a fix(desktop): stream native gateway downloads + 404 data-url fallback
Addresses both review findings on the remote-gateway download PR:

1. Unbounded buffering (finding #1). fetchBuffer / fetchBufferViaOauthSession
   accumulated the entire response (then copied it again via Buffer.concat)
   before saveGatewayFile even opened the save dialog, so a large gateway file
   could exhaust the native process. Both auth paths now stream: once response
   headers arrive the connect timeout is cleared, the filename is derived, the
   save dialog is shown, and the body is piped to the chosen destination with
   backpressure. A read/write error tears down the stream and unlinks the
   partial file. The byte-moving, data-URL decoding, and filename/path helpers
   are extracted into gateway-file-download.ts so they're unit-testable without
   Electron.

2. No fallback for older gateways (finding #2). saveGatewayFile required the new
   /api/fs/download route. Desktop and the remote gateway update independently,
   so a gateway predating this PR 404s. Added a 404-only compatibility fallback
   to the existing capped /api/fs/read-data-url route (bounded, so it only
   serves smaller files — enough to keep older backends working).

Tests: gateway-file-download.test.ts covers streaming, backpressure,
error-cleanup (unlink on write/response error), data-URL decoding, filename
derivation (incl. traversal reduction), and 404 detection;
gateway-file-download-transport.test.ts asserts both transports stream (no
whole-body Buffer.concat) and that the 404 fallback is wired. Both registered
in the desktop platform test list. Server-side /api/fs/download tests
(streaming + sensitive-file reject) already pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-15 00:37:00 -07:00
Paul BlackSwan d5a865882a fix(desktop): save remote gateway files natively 2026-08-15 00:37:00 -07:00
Dean Chen 0bc7070cf8 fix(desktop): gate image copy on decoded contents 2026-08-15 00:36:15 -07:00
Dean Chen 3c570c61ff fix(desktop): preserve copy image for large remote media 2026-08-15 00:36:15 -07:00
DannyFengTianYu 07b9090259 fix(desktop): preserve complete history when branching
Read the durable display transcript when creating a branch instead of copying the compacted model projection. Hydrate the Desktop branch boundary from persisted history, avoid stale whole-chat counts, and seed the new tile from the backend snapshot. Add regression coverage for compacted histories, visible-message counts, selected prefixes, and hydration races.

(cherry picked from commit c3d2d759ae104395adde215b2e293ccf8e895684)
2026-08-15 00:35:40 -07:00
mj 73e9b1a124 docs(desktop): align getGateway docstring with $gateway atom subscription
Residual hunk from PR #84832's picker-rebind commit; the functional
surfaces.tsx change landed on main via #86250.

(cherry picked from commit 990936d6f6e752ddb474787c1f7fdc3ad4f4dc60, docstring hunk only)
2026-08-15 00:35:28 -07:00
mj 20e5d78f54 fix(desktop): recover failed gateway catalogs
(cherry picked from commit ef1d2cc5e541f37fbd12b41f686a4c18a9b85320)
2026-08-15 00:35:28 -07:00
mj 1ef7a0bdda fix(desktop): recover empty model catalogs
(cherry picked from commit 72a06b9e0b392c494be011dc74ccf948ca693e3f)
2026-08-15 00:35:28 -07:00
Teknium ddf6456794 test: stub virtualizer.measure in virtual-session-list mock (density invalidation call) 2026-08-15 00:34:57 -07:00
Teknium 29c28136fe style(desktop): prettier/eslint pass on salvaged files 2026-08-15 00:34:57 -07:00
Teknium 865e4e7178 fix(desktop): default session list density to compact
Keeps the sidebar byte-identical for existing users until they opt into
comfortable/detailed themselves — per the no-default-change salvage rule.
2026-08-15 00:34:57 -07:00
David Metcalfe a33ac1e95e feat(desktop): add session list density modes
Squashed from #68124, resolved against current main (inbox cards, marquee
titles, actions cluster). Adds a Settings → Appearance 'Session list
density' preference — compact (default, unchanged), comfortable
(+deterministic metadata line), detailed (+initial-request preview) —
with density-aware virtualizer estimates.

Closes #68119

(cherry picked from commits 93bc19400a..568f78a8fc)
2026-08-15 00:34:57 -07:00
chillerno1 c6ec8a95e6 test(desktop): cover docked zone chevron direction
(cherry picked from commit 95358428f95175ef57376da334b69279618cce6a)
2026-08-15 00:34:57 -07:00
chillerno1 ac0d0f8897 fix(desktop): flip zone collapse chevron to action direction
Collapsed tool zones (terminal/logs) kept a down chevron after minimize,
so the restore affordance looked like another collapse. Point the icon in
the action direction — down when expanded, up when collapsed — matching
master-detail collapsible detail headers. Same fix for floating panes.

(cherry picked from commit 3392aeb9dba0ed9e9cabfb96b6010e46fa453ca1)
2026-08-15 00:34:57 -07:00
Isak du Plessis 10bf145e30 feat(desktop): collapse thinking by default
(cherry picked from commit 14fd1aace2c76c31f3b48e4b9bf9943c74582d21)
2026-08-15 00:34:57 -07:00
Teknium 15e7c563b3 style: eslint --fix on salvaged IME test (curly + padding rules) 2026-08-15 00:33:40 -07:00