Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'fix: AI chat button visibility + wire up share dialog' (#154) from fix/ai-chat-button-share into main

scott 5baca5be e9f6b451

+30 -2
+1 -1
public/sw.js
··· 8 8 * - API/WS/health: network-only (never cached) 9 9 */ 10 10 11 - const CACHE_NAME = 'tools-v2'; 11 + const CACHE_NAME = 'tools-v3'; 12 12 13 13 // Static assets to pre-cache on install 14 14 const PRECACHE_URLS = [
+3 -1
src/docs/index.html
··· 47 47 <!-- Version history --> 48 48 <button class="btn-icon" id="btn-history" title="Version history">&#128339;</button> 49 49 <!-- AI Chat --> 50 - <button class="btn-icon" id="btn-ai-chat" title="AI Chat (Cmd+Shift+L)">&#10024;</button> 50 + <button class="btn-icon" id="btn-ai-chat" title="AI Chat (Cmd+Shift+L)"> 51 + <svg class="tb-icon" viewBox="0 0 16 16" style="width:16px;height:16px" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h12a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H5l-3 3V4a1 1 0 0 1 1-1z"/><circle cx="5.5" cy="7.5" r="0.5" fill="currentColor" stroke="none"/><circle cx="8" cy="7.5" r="0.5" fill="currentColor" stroke="none"/><circle cx="10.5" cy="7.5" r="0.5" fill="currentColor" stroke="none"/></svg> 52 + </button> 51 53 <!-- Share button --> 52 54 <button class="btn-icon" id="btn-share" title="Share document">&#128279;</button> 53 55 <div class="save-indicator saved" id="save-indicator">
+26
src/docs/main.ts
··· 1652 1652 versionPreview.style.display = 'none'; 1653 1653 }); 1654 1654 1655 + // ── Share dialog ────────────────────────────────────────────────────────── 1656 + const shareDialog = $('share-dialog'); 1657 + const shareLinkInput = $('share-link-input') as HTMLInputElement; 1658 + 1659 + $('btn-share').addEventListener('click', () => { 1660 + shareLinkInput.value = window.location.href; 1661 + shareDialog.style.display = ''; 1662 + }); 1663 + 1664 + $('share-dialog-close').addEventListener('click', () => { 1665 + shareDialog.style.display = 'none'; 1666 + }); 1667 + 1668 + shareDialog.addEventListener('click', (e) => { 1669 + if (e.target === shareDialog) shareDialog.style.display = 'none'; 1670 + }); 1671 + 1672 + $('share-copy-link').addEventListener('click', async () => { 1673 + try { 1674 + await navigator.clipboard.writeText(shareLinkInput.value); 1675 + const btn = $('share-copy-link'); 1676 + btn.textContent = 'Copied!'; 1677 + setTimeout(() => { btn.textContent = 'Copy link'; }, 2000); 1678 + } catch { /* clipboard not available */ } 1679 + }); 1680 + 1655 1681 async function loadVersionList() { 1656 1682 try { 1657 1683 const res = await fetch(`/api/documents/${docId}/versions`);