mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
The Web app fetched and rendered pages but could not browse between them.
Now it does. In Reader view, anchors are parsed as the markup is stripped and
recorded as links spanning the text they enclose; those spans render in the
accent colour with an underline, and a click on one follows it.
- Link capture: html_to_text now tracks <a href> open/close, storing each
link's [start,end) span in the processed text plus its href in a per-page
string pool. Rendering overlays link spans in accent + underline; a body
click maps pixel -> line -> text offset -> containing link.
- Relative resolution: a link's href is resolved against the page's own
address (captured from the fetch's final host/port/path). Root-relative
(/path), document-relative (page.html) and absolute URLs all work; the
default port is omitted from the rebuilt URL. mailto:/javascript:/#frag
are treated as non-navigable.
- History: a back stack (depth 16) records each address before navigating; a
Back button, lit only when there is somewhere to return to, pops it.
- https:// links resolve through and are refused by the fetch layer with the
existing clear message rather than being silently dropped.
Verified on x86_64 with real synthetic clicks against a small multi-page HTTP
site: the home page rendered its two links highlighted; clicking "Go to Page
Two" navigated (URL bar updated to the resolved http://host/page2.html, host
logged GET /page2.html) and Page Two rendered with its own links; the Back
button returned to the home page (host logged GET /). Builds clean on x86_64,
aarch64 and armv8i.
Known limit: no TLS, so https:// pages are reported not shown -- plain HTTP
browsing only.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Fh5z6V7nGPbHvqVG5p4CXX