Commit graph

1993 commits

Author SHA1 Message Date
Rod Boev
36fee0c6a4 fix(#4757): add active-drag flags so macOS workspace drag-drop lands 2026-06-24 18:58:33 +00:00
Brett Yelverton
2a40ca4240 fix(streaming): restore mobile scroll-jank guard during live renders
A later streaming parse-cache change dropped the #MOBILESCROLL guard from
the live-stream render tick while leaving the helper and CSS in place.
On iOS PWA, Safari can paint a transient scrollTop=0 frame during streamed
DOM rebuilds, forcing the reader to the first/oldest message.

Re-add _fixMobileScrollJank() before streaming DOM work begins and pin it
with a regression test so the third layer of the mobile scroll fix cannot
be silently dropped again.
2026-06-24 17:20:40 +00:00
nesquena-hermes
984fd9557c Merge remote-tracking branch 'origin/master' into gate/4813-cron-prefix 2026-06-24 11:01:50 +00:00
nesquena-hermes
9493f1640f Merge branch 'peek-4813' into gate/4813-cron-prefix 2026-06-24 10:49:48 +00:00
nesquena-hermes
631f1a35da Merge branch 'peek-4832' into gate/4832-kanban-height 2026-06-24 10:38:49 +00:00
Hoang Luan
78cd8798ec
Merge branch 'master' into fix/cron-model-provider-prefix 2026-06-24 17:05:29 +07:00
nesquena-hermes
671f4504ae fix(#4702): co-seed _lastMessageClientHeight with every programmatic _lastScrollTop write (Codex gate)
Codex found the guard had a first-event gap: programmatic seeds of _lastScrollTop
(_setMessageScrollToBottom, scrollToBottom, snapshot restore paths) didn't seed
_lastMessageClientHeight, so the FIRST native toolbar-collapse scroll saw a null
prior height -> grew=false -> the false-unpin still fired. Now every programmatic
_lastScrollTop=el.scrollTop is paired with _lastMessageClientHeight=el.clientHeight.
2026-06-24 10:02:52 +00:00
nesquena-hermes
fe40912eb9 fix(#4702): don't false-unpin a freshly-opened session on iOS portrait toolbar settle
iOS Safari portrait resolves its dynamic toolbar height after first paint; when the
toolbar collapses the #messages scroller grows (clientHeight up), firing a scroll
event with decreased scrollTop that was misread as an upward user scroll -> falsely
set _messageUserUnpinned, and the ResizeObserver settle then self-cancelled, leaving
the reader stranded at the TOP of a freshly-opened conversation (landscape unaffected
since it doesn't resize late). Sibling of #4701.

Fix (touch-safe, no-op on desktop/landscape where clientHeight is stable):
- Track _lastMessageClientHeight; gate movedUp on !grew so a container-height
  INCREASE can't be read as an upward scroll. Reset on session switch.
- For explicit (open) settles, also observe the scroller itself so a late portrait
  toolbar collapse re-anchors the bottom.

Independent of #4818 (overflow-anchor paint-gap) — different mechanism, coexists.
Diagnosis credit: investigation. Co-authored-by: reinocheong <reporter>
2026-06-24 09:56:06 +00:00
jkobject
93afd60425 fix(kanban): bound column card list height 2026-06-24 10:57:03 +02:00
Orange Pi Vietnam
d341f2084c
Merge branch 'nesquena:master' into master 2026-06-24 15:12:44 +07:00
Hoang Luan
c54186c42a
Merge branch 'master' into fix/cron-model-provider-prefix 2026-06-24 14:47:27 +07:00
Tony Tran
730c6940c9 fix: add missing Vietnamese locale keys 2026-06-24 14:28:22 +07:00
nesquena-hermes
92b3ca7046 Merge branch 'peek-4818' into gate/4818-mobile-scroll 2026-06-24 06:59:17 +00:00
nesquena-hermes
988acdb441 Merge remote-tracking branch 'origin/master' into gate/4803-recycle-harden 2026-06-24 06:49:41 +00:00
Orange Pi Vietnam
e42d308245
Merge branch 'master' into master 2026-06-24 13:42:54 +07:00
akrhin
d89cfea45e
Merge branch 'master' into fix/mobile-scroll-jank-clean 2026-06-24 09:41:54 +03:00
Orange Pi Vietnam
b12f541394
Merge branch 'nesquena:master' into master 2026-06-24 13:41:38 +07:00
akrhin
c4e82c6155 chore: cleanup per Greptile review
- Remove dead _scrollAnchorRestore variable (returns undefined)
- Remove redundant _fixMobileScrollJank() call from _doRender()
  (CSS already gives overflow-anchor:auto on mobile via media query;
   desktop exits guard early — call was a no-op on every tick)
- Update JSDoc on _fixMobileScrollJank to reflect actual usage
2026-06-24 09:38:01 +03:00
akrhin
98688491c1 fix(#MOBILESCROLL): prevent scrollTop jank to top on mobile during streaming DOM rebuild
Root cause: .messages had overflow-anchor:none unconditionally. On mobile
touch devices (iOS Safari, Android Chrome), the compositor can paint a frame
with scrollTop=0 between innerHTML='' and snapshot restore, scroll-janking
the user to the top of the transcript.

Three-layer fix:

1. CSS (style.css): Use overflow-anchor:auto on touch devices (mobile),
   keep overflow-anchor:none on desktop (mouse-driven) via
   @media (hover:hover) and (pointer:fine) — preserves the existing
   behavior where tool/card inserts don't yank a reading user.

2. JS guard (ui.js): Add window._fixMobileScrollJank() that temporarily
   sets overflowAnchor='auto' on #messages before innerHTML='' and
   clears it one rAF later — prevents the compositor frame with scrollTop=0.

3. Streaming protection (messages.js): Call _fixMobileScrollJank() at the
   top of each _doRender() tick so streaming DOM growth doesn't jank the
   viewport position.

Tests:
- Updated test_issue1360_streaming_scroll_hardening.py: split the
  overflow-anchor test into desktop (none) and mobile (auto) variants.
- Added test_mobile_scroll_jank.html: interactive visual test that
  simulates the scroll jank on a mobile-sized viewport.
2026-06-24 09:37:55 +03:00
nesquena-hermes
05cf44ffca Merge branch 'peek-4803' into gate/4803-recycle-harden 2026-06-24 06:37:38 +00:00
nesquena-hermes
b9f1491de7 Merge branch 'peek-4798-v2' into gate/4798-v2 2026-06-24 06:25:59 +00:00
luandnh
878001c231 fix: strip @provider: prefix from cron job model override
When a cron job's model/provider override was set via the form, the dropdown
option value could contain a @provider: prefix (e.g. @custom:9router:chat)
from _apply_provider_prefix in the API response. Since cron jobs store model
and provider as separate fields, the model should be just the bare model name
(e.g. chat) without the provider prefix.

- Add _cronModelBareName() helper to strip @provider: prefix
- Apply in saveCronForm for create, update, and duplicate paths
- Update CHANGELOG.md
2026-06-24 05:03:38 +00:00
nesquena-hermes
e9283c8182 fix(#2814): default _kanbanLanesByProfile=true to match server default (Opus note)
The JS module default was false (consolidated) while the server defaults
lane_by_profile=True (lanes). If the board painted before _kanbanApplyConfigDefaults
ran, there'd be a one-frame consolidated flicker before snapping to lanes. Matching
the client default to the server default removes the flicker. Co-authored-by: stefan-wisbric
2026-06-23 23:51:22 +00:00
nesquena-hermes
5253724f90 rebase(#2814): resolve i18n onto current master + add kanban_view_* keys to all 13 locales
Took master's i18n.js as base (it has all 13 locale blocks + had reorganized the
kanban keys, so the stale-branch conflict block would have duplicated them in
zh-Hant), then inserted #2814's 5 kanban_view_* keys into every locale block after
kanban_new_task — real translations for it/ja/zh/zh-Hant/fr (from the PR), English
fallback elsewhere. All 13 locales now have exactly 1 of each key; locale-parity +
kanban tests green (291 passed).
2026-06-23 23:40:45 +00:00
nesquena-hermes
d68afd7862 fix(#4800): key the streaming parse-cache on liveReasoningText too (Codex gate)
The parse-result cache keyed only on assistantText, but _parseStreamState() is a
function of BOTH assistantText AND liveReasoningText. A 'reasoning' SSE event (which
mutates liveReasoningText without calling _scheduleRender) landing between a token's
_scheduleRender(parsed) and the rAF firing made _doRender serve a parsed computed from
the older reasoning -> _renderLiveThinking could show stale thinking text. Keying the
cache on liveReasoningText too forces a fresh _parseStreamState when reasoning changed,
and also makes a canceled-then-rescheduled render miss the stale entry. Co-authored-by: wlknight
2026-06-23 22:52:51 +00:00
Rod Boev
6cf4f7a5d0 test(#4793): decouple recycle reset assertions 2026-06-23 18:49:50 -04:00
nesquena-hermes
1dbff4e708 Merge branch 'peek-4800' into gate/4800-stream-perf 2026-06-23 22:46:14 +00:00
nesquena-hermes
e8b33066ec Merge remote-tracking branch 'origin/master' into stage/rodboev-4797-4796
# Conflicts:
#	CHANGELOG.md
2026-06-23 22:32:36 +00:00
nesquena-hermes
edbe676b0d Merge branch 'peek-4796' into stage/rodboev-4797-4796 2026-06-23 22:19:13 +00:00
nesquena-hermes
e26a6e47c0 Merge branch 'peek-4797' into stage/rodboev-4797-4796 2026-06-23 22:19:12 +00:00
Rod Boev
bad9fd7e2b fix(#4793): harden recycled assistant turns and messages scrollbar drag 2026-06-23 18:14:05 -04:00
wlknight
20a900be60 fix(perf): eliminate O(DOM) streaming render freeze on long agent answers
Introduce _safeSmdRenderer — a renderer wrapper that hooks smd's set_attr
to validate URL schemes inline as each DOM node is created, eliminating
the per-token _sanitizeSmdLinks(assistantBody) full-DOM scan that caused
progressive freezing on answers of 30,000+ chars (5,000+ DOM nodes).

Also add parse-result caching to _scheduleRender to avoid redundant
_extractInlineThinkingFromContent scans between the token event handler
and the rAF render callback.

Changes:
- New _safeSmdRenderer(el): URL scheme safety inline via set_attr hook
  (identical algorithm to proven _streamFadeRenderer.set_attr, no animation)
- _smdNewParser: non-fade path uses _safeSmdRenderer instead of bare
  default_renderer
- _smdWrite: removed _sanitizeSmdLinks(assistantBody) call — safety now
  handled by renderer's set_attr at node-creation time
- _scheduleRender(parsed): accepts optional cached parse result from
  token handler to avoid duplicate O(n) text scans
- Token handler: passes _parseStreamState() result to _scheduleRender

_sanitizeSmdLinks is preserved at _smdEndParser (stream-end safety net)
and in fallback paths where smd is not available.

All 166 existing tests pass.
2026-06-24 06:09:44 +08:00
nesquena-hermes
8e384548c3 fix(#4788): reword a comment apostrophe that tripped test_smooth_text_fade's brace-matcher
test_smooth_text_fade.py::test_preferences_ui_exposes_and_saves_fade_text_effect
extracts loadSettingsPanel() via a brace-matcher that does NOT skip comments. The
new structured-code wiring added a comment containing 'isn't' + ''auto' mode' —
the apostrophes were mis-read as string delimiters, scrambling the brace depth so
the matcher closed the function early (before the fade-checkbox wiring), failing
the test. Reworded to 'is not' / 'auto mode' (zero behavior change; node -c clean).
The fade feature + the structured-code feature are both unchanged. Co-authored-by: metaember
2026-06-23 21:40:08 +00:00
Rod Boev
c3d5d585c2 fix(#4756): keep session refresh compatible with existing picker callers 2026-06-23 17:24:50 -04:00
nesquena-hermes
48663a4af3 Merge branch 'peek-4788' into gate/4788-json-view 2026-06-23 21:19:18 +00:00
Rod Boev
94e25ad494 fix(#4753): notify background desktop tabs without hiding streams 2026-06-23 17:10:03 -04:00
nesquena-hermes
7db3aa123f Merge branch 'peek-4656' into stage/4656-escape-readonly 2026-06-23 20:43:53 +00:00
nesquena-hermes
2d6b3c067f Merge branch 'peek-4781' into stage/4781-worklog-collapse
# Conflicts:
#	CHANGELOG.md
2026-06-23 20:27:38 +00:00
nesquena-hermes
ca368cc166 Merge branch 'peek-4478' into stage/4478-dom-recycle 2026-06-23 20:07:56 +00:00
Charles Bine
dd66640fae
feat(#484): configurable default view for JSON/YAML code blocks
The JSON/YAML tree viewer (#484) hardcoded its default: valid json/yaml
fenced blocks opened in Tree view at 10+ lines (`const showTree=lineCount>=10;`).
Make that default user-configurable while preserving current behavior.

- New settings (persisted via /api/settings -> settings.json):
  - structured_code_default_view: auto | on | off  (default auto)
  - structured_code_auto_tree_lines: int 1..1000    (default 10)
- ui.js: replace the hardcode with a sanitized, unit-testable decision
  helper _structuredCodeShowTree(mode, threshold, lineCount); Tree/Raw
  toggle, Raw <pre><code>, parse-failure fallback, and YAML lazy-load
  are unchanged.
- Appearance settings: 'JSON/YAML code blocks' select + 'Auto threshold
  lines' input (disabled outside auto mode); wired through the existing
  appearance-autosave and explicit-save paths; live re-render on change.
- boot.js seeds window globals; i18n labels added to all 13 locales.
- Default (auto + 10) reproduces the original >=10 behavior exactly.
2026-06-23 13:51:45 -04:00
nesquena-hermes
a7eb7de83f Merge remote-tracking branch 'origin/master' into peek-4748
# Conflicts:
#	CHANGELOG.md
2026-06-23 17:43:38 +00:00
Rod Boev
e5aa548d67 fix(#4756): refresh stale model catalogs on session visit 2026-06-23 12:50:28 -04:00
nesquena-hermes
98e672551a Merge branch 'peek-4782' into gate/4782-sidebar-trim 2026-06-23 16:46:10 +00:00
nesquena-hermes
29ceed3a72 fix(#4778): gate deferred rAF re-restore on still-unpinned (Opus gate)
Opus caught a narrow timing race: if a reader re-pins between the scroll-rebuild
guard engaging and its deferred rAF firing, the stale re-restore would yank them
back off the bottom. Gate the re-restore on _messageUserUnpinned at rAF time; the
minHeight release still always runs. Normal single-render unpinned case unaffected.
2026-06-23 16:19:50 +00:00
Rod Boev
2504eb90d7 fix(#4755): honor profile default workspace on fresh sessions 2026-06-23 12:18:44 -04:00
nesquena-hermes
f4af6d8419 fix(#4778): scroll-rebuild guard must not reclassify a pinned follower as unpinned
Codex regression gate caught: the guard predicate keyed on a raw messagesEl.scrollTop>0,
so a pinned reader transiently at bottomDistance>250 mid-render (assistant body grows
before the anchor scene re-renders) got flipped to _messageUserUnpinned=true/_scrollPinned=false
and lost auto-follow. Require an explicit non-follow signal (_messageUserUnpinned || _scrollPinned===false)
instead. Updated the existing guard test to a genuine unpinned reader + added a pinned-large-growth
regression. Co-authored-by: franksong2702
2026-06-23 16:17:01 +00:00
nesquena-hermes
c6d633fd2c Merge branch 'peek-4777' into stage/livestream-chat-scroll-4778-4777-4780
# Conflicts:
#	CHANGELOG.md
2026-06-23 16:09:00 +00:00
nesquena-hermes
a349b0b7e8 Merge branch 'peek-4780' into stage/livestream-chat-scroll-4778-4777-4780 2026-06-23 16:08:31 +00:00
Frank Song
f653b1b8d9 feat: allow live worklog summary collapse 2026-06-23 23:22:16 +08:00
Hermes Agent
ba6349bdcb fix: reset scroll state on session switch to prevent stale unpin blocking scroll-to-bottom 2026-06-23 17:19:50 +02:00