co-mono/packages/coding-agent/src/core/export-html
Li Yang 1675824ed3
Add active path highlighting in html exports (#929)
* fix(coding-agent): HTML export sidebar click scrolls instead of truncating branch

Previously, clicking a message in the sidebar tree would set that message
as the new leaf, causing getPath() to only return messages up to that point
and hiding all messages below it.

Now handleTreeNodeClick() checks if the clicked entry is on the current path:
- If yes: just scrolls to it without re-rendering
- If no: finds the actual leaf of that branch and navigates to it, then
  scrolls to the clicked message

Added childrenMap for parent->children lookup and findBranchLeaf() to
traverse down to a branch's leaf.

* fix(coding-agent): HTML export sidebar click scrolls instead of truncating branch

Previously, clicking a message in the sidebar tree would set that message
as the new leaf, causing getPath() to only return messages up to that point
and hiding all messages below it.

Now handleTreeNodeClick() checks if the clicked entry is on the current path:
- If yes: scrolls to it and updates the active marker
- If no: finds the branch's leaf, navigates to it, then scrolls to clicked message

Adds currentTargetId to track the selected entry separately from currentLeafId
(which branch to display), so the active marker follows user selection.

* most recent path wins

* reuse method

* revert

* feat(coding-agent): highlight active path in HTML export sidebar

- Add subtle accent background tint to in-path nodes
- Dim off-path nodes to 50% opacity (restore on hover)
- Makes current branch visually distinct in tree navigation

* docs(coding-agent): move changelog entry to Unreleased and add attribution

* chore(coding-agent): remove dead code and fix changelog attribution

- Remove unused childrenMap, findBranchLeaf, handleTreeNodeClick, scrollToEntry
- Split changelog entry: navigation (#853 by @mitsuhiko), highlighting (#929 by @hewliyang)
2026-01-25 19:25:44 +01:00
..
vendor WIP: Rewrite export-html with tree sidebar, client-side rendering 2026-01-01 03:36:47 +01:00
ansi-to-html.ts feat(coding-agent): Custom tool export rendering in export (#702) 2026-01-16 00:32:31 +01:00
index.ts Finalize OpenAI Codex compatibility (#737) 2026-01-16 00:58:36 +01:00
template.css Add active path highlighting in html exports (#929) 2026-01-25 19:25:44 +01:00
template.html Refactor export-html and add /share command 2026-01-01 21:13:40 +01:00
template.js Add active path highlighting in html exports (#929) 2026-01-25 19:25:44 +01:00
tool-renderer.ts feat(coding-agent): Custom tool export rendering in export (#702) 2026-01-16 00:32:31 +01:00