Documentation
¶
Overview ¶
Package ui embeds Sweef's own browser UI: the chrome page, the overlay, the new tab page, onboarding and the internal pages (settings, history, ...). Everything is plain HTML/CSS/JS served from FS; there is no bundler and no network access.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FS fs.FS = &zpack.FS{Z: webZ}
FS is the UI asset tree. Its root holds chrome/, newtab/, onboarding/, settings/, history/, downloads/, bookmarks/, error/ and shared/. The app serves it as sweef://chrome/..., sweef://newtab/... and so on (the first path segment is the page directory).
var Pages = map[string]bool{"chrome": true, "newtab": true, "settings": true, "history": true, "downloads": true, "bookmarks": true, "onboarding": true, "error": true, "datastop": true}
Pages are the internal page hosts. sweef://<page> serves <page>/index.html.
Functions ¶
func Route ¶
Route maps a sweef:// URL to a path inside FS.
sweef://newtab -> newtab/index.html sweef://settings/ -> settings/index.html sweef://chrome/overlay.html -> chrome/overlay.html sweef://settings/settings.js -> settings/settings.js (page-local asset) sweef://<any page>/shared/x.css -> shared/x.css (shared assets from any page host) sweef://ui/<path> -> <path>
Query strings and fragments are ignored (the page reads them itself). Paths are cleaned and rooted, so they cannot escape the tree. It returns ok=false for unknown hosts.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
uipreview
command
Command uipreview renders every Sweef UI page through the real engine and writes PNG previews.
|
Command uipreview renders every Sweef UI page through the real engine and writes PNG previews. |
|
Package preview renders every Sweef UI page through the real Sweef engine (the same Tab and paintPage path that `sweef screenshot` uses) with a mocked window.sweef and sample state.
|
Package preview renders every Sweef UI page through the real Sweef engine (the same Tab and paintPage path that `sweef screenshot` uses) with a mocked window.sweef and sample state. |