Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
58d542b
Add code viewer with git blame-style annotations
btucker Dec 27, 2025
1959dec
Fix JSON escaping in code viewer to prevent script injection
btucker Dec 27, 2025
d076aaf
Simplify code viewer to diff-only mode
btucker Dec 27, 2025
a27d922
Add progress indicator for large page rendering
btucker Dec 27, 2025
53cfbf7
Add three-pane code viewer with git-based blame and full transcript
btucker Dec 28, 2025
1f1c9ae
Simplify file detection with per-file git repo lookup
btucker Dec 28, 2025
4e78390
Add chunked rendering for transcript pane performance
btucker Dec 28, 2025
aecc019
Skip blame highlighting for pre-existing content
btucker Dec 28, 2025
d2404e8
Add overflow hidden to index item containers
btucker Dec 28, 2025
c2cfa01
Fix truncation for dynamically rendered messages
btucker Dec 28, 2025
c571051
Fix blame highlighting to only color actually changed lines
btucker Dec 28, 2025
183c9fa
Add tests for git-based blame attribution
btucker Dec 28, 2025
1592307
Add scrollbar minimap showing blame range locations
btucker Dec 28, 2025
ff535c6
currently non-functional codemirror state
btucker Dec 28, 2025
617ae5e
Extract code_view.py module from __init__.py
btucker Dec 28, 2025
13d5516
Apply DRY refactorings: CSS template, helpers for grouping and colors
btucker Dec 28, 2025
e44272e
Fix JSON escaping for script tag embedding
btucker Dec 28, 2025
a01b324
resolved issue when reconstructing file state from edit operations, i…
btucker Dec 28, 2025
97e5a00
include the prompt number in the code view
btucker Dec 28, 2025
5e2aa58
handling continuation messages properly
btucker Dec 28, 2025
11882a0
update readme
btucker Dec 28, 2025
e860505
Fix blame highlighting and strip common prefix from file tree
btucker Dec 28, 2025
e0a280c
Handle empty git repo in get_file_content_from_repo
btucker Dec 28, 2025
ca2bc04
Extract originalFile from tool results for remote session support
btucker Dec 28, 2025
a86705f
Fix JSONL parsing to preserve toolUseResult for remote sessions
btucker Dec 28, 2025
7ebad63
Add test for JSONL parsing preserving toolUseResult
btucker Dec 28, 2025
75b01da
Treat skill expansions (isMeta) as continuations for prompt numbering
btucker Dec 28, 2025
bf60b03
Add test for isMeta field preservation in JSONL parsing
btucker Dec 28, 2025
75c7035
Assign blame colors by prompt number, not by operation
btucker Dec 29, 2025
f0bf40d
Show assistant context in code viewer tooltips
btucker Dec 29, 2025
45bf3ac
Include thinking blocks in code viewer tooltips
btucker Dec 29, 2025
66a8fad
Fix thinking block persistence across messages in tooltips
btucker Dec 29, 2025
6386951
Add test coverage for build_msg_to_user_html tooltip generation
btucker Dec 29, 2025
0f6dd5b
Accumulate tooltip context blocks across messages
btucker Dec 29, 2025
c30d2c9
Keep only most recent thinking and text blocks in tooltips
btucker Dec 29, 2025
f210d2c
Color blame sections by assistant context message ID
btucker Dec 29, 2025
155f5c4
Fix edit resync using original_content when reconstruction diverges
btucker Dec 29, 2025
f63140b
Add transcript-to-code navigation and improve tooltip rendering
btucker Dec 29, 2025
2ce7e59
Add end-to-end tests for code view using Playwright
btucker Dec 29, 2025
8f034e5
Support local file:// access and add shared search header
btucker Dec 29, 2025
3fe65da
Externalize CSS and JS to reduce HTML file sizes
btucker Dec 29, 2025
bdb2521
Exclude code-data.json from gist to reduce API truncation
btucker Dec 29, 2025
7d89b20
Add two-gist strategy for large files to avoid API truncation
btucker Dec 29, 2025
9d95c00
Document two-gist strategy for large sessions in README
btucker Dec 29, 2025
a644582
Consolidate templates: move header into base.html, rename code_view.html
btucker Dec 29, 2025
103c8fb
Hide minimap when code doesn't need scrolling
btucker Dec 29, 2025
7503cf3
Add e2e tests for minimap visibility behavior
btucker Dec 29, 2025
a8c5fe2
Revert external CSS/JS to inline - simplifies with two-gist strategy
btucker Dec 29, 2025
1272af8
Escape style/script tags in markdown to prevent CSS injection
btucker Dec 29, 2025
afeaf02
Use nh3 HTML sanitizer for proper XSS protection in markdown
btucker Dec 29, 2025
d541b70
Fix JavaScript syntax error from HTML closing tags in embedded JSON
btucker Dec 29, 2025
890c5e1
Fix HTML comment sequences breaking embedded JSON parsing
btucker Dec 29, 2025
f741792
Add line anchor deep-linking support for code view
btucker Dec 29, 2025
c42734f
Add loading indicators for code view initialization and file switching
btucker Dec 29, 2025
1967b3b
Improve loading indicators and skip pinned updates during scrolling
btucker Dec 29, 2025
5d50a85
Always show loading indicator when switching files
btucker Dec 29, 2025
38dc582
Filter deleted files using git repo instead of pre-filtering
btucker Dec 29, 2025
4f2e249
Add failing test for relative paths in rm commands
btucker Dec 29, 2025
fb99c6d
Fix ValueError when rm commands use relative paths
btucker Dec 29, 2025
c2682b8
Add failing tests for filter_deleted_files function
btucker Dec 29, 2025
4e89ea4
Add --exclude-deleted-files flag for code viewer
btucker Dec 29, 2025
3e1a2ed
Document --exclude-deleted-files flag in README
btucker Dec 29, 2025
3f42ce4
Handle large sessions by splitting page data into separate JSON files
btucker Dec 29, 2025
7e86821
remove PR.md
btucker Dec 29, 2025
8c39fc0
Add batched gist uploads and descriptive gist names
btucker Dec 29, 2025
940f423
Add index-data.json for large session index content
btucker Dec 29, 2025
df4e7dc
Use templates to exclude content from HTML in large sessions
btucker Dec 29, 2025
151361f
Include content in HTML for local viewing, strip for gist upload
btucker Dec 29, 2025
0126082
Fix gist upload: add files one at a time instead of batching
btucker Dec 29, 2025
2622e65
Add retry logic and delays for gist file uploads
btucker Dec 29, 2025
628d818
Remove vestigial batching code from gist upload
btucker Dec 29, 2025
02ea004
Because of limitations in gistpreview we have to do some backflips to…
btucker Dec 29, 2025
01a2879
we don't need the fancy css/js loading if it's a small session on gis…
btucker Dec 30, 2025
14f31e3
Fix code view performance: don't auto-scroll transcript
btucker Dec 30, 2025
8034b65
Pre-compute prompt_num and color_index server-side for blame ranges
btucker Dec 30, 2025
6f25b95
Fix clicking blame blocks to scroll transcript to corresponding message
btucker Dec 30, 2025
66f5803
Implement windowed transcript rendering with teleportation
btucker Dec 30, 2025
d1e51f5
Add prompt numbers to user messages and improve pinned header behavior
btucker Dec 30, 2025
8c5f75b
Fix pinned user message flashing when overlapping next prompt
btucker Dec 30, 2025
d08694e
Move prompt number to pinned message label
btucker Dec 30, 2025
f7f93d9
Fix teleport to always render up to target message
btucker Dec 30, 2025
e35fe6c
Fix URL fragment navigation and use bright yellow highlight
btucker Dec 30, 2025
da3972a
Use consistent yellow highlight and skip initial blame highlight
btucker Dec 30, 2025
b7b39b1
Add progress output for code view generation
btucker Dec 30, 2025
ef27068
Clear progress line when switching phases
btucker Dec 30, 2025
ea2d6e6
Change user message heading to "User Prompt #X"
btucker Dec 30, 2025
5aba4e2
Fix prompt number mismatch between tooltip and pinned header
btucker Dec 30, 2025
e0978eb
Fix prompt number counting and pinned click after teleportation
btucker Dec 30, 2025
5114ad8
Use server-provided prompt_num instead of client-side counting
btucker Dec 30, 2025
b73dcf3
Compute all user prompt numbering at build
btucker Dec 30, 2025
607ce99
Code quality improvements to code_view.py
btucker Dec 30, 2025
cb3fe47
Merge upstream/main and adopt URL handling
btucker Dec 30, 2025
58f92a1
Switch from gistpreview to gisthost with simplified JS
claude Dec 31, 2025
c8e8bac
Remove two-gist strategy and page-data JSON generation
claude Dec 31, 2025
e439e24
Merge pull request #1 from btucker/claude/code-viewer-feature-l90XI
btucker Jan 1, 2026
5551046
Merge upstream/main and refactor rewriteLinks per review
btucker Jan 5, 2026
fe10082
Refactor: DRY up generate_html functions
btucker Jan 5, 2026
f3903e1
Merge origin/feat/code-viewer with local changes
btucker Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ claude-code-transcripts json session.json --gist
This will output something like:
```
Gist: https://gist.github.com/username/abc123def456
Preview: https://gistpreview.github.io/?abc123def456/index.html
Preview: https://gisthost.github.io/?abc123def456/index.html
Files: /var/folders/.../session-id
```

The preview URL uses [gistpreview.github.io](https://gistpreview.github.io/) to render your HTML gist. The tool automatically injects JavaScript to fix relative links when served through gistpreview.
The preview URL uses [gisthost.github.io](https://gisthost.github.io/) to render your HTML gist. The tool automatically injects JavaScript to fix relative links when served through gisthost (also works with gistpreview.github.io for backward compatibility).

**Large sessions:** GitHub's gist API has size limits (~1MB). For large sessions, the tool automatically handles this:

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"gitpython",
"httpx",
"jinja2",
"markdown @ file:///Users/btucker/projects/python-markdown",
"markdown",
"nh3>=0.3.2",
"questionary",
]
Expand Down
133 changes: 69 additions & 64 deletions src/claude_code_transcripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,72 +1030,75 @@ def render_message(log_type, message_json, timestamp, prompt_num=None):
return _macros.message(role_class, role_label, msg_id, timestamp, content_html)


# JavaScript to fix relative URLs when served via gistpreview.github.io
# JavaScript to fix relative URLs when served via gisthost.github.io or gistpreview.github.io
# Fixes issue #26: Pagination links broken on gisthost.github.io
GIST_PREVIEW_JS = r"""
(function() {
if (window.location.hostname !== 'gistpreview.github.io') return;
// URL format: https://gistpreview.github.io/?GIST_ID/filename.html
var hostname = window.location.hostname;
if (hostname !== 'gisthost.github.io' && hostname !== 'gistpreview.github.io') return;
// URL format: https://gisthost.github.io/?GIST_ID/filename.html
var match = window.location.search.match(/^\?([^/]+)/);
if (!match) return;
var gistId = match[1];

// Load CSS from gist (relative stylesheet links don't work on gistpreview)
document.querySelectorAll('link[rel="stylesheet"]').forEach(function(link) {
var href = link.getAttribute('href');
if (href.startsWith('http')) return; // Already absolute
var cssUrl = 'https://gist.githubusercontent.com/raw/' + gistId + '/' + href;
fetch(cssUrl)
.then(function(r) { if (!r.ok) throw new Error('Failed'); return r.text(); })
.then(function(css) {
var style = document.createElement('style');
style.textContent = css;
document.head.appendChild(style);
link.remove(); // Remove the broken link
})
.catch(function(e) { console.error('Failed to load CSS:', href, e); });
});
function rewriteLinks(root) {
(root || document).querySelectorAll('a[href]').forEach(function(link) {
var href = link.getAttribute('href');
// Skip already-rewritten links (issue #26 fix)
if (href.startsWith('?')) return;
// Skip external links and anchors
if (href.startsWith('http') || href.startsWith('#') || href.startsWith('//')) return;
// Handle anchor in relative URL (e.g., page-001.html#msg-123)
var parts = href.split('#');
var filename = parts[0];
var anchor = parts.length > 1 ? '#' + parts[1] : '';
link.setAttribute('href', '?' + gistId + '/' + filename + anchor);
});
Comment on lines 1215 to 1226
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract this function(link) { block into a new function rewriteLink(root) {
so it can reused later at line 1074

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or test right here if the root is also an a[href] then the block below at 1074 is not needed:

function rewriteLinks(root) {
    const scope = root || document;

    const links = [];

    if (scope.matches && scope.matches('a[href]')) {
        links.push(scope);
    }

    scope.querySelectorAll('a[href]').forEach(link => links.push(link));

    links.forEach(link => {
        // rewrite logic here
    });
}

}

// Load JS from gist (relative script srcs don't work on gistpreview)
document.querySelectorAll('script[src]').forEach(function(script) {
var src = script.getAttribute('src');
if (src.startsWith('http')) return; // Already absolute
var jsUrl = 'https://gist.githubusercontent.com/raw/' + gistId + '/' + src;
fetch(jsUrl)
.then(function(r) { if (!r.ok) throw new Error('Failed'); return r.text(); })
.then(function(js) {
var newScript = document.createElement('script');
newScript.textContent = js;
document.body.appendChild(newScript);
})
.catch(function(e) { console.error('Failed to load JS:', src, e); });
});
// Run immediately
rewriteLinks();

// Fix relative links for navigation
document.querySelectorAll('a[href]').forEach(function(link) {
var href = link.getAttribute('href');
// Skip external links and anchors
if (href.startsWith('http') || href.startsWith('#') || href.startsWith('//')) return;
// Handle anchor in relative URL (e.g., page-001.html#msg-123)
var parts = href.split('#');
var filename = parts[0];
var anchor = parts.length > 1 ? '#' + parts[1] : '';
link.setAttribute('href', '?' + gistId + '/' + filename + anchor);
});
// Also run on DOMContentLoaded in case DOM isn't ready yet
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() { rewriteLinks(); });
}

// Execute module scripts that were injected via innerHTML
// (browsers don't execute scripts added via innerHTML for security)
document.querySelectorAll('script[type="module"]').forEach(function(script) {
if (script.src) return; // Already has src, skip
var blob = new Blob([script.textContent], { type: 'application/javascript' });
var url = URL.createObjectURL(blob);
var newScript = document.createElement('script');
newScript.type = 'module';
newScript.src = url;
document.body.appendChild(newScript);
// Use MutationObserver to catch dynamically added content
// gisthost/gistpreview may add content after initial load
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.addedNodes.forEach(function(node) {
if (node.nodeType === 1) { // Element node
rewriteLinks(node);
// Also check if the node itself is a link
if (node.tagName === 'A' && node.getAttribute('href')) {
var href = node.getAttribute('href');
if (!href.startsWith('?') && !href.startsWith('http') &&
!href.startsWith('#') && !href.startsWith('//')) {
var parts = href.split('#');
var filename = parts[0];
var anchor = parts.length > 1 ? '#' + parts[1] : '';
node.setAttribute('href', '?' + gistId + '/' + filename + anchor);
}
}
Comment on lines 1244 to 1254
Copy link

@muescha muescha Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Also check if the node itself is a link
if (node.tagName === 'A' && node.getAttribute('href')) {
var href = node.getAttribute('href');
if (!href.startsWith('?') && !href.startsWith('http') &&
!href.startsWith('#') && !href.startsWith('//')) {
var parts = href.split('#');
var filename = parts[0];
var anchor = parts.length > 1 ? '#' + parts[1] : '';
node.setAttribute('href', '?' + gistId + '/' + filename + anchor);
}
}
// Also check if the node itself is a link
if(node.matches('a[href]') {
rewriteLink(node);
}

}
});
});
});

// Start observing once body exists
function startObserving() {
if (document.body) {
observer.observe(document.body, { childList: true, subtree: true });
} else {
setTimeout(startObserving, 10);
}
}
startObserving();

// Handle fragment navigation after dynamic content loads
// gistpreview.github.io loads content dynamically, so the browser's
// gisthost/gistpreview loads content dynamically, so the browser's
// native fragment navigation fails because the element doesn't exist yet
function scrollToFragment() {
var hash = window.location.hash;
Expand All @@ -1120,11 +1123,12 @@ def render_message(log_type, message_json, timestamp, prompt_num=None):
})();
"""

# JavaScript to load page content from page-data-NNN.json on gistpreview
# JavaScript to load page content from page-data-NNN.json on gisthost/gistpreview
PAGE_DATA_LOADER_JS = r"""
(function() {
function getGistDataUrl(pageNum) {
if (window.location.hostname !== 'gistpreview.github.io') return null;
var hostname = window.location.hostname;
if (hostname !== 'gisthost.github.io' && hostname !== 'gistpreview.github.io') return null;
var query = window.location.search.substring(1);
var parts = query.split('/');
var mainGistId = parts[0];
Expand All @@ -1151,11 +1155,12 @@ def render_message(log_type, message_json, timestamp, prompt_num=None):
})();
"""

# JavaScript to load index content from index-data.json on gistpreview
# JavaScript to load index content from index-data.json on gisthost/gistpreview
INDEX_DATA_LOADER_JS = r"""
(function() {
function getGistDataUrl() {
if (window.location.hostname !== 'gistpreview.github.io') return null;
var hostname = window.location.hostname;
if (hostname !== 'gisthost.github.io' && hostname !== 'gistpreview.github.io') return null;
var query = window.location.search.substring(1);
var parts = query.split('/');
var mainGistId = parts[0];
Expand Down Expand Up @@ -1852,7 +1857,7 @@ def cli():
@click.option(
"--gist",
is_flag=True,
help="Upload to GitHub Gist and output a gistpreview.github.io URL.",
help="Upload to GitHub Gist and output a gisthost.github.io URL.",
)
@click.option(
"--json",
Expand Down Expand Up @@ -1968,7 +1973,7 @@ def local_cmd(
click.echo("Creating GitHub gist...")
gist_desc = f"claude-code-transcripts local {session_file.stem}"
gist_id, gist_url = create_gist(output, description=gist_desc)
preview_url = f"https://gistpreview.github.io/?{gist_id}/index.html"
preview_url = f"https://gisthost.github.io/?{gist_id}/index.html"
click.echo(f"Gist: {gist_url}")
click.echo(f"Preview: {preview_url}")

Expand Down Expand Up @@ -2037,7 +2042,7 @@ def fetch_url_to_tempfile(url):
@click.option(
"--gist",
is_flag=True,
help="Upload to GitHub Gist and output a gistpreview.github.io URL.",
help="Upload to GitHub Gist and output a gisthost.github.io URL.",
)
@click.option(
"--json",
Expand Down Expand Up @@ -2142,7 +2147,7 @@ def json_cmd(
input_name = Path(original_input).stem
gist_desc = f"claude-code-transcripts json {input_name}"
gist_id, gist_url = create_gist(output, description=gist_desc)
preview_url = f"https://gistpreview.github.io/?{gist_id}/index.html"
preview_url = f"https://gisthost.github.io/?{gist_id}/index.html"
click.echo(f"Gist: {gist_url}")
click.echo(f"Preview: {preview_url}")

Expand Down Expand Up @@ -2526,7 +2531,7 @@ def code_view_progress(phase, current, total):
@click.option(
"--gist",
is_flag=True,
help="Upload to GitHub Gist and output a gistpreview.github.io URL.",
help="Upload to GitHub Gist and output a gisthost.github.io URL.",
)
@click.option(
"--json",
Expand Down Expand Up @@ -2653,7 +2658,7 @@ def web_cmd(
click.echo("Creating GitHub gist...")
gist_desc = f"claude-code-transcripts web {session_id}"
gist_id, gist_url = create_gist(output, description=gist_desc)
preview_url = f"https://gistpreview.github.io/?{gist_id}/index.html"
preview_url = f"https://gisthost.github.io/?{gist_id}/index.html"
click.echo(f"Gist: {gist_url}")
click.echo(f"Preview: {preview_url}")

Expand Down
4 changes: 3 additions & 1 deletion src/claude_code_transcripts/code_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,9 @@ def generate_code_view_html(
if msg_id and msg_id in msg_to_prompt_num:
current_prompt_num = msg_to_prompt_num[msg_id]
# Every message gets the current prompt number (not just user prompts)
messages_data.append({"id": msg_id, "html": msg_html, "prompt_num": current_prompt_num})
messages_data.append(
{"id": msg_id, "html": msg_html, "prompt_num": current_prompt_num}
)

# Build temp git repo with file history
if progress_callback:
Expand Down
4 changes: 2 additions & 2 deletions src/claude_code_transcripts/templates/code_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ function formatTimestamps(container) {
});
}

// Get the URL for fetching code-data.json on gistpreview
// Get the URL for fetching code-data.json on gisthost/gistpreview
function getGistDataUrl() {
// Check if we have a separate data gist (for large files)
// window.DATA_GIST_ID is injected by inject_gist_preview_js when two-gist strategy is used
if (window.DATA_GIST_ID) {
return `https://gist.githubusercontent.com/raw/${window.DATA_GIST_ID}/code-data.json`;
}

// URL format: https://gistpreview.github.io/?GIST_ID/code.html
// URL format: https://gisthost.github.io/?GIST_ID/code.html
const match = window.location.search.match(/^\?([^/]+)/);
if (match) {
const gistId = match[1];
Expand Down
9 changes: 5 additions & 4 deletions src/claude_code_transcripts/templates/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
// Show search box (progressive enhancement)
searchBox.style.display = 'flex';

// Gist preview support - detect if we're on gistpreview.github.io
var isGistPreview = window.location.hostname === 'gistpreview.github.io';
// Gist preview support - detect if we're on gisthost.github.io or gistpreview.github.io
var hostname = window.location.hostname;
var isGistPreview = hostname === 'gisthost.github.io' || hostname === 'gistpreview.github.io';
var gistId = null;
var gistOwner = null;
var gistInfoLoaded = false;
Expand Down Expand Up @@ -72,7 +73,7 @@

function getPageLinkUrl(pageFile) {
if (isGistPreview && gistId) {
// Use gistpreview URL format for navigation links
// Use gisthost/gistpreview URL format for navigation links
return '?' + gistId + '/' + pageFile;
}
return pageFile;
Expand Down Expand Up @@ -219,7 +220,7 @@
searchResults.innerHTML = '';
searchStatus.textContent = 'Searching...';

// Load gist info if on gistpreview (needed for constructing URLs)
// Load gist info if on gisthost/gistpreview (needed for constructing URLs)
if (isGistPreview && !gistInfoLoaded && !usePageDataJson) {
// Only need gist info for HTML fetching (not for JSON which uses raw URLs)
searchStatus.textContent = 'Loading gist info...';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ <h1>Claude Code transcript</h1>
// Show search box (progressive enhancement)
searchBox.style.display = 'flex';

// Gist preview support - detect if we're on gistpreview.github.io
var isGistPreview = window.location.hostname === 'gistpreview.github.io';
// Gist preview support - detect if we're on gisthost.github.io or gistpreview.github.io
var hostname = window.location.hostname;
var isGistPreview = hostname === 'gisthost.github.io' || hostname === 'gistpreview.github.io';
var gistId = null;
var gistOwner = null;
var gistInfoLoaded = false;
Expand Down Expand Up @@ -498,7 +499,7 @@ <h1>Claude Code transcript</h1>

function getPageLinkUrl(pageFile) {
if (isGistPreview && gistId) {
// Use gistpreview URL format for navigation links
// Use gisthost/gistpreview URL format for navigation links
return '?' + gistId + '/' + pageFile;
}
return pageFile;
Expand Down Expand Up @@ -645,7 +646,7 @@ <h1>Claude Code transcript</h1>
searchResults.innerHTML = '';
searchStatus.textContent = 'Searching...';

// Load gist info if on gistpreview (needed for constructing URLs)
// Load gist info if on gisthost/gistpreview (needed for constructing URLs)
if (isGistPreview && !gistInfoLoaded && !usePageDataJson) {
// Only need gist info for HTML fetching (not for JSON which uses raw URLs)
searchStatus.textContent = 'Loading gist info...';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,9 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
// Show search box (progressive enhancement)
searchBox.style.display = 'flex';

// Gist preview support - detect if we're on gistpreview.github.io
var isGistPreview = window.location.hostname === 'gistpreview.github.io';
// Gist preview support - detect if we're on gisthost.github.io or gistpreview.github.io
var hostname = window.location.hostname;
var isGistPreview = hostname === 'gisthost.github.io' || hostname === 'gistpreview.github.io';
var gistId = null;
var gistOwner = null;
var gistInfoLoaded = false;
Expand Down Expand Up @@ -610,7 +611,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C

function getPageLinkUrl(pageFile) {
if (isGistPreview && gistId) {
// Use gistpreview URL format for navigation links
// Use gisthost/gistpreview URL format for navigation links
return '?' + gistId + '/' + pageFile;
}
return pageFile;
Expand Down Expand Up @@ -757,7 +758,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
searchResults.innerHTML = '';
searchStatus.textContent = 'Searching...';

// Load gist info if on gistpreview (needed for constructing URLs)
// Load gist info if on gisthost/gistpreview (needed for constructing URLs)
if (isGistPreview && !gistInfoLoaded && !usePageDataJson) {
// Only need gist info for HTML fetching (not for JSON which uses raw URLs)
searchStatus.textContent = 'Loading gist info...';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,9 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
// Show search box (progressive enhancement)
searchBox.style.display = 'flex';

// Gist preview support - detect if we're on gistpreview.github.io
var isGistPreview = window.location.hostname === 'gistpreview.github.io';
// Gist preview support - detect if we're on gisthost.github.io or gistpreview.github.io
var hostname = window.location.hostname;
var isGistPreview = hostname === 'gisthost.github.io' || hostname === 'gistpreview.github.io';
var gistId = null;
var gistOwner = null;
var gistInfoLoaded = false;
Expand Down Expand Up @@ -507,7 +508,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C

function getPageLinkUrl(pageFile) {
if (isGistPreview && gistId) {
// Use gistpreview URL format for navigation links
// Use gisthost/gistpreview URL format for navigation links
return '?' + gistId + '/' + pageFile;
}
return pageFile;
Expand Down Expand Up @@ -654,7 +655,7 @@ <h1><a href="index.html" style="color: inherit; text-decoration: none;">Claude C
searchResults.innerHTML = '';
searchStatus.textContent = 'Searching...';

// Load gist info if on gistpreview (needed for constructing URLs)
// Load gist info if on gisthost/gistpreview (needed for constructing URLs)
if (isGistPreview && !gistInfoLoaded && !usePageDataJson) {
// Only need gist info for HTML fetching (not for JSON which uses raw URLs)
searchStatus.textContent = 'Loading gist info...';
Expand Down
Loading