{"id":27160287,"url":"https://github.com/minhomega/chat-toc-bookmarklet","last_synced_at":"2025-06-27T16:33:51.748Z","repository":{"id":286658908,"uuid":"962121885","full_name":"MinhOmega/chat-toc-bookmarklet","owner":"MinhOmega","description":"A JavaScript bookmarklet that adds a collapsible Table of Contents panel to AI chat interfaces like ChatGPT and Grok, making it easier to navigate through long conversations with headings and sections.","archived":false,"fork":false,"pushed_at":"2025-04-07T17:47:04.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T03:48:15.521Z","etag":null,"topics":["ai-tools","bookmarklet","browser-extension","chatgpt","darkmode","grok","javascript","navigation","table-of-contents","toc"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MinhOmega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-07T17:22:29.000Z","updated_at":"2025-04-07T17:47:07.000Z","dependencies_parsed_at":"2025-04-07T18:37:39.240Z","dependency_job_id":"db171a82-80f9-4ea7-8d02-7647559fe3cc","html_url":"https://github.com/MinhOmega/chat-toc-bookmarklet","commit_stats":null,"previous_names":["minhomega/chat-toc-bookmarklet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MinhOmega/chat-toc-bookmarklet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinhOmega%2Fchat-toc-bookmarklet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinhOmega%2Fchat-toc-bookmarklet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinhOmega%2Fchat-toc-bookmarklet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinhOmega%2Fchat-toc-bookmarklet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MinhOmega","download_url":"https://codeload.github.com/MinhOmega/chat-toc-bookmarklet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinhOmega%2Fchat-toc-bookmarklet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262293780,"owners_count":23288811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-tools","bookmarklet","browser-extension","chatgpt","darkmode","grok","javascript","navigation","table-of-contents","toc"],"created_at":"2025-04-08T23:40:59.564Z","updated_at":"2025-06-27T16:33:51.712Z","avatar_url":"https://github.com/MinhOmega.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chat TOC Bookmarklet\n\nA JavaScript bookmarklet that adds a Table of Contents panel to AI chat interfaces like ChatGPT and Grok, making it easier to navigate through long conversations.\n\n## Features\n\n- 📋 Creates a collapsible Table of Contents panel for AI chat interfaces\n- 🔄 Works with both ChatGPT and Grok chat formats\n- 📱 Responsive design with a collapsible sidebar\n- 🌙 Dark mode support\n- 🔍 Highlights sections when clicked for better visibility\n- 📌 Persists across page refreshes\n- 🔽 Collapsible sections with expand/collapse all functionality\n- 📑 Support for navigating headings (H3, H4) and lists\n- 💾 Small file size after minification\n\n## Quick Start Guide\n\n### Installation (One-Time Setup)\n\n1. Create a new bookmark in your browser:\n   - **Chrome/Edge**: Click ⋮ (menu) → Bookmarks → Bookmark Manager → Right-click empty space → Add new bookmark\n   - **Firefox**: Click ☰ (menu) → Bookmarks → Manage Bookmarks → Right-click → New Bookmark\n   - **Safari**: Bookmarks menu → Add Bookmark → Edit URL field\n\n2. In the bookmark dialog:\n   - **Name**: \"Chat TOC\" (or whatever you prefer)\n   - **URL/Address**: Paste the entire contents of `TOC-min.js`\n   - Click Save\n\n### Using the TOC\n\n1. Go to ChatGPT (chat.openai.com) or Grok\n2. Click your \"Chat TOC\" bookmark\n3. A TOC panel will appear on the right side\n4. Click any section to navigate to it\n5. Use +/- icons to collapse/expand sections\n6. Click the \"TOC\" tab on the edge to hide/show the panel\n\n## Alternative Installation Methods\n\n### Option 1: Bookmarklet (Recommended)\n\n1. Create a new bookmark in your browser\n2. Name it something like \"Chat TOC\"\n3. Copy the entire contents of `TOC-min.js` file\n4. Paste it into the URL/Address field of the bookmark\n5. Save the bookmark\n\n### Option 2: Browser Console\n\n1. Open your browser's developer console (F12 or Ctrl+Shift+I)\n2. Copy the contents of `TOC.js` (or `TOC-min.js`)\n3. Paste it into the console and press Enter\n\n## Visual Example\n\n```\nChat Window                        TOC Panel\n+------------------------+        +-----------------+\n| User:                  |        | Conversation TOC|\n| How to make pasta?     |        | + -             |\n|                        |        +-----------------+\n| ChatGPT/Grok:          |        | - Turn 1 (You)  |\n| Making pasta involves  |        | - Turn 2 (AI)   |\n| these basic steps:     |        |   - Intro       |\n|                        |        |   - Basic Steps |\n| ## Basic Steps         |        |     - Boil water|\n| 1. **Boil water**      |        |     - Add pasta |\n| 2. **Add pasta**       |        |     - Cook time |\n| 3. **Cook time**       |        |   - Tips        |\n| 4. **Drain**           |        |     - Salt water|\n|                        |        |     - Stir often|\n| ## Tips                |        | - Turn 3 (You)  |\n| - **Salt water**       |        |                 |\n| - **Stir often**       |        |                 |\n+------------------------+        +-----------------+\n```\n\n## Features In Detail\n\n### Navigation\n\n- **Section Highlighting**: When you click on a section in the TOC, it will be highlighted briefly for easy identification\n- **Collapsible Sections**: Each section can be collapsed independently\n- **Expand/Collapse All**: Buttons at the top to expand or collapse all sections at once\n\n### Supported Elements\n\n- **H3 Headings**: Main section titles in AI responses\n- **H4 Headings**: Subsection titles\n- **Ordered Lists**: Nested list items under headings\n- **Strong Text**: Bold text elements that serve as important points\n\n### User Interface\n\n- **TOC Panel**: Fixed sidebar on the right with scrollable contents\n- **TOC Handle**: Vertical tab to collapse/expand the entire panel\n- **Dark Mode**: Automatically adjusts to browser dark mode settings\n\n## Development\n\nThis project includes the following main files:\n\n1. `TOC.js` - The full, unminified source code with comments\n2. `TOC-min.js` - The minified version for use as a bookmarklet\n3. `minify-toc.js` - Node.js script to minify the code\n\n### Minification Process\n\nThe project includes a Node.js script (`minify-toc.js`) that handles minification while preserving the critical `javascript:` prefix required for bookmarklets:\n\n1. Make sure you have Node.js installed\n2. Install dependencies: `npm install`\n3. Run the minification script: `npm run minify`\n\n#### How the Minification Works\n\nThe minification script:\n\n1. Preserves the `javascript:` prefix needed for bookmarklets\n2. Uses Terser for high-quality JavaScript minification with optimal settings:\n   - Multiple optimization passes\n   - Unsafe optimizations for smaller output\n   - Property mangling for minimized size\n   - Comment removal and whitespace optimization\n3. Implements additional custom optimizations to further reduce size\n4. Reports compression statistics when done\n\n## Technical Notes\n\n- The script injects a styled panel into the page\n- It observes DOM changes to update the TOC as the conversation progresses\n- Works with both ChatGPT and Grok response formats\n- The script distinguishes between user messages and AI responses\n- No data is sent to external servers - everything happens locally in your browser\n- The bookmarklet's size is optimized for maximum compression\n\n## Notes and Limitations\n\n- This tool does not currently display or navigate edits\n- Works with Dark mode automatically (detects system preferences)\n- Each section can be collapsed independently\n- The entire TOC panel can be collapsed using the vertical handle\n- Compatible with both ChatGPT and Grok AI chat interfaces\n- No external dependencies - runs completely in the browser\n\n## Inspiration\n\nThis bookmarklet is inspired by the work of [Brostoffed on GitHub](https://gist.github.com/Brostoffed/cbe33856cb1beb5f1c3852b9b5625204), with enhancements for compatibility with multiple AI platforms and improved usability features.\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminhomega%2Fchat-toc-bookmarklet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminhomega%2Fchat-toc-bookmarklet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminhomega%2Fchat-toc-bookmarklet/lists"}