Skip to content

Ability to search transcripts#16

Merged
simonw merged 8 commits intomainfrom
search
Dec 27, 2025
Merged

Ability to search transcripts#16
simonw merged 8 commits intomainfrom
search

Conversation

@simonw
Copy link
Copy Markdown
Owner

@simonw simonw commented Dec 27, 2025

simonw and others added 7 commits December 26, 2025 22:24
- Add search box to the right of "Claude Code transcript" header
- Search box is hidden by default, shown only when JavaScript is available
- Clicking search button or pressing Enter opens a modal dialog
- Modal fetches all page-X.html files (3 at a time in parallel)
- Uses DOMParser to parse HTML and search through visible text
- Results are displayed immediately as each fetch completes
- Entire message blocks are shown with matching text highlighted
- Clicking a result links to that fragment on that page
- Search term is persisted in URL as #search=XXX
- Visiting index.html with #search=XXX opens modal and runs search

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Internal anchor links (like timestamp links) in cloned message blocks
now correctly point to page-xxx.html#msg-XXX instead of just #msg-XXX.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move border-bottom styling from h1 to .header-row container so the
blue underline extends under both the title and the search box.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When hosted on gistpreview.github.io, the search feature now:
- Detects the gistpreview hostname
- Extracts the gist ID from the URL path
- Fetches gist metadata from GitHub API to get the owner
- Constructs raw gist URLs for fetching page files

This allows search to work correctly when viewing transcripts via gistpreview.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix gist ID extraction to use query string (?gist-id/file.html) instead
  of pathname
- Preserve query string when updating URL hash for search terms
- Ensures search URL stays as ?gist-id/index.html#search=term instead of
  losing the gist ID

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename getPageUrl to getPageFetchUrl (for fetching raw content)
- Add getPageLinkUrl for navigation links using gistpreview URL format
- Search result links now use ?gist-id/page-XXX.html format on gistpreview

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
iOS Safari auto-zooms when focusing inputs with font-size < 16px.
Setting both the header search box and modal search input to 16px
prevents this unwanted zoom behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Refs #15

Transcript to this point of search: https://gistpreview.github.io/?74c4a80b8e0a00d0904c2a2c17ebe8ff/index.html
@simonw simonw added the enhancement New feature or request label Dec 27, 2025
@simonw
Copy link
Copy Markdown
Owner Author

simonw commented Dec 27, 2025

Need to hide search box if file was opened from disk (not via web server) since that won't work yet.

This looks like the right pattern for that:

if (window.location.protocol !== 'file:')

@simonw
Copy link
Copy Markdown
Owner Author

simonw commented Dec 27, 2025

Search relies on fetch() to load page content, which doesn't work from
file:// due to CORS restrictions. Now returns early before showing the
search UI when window.location.protocol is 'file:'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Transcript: https://gistpreview.github.io/?701ec658eede1bd0023f82fdb9a46229/index.html

Refs #16 (comment)

Refs #15
@simonw simonw merged commit bcd48bb into main Dec 27, 2025
30 checks passed
HLD added a commit to HLD/claude-code-transcripts that referenced this pull request Dec 30, 2025
Search relies on fetch() to load page content, which doesn't work from
file:// due to CORS restrictions. Now returns early before showing the
search UI when window.location.protocol is 'file:'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Transcript: https://gistpreview.github.io/?701ec658eede1bd0023f82fdb9a46229/index.html

Refs simonw/claude-code-transcripts#16 (comment)

Refs #15
ShlomoStept pushed a commit to ShlomoStept/claude-code-transcripts that referenced this pull request Jan 9, 2026
Search relies on fetch() to load page content, which doesn't work from
file:// due to CORS restrictions. Now returns early before showing the
search UI when window.location.protocol is 'file:'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Transcript: https://gistpreview.github.io/?701ec658eede1bd0023f82fdb9a46229/index.html

Refs simonw#16 (comment)

Refs #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant