fix: persist compact activity disclosure state#1729
fix: persist compact activity disclosure state#1729Michaelyklam wants to merge 1 commit intonesquena:masterfrom
Conversation
SummaryPulled the branch and read the full diff against master. The persistence shape here is right — There is one thing to flag, though. Merge collision with #1725
Reading group.innerHTML=`<button type="button" class="tool-call-group-summary" aria-expanded="${collapsed?'false':'true'}" onclick="_toggleActivityGroup(this)"><span class="tool-call-group-chevron">${li('chevron-right',12)}</span><span class="tool-call-group-label">Activity</span><span class="tool-call-group-list">tools / thinking</span><span class="tool-call-group-duration"></span><span class="tool-call-group-count">0</span></button><div class="tool-call-group-body"></div>`;vs Code referenceThe persistence path on const _activityDisclosureStoragePrefix='hermes-activity-disclosure:';
function _activityDisclosureStorageKey(activityKey){
if(!activityKey||!S.session||!S.session.session_id) return null;
return _activityDisclosureStoragePrefix+S.session.session_id+':'+activityKey;
}
function _readActivityDisclosureState(activityKey){
const key=_activityDisclosureStorageKey(activityKey);
if(!key) return null;
try{
const saved=localStorage.getItem(key);
return saved==='open'||saved==='closed'?saved:null;
}catch(_){return null;}
}And the live-to-settled transfer in if(typeof _copyActivityDisclosureState==='function'&&lastAsst){
const assistantIdx=S.messages.indexOf(lastAsst);
if(assistantIdx>=0) _copyActivityDisclosureState('live:'+streamId, 'assistant:'+assistantIdx);
}DiagnosisTwo minor observations beyond the #1725 collision:
VerificationThe static source-shape tests in Recommendation: rebase against #1725 once one of the two lands (this PR or that one); the persistence logic and the summary cleanup are independent and should not need any logic changes when reconciled — only the template literal and the contents of |
|
Thanks @Michaelyklam — this shipped in v0.51.8 (commit GitHub didn't auto-close because the merge commit only references the squash-merged stage branch, not your fork's commit directly — closing manually for hygiene. Live now on https://get-hermes.ai/ and on existing installs after Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.8 |
…p + test-isolation fix Constituent PRs: - nesquena#1725 (@Michaelyklam) — simplify compact Activity row summary - nesquena#1726 (@Michaelyklam) — delegate generic provider catalogs to Hermes CLI (slice of nesquena#1240) - nesquena#1727 (@Michaelyklam) — link Claude Code OAuth in onboarding (closes nesquena#1362) - nesquena#1728 (@starship-s) — preserve profile context when starting chats - nesquena#1729 (@Michaelyklam) — persist compact Activity disclosure state - nesquena#1730 (@Michaelyklam) — prevent sticky sidebar hover drag state - nesquena#1732 (@Sanjays2402) — unpin scroll on small upward motion during streaming (closes nesquena#1731) Plus 2 in-stage absorbed fixes: - test-isolation fix: monkeypatch.setattr(config, 'cfg', X) survives PR nesquena#1728's path/mtime-aware get_config() reload. Mandatory before tag (Opus stage-302). - Opus SHOULD-FIX #1: _lastScrollTop reset on session switch (nesquena#1732 follow-up). Tests: 4537 → 4584 passing (+47). 0 regressions. Full suite ~128s. Stably green. Pre-release verification: - All 7 PRs CI-green individually + rebased onto master - pytest 4584 passed, 0 failed (multiple runs) - node -c clean on all 4 modified .js files - 11/11 browser API endpoints PASS on isolated port 8789 - 20 QA tests via webui_qa_agent.sh PASS - Opus advisor: SHIP, 5/5 verification clean, 0 MUST-FIX, 1 SHOULD-FIX absorbed (_lastScrollTop reset), 1 SHOULD-FIX deferred (nesquena#1736 — _clear_anthropic_env_values race, onboarding-time-only) Closes nesquena#1362, nesquena#1731.
Thinking Path
What Changed
static/ui.jsusinghermes-activity-disclosure:<session_id>:<turn_key>localStorage keys._toggleActivityGroup()so each toggle updates ARIA, the existing live expand-intent tracker, and persisted state together.assistant:<message_index>and live Activity groups aslive:<stream_id>.DESIGN.md.docs/pr-media/activity-disclosure/.Why It Matters
Users can collapse or expand compact Activity once, switch to another chat, and return without the Activity row snapping back to the wrong mode. This removes a small but annoying transcript-state reset while preserving the compact default and existing progressive-disclosure behavior.
UI media
Persisted collapsed state after re-render:
Explicitly expanded Activity row:
Verification
Manual browser verification:
127.0.0.1:18793with a temporary state dir.assistant:1.localStorage['hermes-activity-disclosure:s-persist:assistant:1'] === 'open'.closed.Risks / Follow-ups
Model Used
AI assisted.
gpt-5.5