You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(Claude) Read the page filter's toggles and counts from the timeline's map - #398
The transcript page and the timeline each kept their own copy of which message types a filter toggle covers. transcript.html spelled out "Tool" → tool_use + tool_result and "User" → user + bash-input + bash-output in three places:
applyFilter(), which decides which cards are hidden;
updateMessageCounts() and updateVisibleCounts(), which write the counts on the toggles.
The timeline used its TOGGLE_GROUPS map. The copies agreed only because they had been kept in step by hand.
All three now go through the timeline's map, which the page exposes as window.timelineToggleGroups (since #392):
applyFilter() expands each active toggle through it.
The counts build each toggle's selector through it (toggleCardSelector()), so all eight toggles are counted the same way and the User and Tool special cases are gone.
The map stays in components/timeline.html. Every page that runs the filter includes that component, in both themes, and its script runs before the filter's. If the map is ever missing, the filter fails visibly rather than filtering with a stale copy.
Tests. Two new browser tests, each in both themes. Both open the page with the map rewritten as the page exports it: tool_result moves from the Tool toggle to the Assistant toggle. Then:
test_page_filter_expands_toggles_through_the_timelines_map turns Assistant off and checks that every timeline item is shown exactly when its card is. On the previous code the page still showed the tool_result cards that the timeline hid.
test_toggle_counts_follow_the_timelines_map checks each toggle's label against the cards the map gives it: "(total)" on load, and "(visible/total)" once Assistant is off. On the previous code Tool still counted the tool_result cards and Assistant did not.
Each test also checks that the rewrite reached the page, and that the fixture and the comparison are not empty, so neither can pass by checking nothing.
Snapshots. 12 transcript blocks, 9 classic and 3 minimal, each change by the same +26/−97 lines, all inside <script>. The 4 index and archive-search blocks have no filter and are unchanged. No message markup changes.
The page filter and the timeline each keep a copy of which message types
a filter toggle covers. The new browser test rewrites the map the page
exports (tool_result moves from the Tool toggle to the Assistant
toggle) before either side reads it, turns Assistant off, and checks
that every timeline item is shown exactly when its card is. While the
page filter keeps its own copy it still shows the tool_result cards the
timeline hides, so the test fails, in both themes.
The test also checks that the rewrite reached the page, that the
fixture has top-level tool_result cards, and that the comparison
covered both tool groups, so it cannot pass by comparing nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
applyFilter() spelled out its own copy of which message types the Tool
and User toggles cover, beside the TOGGLE_GROUPS map the timeline
filters its groups by. It now expands each active toggle through that
map, read off the page as window.timelineToggleGroups, so the
transcript and the timeline cannot disagree about a toggle. The
timeline component is included by every page that runs applyFilter(),
in both themes, and its script runs first, so the map stays where it
is.
The embedded script changes on every transcript page, classic and
minimal: in the snapshots, 12 blocks each change by the same +11/-16
lines, all inside <script>; the 4 index and archive-search blocks, which
have no page filter, are unchanged. No message markup changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The counts on the User and Tool toggles still pick their cards with
selectors of their own. The new browser test opens the page with the
same rewritten map as the filter test (tool_result moved from the Tool
toggle to the Assistant toggle) and checks each toggle's label against
the cards the map gives it: "(total)" when the page loads, and
"(visible/total)" once Assistant is turned off. With the selectors of
their own, Tool still counts the tool_result cards and Assistant does
not, so the test fails, in both themes.
The filter test's setup moves into a helper the two tests share.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
updateMessageCounts() and updateVisibleCounts() counted the User and
Tool toggles with selectors of their own, the same copy of the toggle
map that applyFilter() had. Both now build each toggle's selector
through window.timelineToggleGroups (a toggleCardSelector() helper) and
treat all eight toggles alike, so the User and Tool special cases go,
and so does the last copy of the map in the page.
In the snapshots, the same 12 transcript blocks (9 classic, 3 minimal)
each change by +15/-81 lines, all inside <script>; the 4 index and
archive-search blocks are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Assistant off, the tool_result cards the rewritten map moves under
Assistant are hidden whichever map the visible count reads, so the
count test could not tell a visible count that bypassed the map. The
test now also turns Assistant back on and Tool off, where those cards
are shown, and checks the counts again: Tool must read "(0/n)" over the
tool_use cards alone, and Assistant its full total.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The transcript now uses the timeline’s exported toggle map for filter expansion and message counts. Browser tests modify the map and check filtering and count behavior in both themes.
Changes: Transcript and timeline filter parity
Layer / File(s)
Summary
Use the timeline map for filtering and counts claude_code_log/html/templates/components/timeline.html, claude_code_log/html/templates/transcript.html
The transcript uses window.timelineToggleGroups to expand active filters and select message cards for initial, total, and visible counts.
Verify filtering and counts with a changed map test/test_timeline_browser.py
Browser tests change the exported map and check card visibility against timeline items and toggle counts in both themes.
daaain/claude-code-log#392 — PR #392 exports window.timelineToggleGroups, which this PR uses for transcript filtering and counts.
Suggested reviewers:daaain
Pre-merge checks: 4 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
[#395] The transcript filter and counts use the timeline toggle map. The PR reports that both themes include the timeline component before the filter script and that snapshot changes stay inside scrip…
Provide results for test/test_minimal_parity_browser.py and the timeline tests at the reviewed head.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly describes the change to use the timeline map for page filtering and toggle counts.
Out of Scope Changes check
[#395] The shared-map changes, timeline comment, browser tests, and reported script-only snapshot updates support filter and timeline parity. No unrelated change is identified.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)
Full details: Linked Issues check
Explanation
[#395] The transcript filter and counts use the timeline toggle map. The PR reports that both themes include the timeline component before the filter script and that snapshot changes stay inside script blocks. New browser tests cover map-driven filtering and counts in both themes. The supplied evidence does not establish that the existing parity sweep and timeline tests pass.
Resolution
Provide results for test/test_minimal_parity_browser.py and the timeline tests at the reviewed head.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Review coverage is incomplete: 1 file could not be fully reviewed. Findings from completed review steps are included; see review info for details.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
claude_code_log/html/templates/transcript.html: 1
744-744: Trivial · Maintainability & Code Quality · Low value
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Guideline check: keep the toggle type list in renderer.py parity.
The messageTypes list is duplicated at Lines 744 and 827. Both now include user and tool. Per the path instructions, confirm that the timeline and the filter treat each message type consistently. Consider extracting one shared constant for this list.
Also applies to: 827-827
Source: Coding guidelines
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 071e495f-8d72-408f-93c7-50beeb88b980
Commits
Reviewing files that changed from the base of the PR and between 88426a3 and b4a5622.
Files not fully reviewed because their changes were unavailable: 1
test/snapshots/test_snapshot_html.ambr
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The transcript page and the timeline each kept their own copy of which message types a filter toggle covers.
transcript.htmlspelled out "Tool" →tool_use+tool_resultand "User" →user+bash-input+bash-outputin three places:applyFilter(), which decides which cards are hidden;updateMessageCounts()andupdateVisibleCounts(), which write the counts on the toggles.The timeline used its
TOGGLE_GROUPSmap. The copies agreed only because they had been kept in step by hand.All three now go through the timeline's map, which the page exposes as
window.timelineToggleGroups(since #392):applyFilter()expands each active toggle through it.toggleCardSelector()), so all eight toggles are counted the same way and the User and Tool special cases are gone.The map stays in
components/timeline.html. Every page that runs the filter includes that component, in both themes, and its script runs before the filter's. If the map is ever missing, the filter fails visibly rather than filtering with a stale copy.Tests. Two new browser tests, each in both themes. Both open the page with the map rewritten as the page exports it:
tool_resultmoves from the Tool toggle to the Assistant toggle. Then:test_page_filter_expands_toggles_through_the_timelines_mapturns Assistant off and checks that every timeline item is shown exactly when its card is. On the previous code the page still showed thetool_resultcards that the timeline hid.test_toggle_counts_follow_the_timelines_mapchecks each toggle's label against the cards the map gives it: "(total)" on load, and "(visible/total)" once Assistant is off. On the previous code Tool still counted thetool_resultcards and Assistant did not.Each test also checks that the rewrite reached the page, and that the fixture and the comparison are not empty, so neither can pass by checking nothing.
Snapshots. 12 transcript blocks, 9 classic and 3 minimal, each change by the same +26/−97 lines, all inside
<script>. The 4 index and archive-search blocks have no filter and are unchanged. No message markup changes.Closes #395
🤖 Generated with Claude Code
Summary by CodeRabbit