Commit Graph

787 Commits

Author SHA1 Message Date
dobby-d-elf 1cf0ff01b5 feat: live context window status tracking during streaming 2026-05-10 06:51:46 -06:00
nesquena-hermes 7cf8dcff4c Stage 326: PR #1956 — feat: persistent composer draft — server-side, cross-client, survives refresh by @JKJameson 2026-05-09 18:17:51 +00:00
nesquena-hermes 07d39612ce Stage 326: PR #1949 — fix(#1937): close endless-scroll prefetch vs Start-jump race with generation-token + mutex by @Sanjays2402
# Conflicts:
#	CHANGELOG.md
2026-05-09 18:17:51 +00:00
nesquena-hermes a0a65ba0bc Stage 326: PR #1941 — fix: preserve chat scroll across final render by @ai-ag2026 2026-05-09 18:17:20 +00:00
nesquena-hermes f0ecd94e04 Stage 326: PR #1945 — Localize session jump controls by @franksong2702
# Conflicts:
#	CHANGELOG.md
2026-05-09 18:17:03 +00:00
Michael Lam ce6685a27c fix: translate hidden-files workspace label 2026-05-09 10:36:30 -07:00
Minimax 08c4ef8d88 feat: persistent composer draft — server-side, cross-client, survives refresh
- Session.composer_draft field: {text, files} stored in session JSON
- POST+GET /api/session/draft endpoint for save/load
- loadSession: save draft before switch, restore from S.session.composer_draft
- textarea input: debounced 400ms auto-save to server
- send(): clear draft after message is sent
- lockComposerForClarify(): save draft before card locks composer
- _restoreComposerDraft: clears textarea when target has no draft, guards
  against stale responses racing new session loads, exact text comparison
- Session.compact(): includes composer_draft in response
- Fix: use handler.command instead of parsed.method (ParseResult has no .method)

Co-authored-by: Minimax <noreply@minimax.io>
2026-05-09 13:47:57 +01:00
Sanjay Santhanam fb822239ea fix(#1937): close endless-scroll prefetch vs Start-jump race with generation-token + mutex
The originally-proposed fix (gate _ensureAllMessagesLoaded on the existing
_loadingOlder flag) does not actually close the race. By the time the
prefetch reaches its post-await body, it has already cleared the entry-
gate that reads _loadingOlder, so a same-flag check inside the resolved
callback would be a no-op for an in-flight request.

The actual fix is two-pronged:

1. New module-scoped _messagesGeneration counter, bumped every time
   S.messages is wholesale-replaced. _loadOlderMessages snapshots it
   BEFORE its await and re-checks after — if it changed, the prepend
   is aborted. This is the canonical async-invalidation pattern.

2. _ensureAllMessagesLoaded now claims the _loadingOlder mutex around
   its body so a new prefetch cannot start mid-replace and concurrent
   ensure-all calls (rapid double-click on Start) serialize cleanly.
   It bumps the generation token before mutating S.messages, yields
   until any in-flight prefetch finishes, and resets _oldestIdx so a
   subsequent prefetch cannot request stale older messages.

Also adds the same-session / _loadingSessionId guards that the original
ensure-all body was missing post-await — if the user switched sessions
mid-flight, the old code would happily overwrite the new session's
messages with the previous session's full history.

12 new regression tests in tests/test_issue1937_endless_scroll_jumpstart_race.py
lock in: generation token declaration, bump-helper presence, snapshot-
before-await ordering, post-await-abort behaviour, mutex acquisition and
finally-release, yield-then-claim ordering when a prefetch is in flight,
generation bump during the wait phase, _oldestIdx reset, and the new
session-switch guard.

Closes #1937.
2026-05-08 21:14:22 -07:00
Frank Song 3dfd692d75 Localize session jump controls 2026-05-09 10:03:27 +08:00
ai-ag2026 1559c70a41 fix: preserve chat scroll across final render 2026-05-09 02:15:35 +02:00
nesquena-hermes bec4433c2a Stage 325: PR #1929 — feat: add opt-in session endless scroll by @ai-ag2026
Conflict resolution: both #1928 (session jump buttons) and #1929 (endless
scroll) add their own settings/UI/i18n keys. Resolved by keeping both —
the features are independent opt-in toggles.
2026-05-08 21:23:34 +00:00
nesquena-hermes fba860da48 Stage 325: PR #1928 — feat: add opt-in session jump buttons by @ai-ag2026 2026-05-08 21:16:33 +00:00
ai-ag2026 ea8aca2818 feat: add opt-in session endless scroll 2026-05-08 21:16:21 +00:00
ai-ag2026 df1ba9fde8 feat: add opt-in session jump buttons 2026-05-08 21:16:19 +00:00
ai-ag2026 8f58a8c94e feat: add browser offline recovery and PWA cache hardening 2026-05-08 21:16:17 +00:00
nesquena-hermes 383507f368 Stage 324: PR #1926 — fix: prevent chat scroll resets after final render by @ai-ag2026 2026-05-08 20:49:00 +00:00
nesquena-hermes 1f8e641e27 Stage 324: PR #1927 — fix: preserve viewport when loading older messages by @ai-ag2026 2026-05-08 20:49:00 +00:00
nesquena-hermes 89b8914704 Stage 324: PR #1930 — fix: collapse stale compression sidebar segments by @ai-ag2026 2026-05-08 20:49:00 +00:00
ai-ag2026 447b4e6c0f fix: collapse stale compression sidebar segments 2026-05-08 20:48:47 +00:00
ai-ag2026 018d491570 fix: preserve viewport when loading older messages 2026-05-08 20:48:44 +00:00
ai-ag2026 c65ae46983 fix: prevent chat scroll resets after final render
Keep explicit bottom pins stable across late layout growth and make clicking the already-active sidebar session a no-op before loadSession mutates state. Update scroll regression tests for the delayed settle path.
2026-05-08 20:48:43 +00:00
Frank Song 431705e498 Remove dead Kanban start i18n key 2026-05-08 20:48:37 +00:00
Michael Lam 8e513b596b fix: surface goal evaluation status 2026-05-08 17:12:01 +00:00
Michael Lam 0db5bc6b76 feat: add WebUI goal command support 2026-05-08 17:12:01 +00:00
nesquena-hermes 8c4c253654 Stage 322: PR #1814 — custom named provider API key resolution by @hualong1009 2026-05-08 16:55:20 +00:00
nesquena-hermes 692b48cd12 Stage 322: PR #1918 — fix workspace prefix sentinel handling by @franksong2702 2026-05-08 16:40:17 +00:00
Frank Song ccdc055c36 Fix workspace prefix sentinel handling 2026-05-08 16:40:17 +00:00
nesquena-hermes 71115b0d3a Stage 322: PR #1914 — keep streaming chat pinned after final render by @ai-ag2026 2026-05-08 16:40:16 +00:00
ai-ag2026 c4328c0a23 fix: keep streaming chat pinned after final render 2026-05-08 16:40:16 +00:00
Michael Lam af98bad9de fix: make kanban detail view scrollable 2026-05-08 16:40:16 +00:00
Dennis Soong 4e71fb75d7 fix: show collapsed session segment count 2026-05-08 16:07:49 +00:00
Frank Song 8c02bfacd2 Restore explicit tool-segment reset calls for legacy assertions 2026-05-08 15:37:09 +00:00
Frank Song 82c7367cef Add interim_assistant streaming path to WebUI 2026-05-08 15:37:09 +00:00
nesquena-hermes a21d14ead3 Stage 319: PR #1886 — Kanban lifecycle controls by @franksong2702 2026-05-08 15:22:48 +00:00
Frank Song 6879390b8f Fix Kanban lifecycle controls
- Remove Kanban card Start and bulk Running controls (PATCH to running was unsafe)
- Rename "Nudge dispatcher" → "Preview dispatcher" (matches dry-run semantics)
- Add empty-board guidance kanban_work_queue_hint

Rebased onto master post-v0.51.23 by maintainer; preserves Japanese translations
from #1863 (kanban_nudge_dispatcher: ディスパッチャープレビュー).

Closes #1885

Co-authored-by: Frank Song <franksong2702@gmail.com>
2026-05-08 15:19:04 +00:00
Frank Song 29829c3edf fix: preflight oversized browser uploads 2026-05-08 15:16:19 +00:00
nesquena-hermes 2c66d349ab Stage 318: PR #1872 — Fix workspace heading affordance without workspace by @franksong2702 2026-05-08 15:01:50 +00:00
nesquena-hermes 0ba6724e16 Stage 318: PR #1871 — Fix no-agent cron edit snapshot source by @franksong2702 2026-05-08 15:01:50 +00:00
nesquena-hermes 94d3cd5e95 Stage 318: PR #1870 — Fix Kanban stale-client false-positive by @franksong2702 2026-05-08 15:01:49 +00:00
Frank Song ee0828f53d fix: disable workspace heading affordance without workspace 2026-05-08 13:32:05 +08:00
Frank Song b0876982c4 fix: use cron edit snapshot for no-agent saves 2026-05-08 13:18:29 +08:00
Frank Song 153c34cac0 fix: tighten Kanban stale-client heuristic 2026-05-08 13:12:16 +08:00
koshikai 9ddd1ae02c i18n: add Japanese (ja) locale bundle 2026-05-08 10:16:54 +09:00
nesquena-hermes 5005f1c8ba Merge pull request #1853 from nesquena/fix/1793-workspace-prefs-kebab
fix(workspace): move 'Show hidden files' toggle into kebab + accent-dot state indicator (#1793)
2026-05-07 14:19:34 -07:00
Nathan Esquenazi d703959b74 fix(user-bubble): stash code fences before math to keep code-blocks literal
PR #1854 added a math stash to _renderUserFencedBlocks so backslash LaTeX
delimiters (\[..\], \(..\)) survive esc() and reach the KaTeX renderer in
user bubbles. The stash ran BEFORE the existing code-fence stash, so a
user-typed code block containing LaTeX-like syntax was extracted as
KaTeX and rendered as math inside <pre><code>:

    ```
    \[ a + b \] is wrong
    ```
  → <pre><code><div class="katex-block"> a + b </div> is wrong</code></pre>

renderMd() (assistant path) handles this correctly by running fence_stash
before math_stash. The user-bubble path got the order inverted. Fix:
stash code fences first, then run the math regexes on the
outside-of-fence text only. Both top-level math and code-fenced literals
now render correctly:

  - "math: \[ x + y \]"           → KaTeX block
  - "```\n\[ a + b \]\n```"       → literal <pre><code>\[ a + b \]</code></pre>

Adds two regression tests:
  - test_user_code_block_with_latex_syntax_renders_as_literal_code
    (fails pre-fix, asserts no KaTeX wrappers inside <pre><code>)
  - test_user_bubble_top_level_latex_still_renders_after_fence_reorder
    (sibling guard against over-correcting and disabling math entirely)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 14:03:04 -07:00
nesquena-hermes 945e7af751 fix: keep panel-header label at flex-shrink:2 (preserves shrink hierarchy)
Earlier in this branch I'd reduced .panel-header > span:first-child to
flex-shrink:1 thinking it would let heading + chip fit better at the
default 300px panel width. That broke
test_workspace_label_shrinks_with_ellipsis which pins the
git-badge:3 > label:2 > icons:0 shrink hierarchy as load-bearing
(git badge collapses first, label second, icons never).

The chip-on-narrow-panel concern is now addressed by the @container
query that hides the chip entirely below 420px container width — the
heading no longer competes with the chip for horizontal space, so
flex-shrink:2 is fine again.
2026-05-07 20:50:13 +00:00
Michaelyklam d44513aabd fix: render backslash LaTeX delimiters in chat
Closes #1847

Co-authored-by: Michaelyklam <Michaelyklam@users.noreply.github.com>
2026-05-07 20:43:01 +00:00
ChaseFlorell 94aeb538f2 fix: use './' relative ES module specifier for smd.min.js (closes #1849)
The original specifier 'static/vendor/smd.min.js' was a bare module
specifier, which the [HTML spec](https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier)
rejects: relative ES module references must start with '/', './', or
'../'. The block failed silently, window.smd was never set, and live
streaming markdown was broken for all users.

Fix: change to './static/vendor/smd.min.js' — the './'-relative form
satisfies both the ES module spec AND keeps the import resolution
mount-agnostic, so subpath deployments like /hermes/ continue to work.
Tests test_smd_vendor_import_is_mount_agnostic and
test_static_vendor_import_is_relative_to_current_mount updated to
require the './' form and forbid both the bare-specifier and
root-absolute forms.

Adapted from PR #1851 by @ChaseFlorell. Original PR fix used the
root-absolute form which fixed the bare-specifier bug but broke
subpath deployments; the './' form is the only shape that satisfies
both constraints.

Co-authored-by: Chase Florell <ChaseFlorell@users.noreply.github.com>
2026-05-07 20:42:19 +00:00
nesquena-hermes 1a533ec770 ux(workspace): hide hidden-files chip entirely on narrow panels
At the default 300px panel width, even the icon-only chip + 'Workspace'
heading + 5 action buttons overflowed and triggered ellipsis on the
heading ('WORKSP...'). Cleaner: hide the chip below 420px container
width and rely on the kebab's accent dot as the non-default-state
signal. The dot costs zero horizontal space (absolute-positioned over
the kebab icon) and the kebab's tooltip still labels what's happening.
On wider panels (user-resized, or future layouts), the full chip with
text appears.
2026-05-07 19:39:46 +00:00
nesquena-hermes d8afba8001 ux(workspace): mute chip color + collapse to icon-only on narrow panels
Vision review of v1 flagged the chip's accent-yellow as 'loud and ugly'.
Switched to muted hover-bg + 1px border for a subtler badge look. Also
addressed heading truncation: at the default 300px panel width, heading
(95px) + 5 action buttons (154px) + chip text (110px) overflows, so the
heading was ellipsing to 'W...'. Added a container query on the existing
.rightpanel container that drops the chip text below 360px container
width, leaving just the eye icon (tooltip still labels it).
2026-05-07 19:36:27 +00:00