The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(browser): no link number for anchors on the same page; live web_research probe
purpled19653fd257e
diff --git a/src-tauri/src/commands/browser.rs b/src-tauri/src/commands/browser.rsindex a4d9a5d7..5d6afbb9 100644--- a/src-tauri/src/commands/browser.rs+++ b/src-tauri/src/commands/browser.rs@@ -96,7 +96,7 @@ pub(crate) fn snapshot_script() -> String {const SKIP = new Set(['SCRIPT','STYLE','NOSCRIPT','TEMPLATE','SVG','IFRAME','HEAD','CANVAS','SELECT','OPTION','BUTTON','TEXTAREA']);const hidden = (el) => {{ for (let e = el; e && e !== document.documentElement; e = e.parentElement) {{ if (SKIP.has(e.tagName)) return true; const s = cs(e); if (s.display === 'none' || s.visibility === 'hidden') return true; if (e.getAttribute && e.getAttribute('aria-hidden') === 'true') return true; }} return false; }};const blockOf = (el) => {{ for (let e = el; e && e !== document.body; e = e.parentElement) {{ const d = cs(e).display; if (d && !d.startsWith('inline') && d !== 'contents') return e; }} return document.body; }};- const links = []; const byHref = new Map();+ const links = []; const byHref = new Map(); const here = location.href.split('#')[0];let text = ''; let lastBlock = null; let openLink = null; let cut = false;const closeLink = () => {{ if (openLink) {{ text += ' [L' + openLink + ']'; openLink = null; }} }};const root = document.body || document.documentElement;@@ -113,8 +113,9 @@ pub(crate) fn snapshot_script() -> String {try {{ href = new URL(a.getAttribute('href'), document.baseURI).href; }} catch (e) {{}}if (/^https?:/i.test(href)) {{href = href.split('#')[0];- ref = byHref.get(href);- if (!ref && links.length < 120) {{ links.push({{ ref: 'L' + (links.length + 1), text: (a.innerText || a.title || '').trim().slice(0, 100), href }}); ref = links.length; byHref.set(href, ref); }}+ if (href === here) href = '';+ ref = href ? byHref.get(href) : null;+ if (href && !ref && links.length < 120) {{ links.push({{ ref: 'L' + (links.length + 1), text: (a.innerText || a.title || '').trim().slice(0, 100), href }}); ref = links.length; byHref.set(href, ref); }}}}}}if (openLink && openLink !== ref) closeLink();