Skip to content

Commit 3d201a2

Browse files
jack-kerouacclaude
andcommitted
Separate index button from page nav with divider and disable Next on index
The index page is conceptually separate from the transcript pages, so Prev/Next should not navigate between them. Disable the Next button on the index page and add a vertical separator between the Index button and the page navigation controls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 49ab3ef commit 3d201a2

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

src/claude_code_transcripts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ def render_message(log_type, message_json, timestamp):
10621062
.pagination a:hover { background: var(--user-bg); }
10631063
.pagination .current { background: var(--user-border); color: white; }
10641064
.pagination .disabled { color: var(--text-muted); border: 1px solid #ddd; }
1065+
.pagination .pagination-sep { width: 1px; padding: 0; margin: 0 4px; background: #ccc; }
10651066
details.continuation { margin-bottom: 16px; }
10661067
details.continuation summary { cursor: pointer; padding: 12px 16px; background: var(--user-bg); border-left: 4px solid var(--user-border); border-radius: 12px; font-weight: 500; color: var(--text-muted); }
10671068
details.continuation summary:hover { background: rgba(25, 118, 210, 0.15); }

src/claude_code_transcripts/templates/macros.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{%- else %}
66
<div class="pagination">
77
<a href="index.html">Index</a>
8+
<span class="pagination-sep"></span>
89
{% if current_page > 1 -%}
910
<a href="page-{{ '%03d'|format(current_page - 1) }}.html">&larr; Prev</a>
1011
{%- else -%}
@@ -33,15 +34,12 @@
3334
{%- else %}
3435
<div class="pagination">
3536
<span class="current">Index</span>
37+
<span class="pagination-sep"></span>
3638
<span class="disabled">&larr; Prev</span>
3739
{% for page in range(1, total_pages + 1) -%}
3840
<a href="page-{{ '%03d'|format(page) }}.html">{{ page }}</a>
3941
{% endfor -%}
40-
{% if total_pages >= 1 -%}
41-
<a href="page-001.html">Next &rarr;</a>
42-
{%- else -%}
4342
<span class="disabled">Next &rarr;</span>
44-
{%- endif %}
4543
</div>
4644
{%- endif %}
4745
{% endmacro %}

tests/__snapshots__/test_generate_html/TestGenerateHtml.test_generates_index_html.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
.pagination a:hover { background: var(--user-bg); }
9696
.pagination .current { background: var(--user-border); color: white; }
9797
.pagination .disabled { color: var(--text-muted); border: 1px solid #ddd; }
98+
.pagination .pagination-sep { width: 1px; padding: 0; margin: 0 4px; background: #ccc; }
9899
details.continuation { margin-bottom: 16px; }
99100
details.continuation summary { cursor: pointer; padding: 12px 16px; background: var(--user-bg); border-left: 4px solid var(--user-border); border-radius: 12px; font-weight: 500; color: var(--text-muted); }
100101
details.continuation summary:hover { background: rgba(25, 118, 210, 0.15); }
@@ -157,10 +158,11 @@ <h1>Claude Code transcript</h1>
157158

158159
<div class="pagination">
159160
<span class="current">Index</span>
161+
<span class="pagination-sep"></span>
160162
<span class="disabled">&larr; Prev</span>
161163
<a href="page-001.html">1</a>
162164
<a href="page-002.html">2</a>
163-
<a href="page-001.html">Next &rarr;</a>
165+
<span class="disabled">Next &rarr;</span>
164166
</div>
165167

166168
<p style="color: var(--text-muted); margin-bottom: 24px;">5 prompts · 33 messages · 12 tool calls · 2 commits · 2 pages</p>
@@ -179,10 +181,11 @@ <h1>Claude Code transcript</h1>
179181

180182
<div class="pagination">
181183
<span class="current">Index</span>
184+
<span class="pagination-sep"></span>
182185
<span class="disabled">&larr; Prev</span>
183186
<a href="page-001.html">1</a>
184187
<a href="page-002.html">2</a>
185-
<a href="page-001.html">Next &rarr;</a>
188+
<span class="disabled">Next &rarr;</span>
186189
</div>
187190

188191

tests/__snapshots__/test_generate_html/TestGenerateHtml.test_generates_page_001_html.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
.pagination a:hover { background: var(--user-bg); }
9696
.pagination .current { background: var(--user-border); color: white; }
9797
.pagination .disabled { color: var(--text-muted); border: 1px solid #ddd; }
98+
.pagination .pagination-sep { width: 1px; padding: 0; margin: 0 4px; background: #ccc; }
9899
details.continuation { margin-bottom: 16px; }
99100
details.continuation summary { cursor: pointer; padding: 12px 16px; background: var(--user-bg); border-left: 4px solid var(--user-border); border-radius: 12px; font-weight: 500; color: var(--text-muted); }
100101
details.continuation summary:hover { background: rgba(25, 118, 210, 0.15); }
@@ -149,6 +150,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
149150

150151
<div class="pagination">
151152
<a href="index.html">Index</a>
153+
<span class="pagination-sep"></span>
152154
<span class="disabled">&larr; Prev</span>
153155
<span class="current">1</span>
154156
<a href="page-002.html">2</a>
@@ -283,6 +285,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
283285

284286
<div class="pagination">
285287
<a href="index.html">Index</a>
288+
<span class="pagination-sep"></span>
286289
<span class="disabled">&larr; Prev</span>
287290
<span class="current">1</span>
288291
<a href="page-002.html">2</a>

tests/__snapshots__/test_generate_html/TestGenerateHtml.test_generates_page_002_html.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
.pagination a:hover { background: var(--user-bg); }
9696
.pagination .current { background: var(--user-border); color: white; }
9797
.pagination .disabled { color: var(--text-muted); border: 1px solid #ddd; }
98+
.pagination .pagination-sep { width: 1px; padding: 0; margin: 0 4px; background: #ccc; }
9899
details.continuation { margin-bottom: 16px; }
99100
details.continuation summary { cursor: pointer; padding: 12px 16px; background: var(--user-bg); border-left: 4px solid var(--user-border); border-radius: 12px; font-weight: 500; color: var(--text-muted); }
100101
details.continuation summary:hover { background: rgba(25, 118, 210, 0.15); }
@@ -149,6 +150,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
149150

150151
<div class="pagination">
151152
<a href="index.html">Index</a>
153+
<span class="pagination-sep"></span>
152154
<a href="page-001.html">&larr; Prev</a>
153155
<a href="page-001.html">1</a>
154156
<span class="current">2</span>
@@ -180,6 +182,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
180182

181183
<div class="pagination">
182184
<a href="index.html">Index</a>
185+
<span class="pagination-sep"></span>
183186
<a href="page-001.html">&larr; Prev</a>
184187
<a href="page-001.html">1</a>
185188
<span class="current">2</span>

tests/__snapshots__/test_generate_html/TestParseSessionFile.test_jsonl_generates_html.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
.pagination a:hover { background: var(--user-bg); }
9696
.pagination .current { background: var(--user-border); color: white; }
9797
.pagination .disabled { color: var(--text-muted); border: 1px solid #ddd; }
98+
.pagination .pagination-sep { width: 1px; padding: 0; margin: 0 4px; background: #ccc; }
9899
details.continuation { margin-bottom: 16px; }
99100
details.continuation summary { cursor: pointer; padding: 12px 16px; background: var(--user-bg); border-left: 4px solid var(--user-border); border-radius: 12px; font-weight: 500; color: var(--text-muted); }
100101
details.continuation summary:hover { background: rgba(25, 118, 210, 0.15); }
@@ -157,9 +158,10 @@ <h1>Claude Code transcript</h1>
157158

158159
<div class="pagination">
159160
<span class="current">Index</span>
161+
<span class="pagination-sep"></span>
160162
<span class="disabled">&larr; Prev</span>
161163
<a href="page-001.html">1</a>
162-
<a href="page-001.html">Next &rarr;</a>
164+
<span class="disabled">Next &rarr;</span>
163165
</div>
164166

165167
<p style="color: var(--text-muted); margin-bottom: 24px;">2 prompts · 7 messages · 2 tool calls · 1 commits · 1 pages</p>
@@ -171,9 +173,10 @@ <h1>Claude Code transcript</h1>
171173

172174
<div class="pagination">
173175
<span class="current">Index</span>
176+
<span class="pagination-sep"></span>
174177
<span class="disabled">&larr; Prev</span>
175178
<a href="page-001.html">1</a>
176-
<a href="page-001.html">Next &rarr;</a>
179+
<span class="disabled">Next &rarr;</span>
177180
</div>
178181

179182

tests/test_generate_html.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,24 @@ def test_index_link_not_highlighted_on_transcript_pages(self, output_dir):
9494
# The index link should NOT be styled like the active/current page
9595
assert "index-link" not in page_html
9696

97+
def test_index_page_has_disabled_next_button(self, output_dir):
98+
"""On the index page, Next should be disabled since index is separate from transcript pages."""
99+
fixture_path = Path(__file__).parent / "sample_session.json"
100+
generate_html(fixture_path, output_dir, github_repo="example/project")
101+
102+
index_html = (output_dir / "index.html").read_text(encoding="utf-8")
103+
assert 'Next &rarr;</a>' not in index_html
104+
assert 'Next &rarr;</span>' in index_html
105+
106+
def test_pagination_has_separator_between_index_and_pages(self, output_dir):
107+
"""A visual separator should exist between the Index button and the page nav buttons."""
108+
fixture_path = Path(__file__).parent / "sample_session.json"
109+
generate_html(fixture_path, output_dir, github_repo="example/project")
110+
111+
for filename in ("index.html", "page-001.html"):
112+
html = (output_dir / filename).read_text(encoding="utf-8")
113+
assert "pagination-sep" in html
114+
97115
def test_github_repo_autodetect(self, sample_session):
98116
"""Test GitHub repo auto-detection from git push output."""
99117
loglines = sample_session["loglines"]

0 commit comments

Comments
 (0)