website-xp-phone 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -3
- package/public/blog/hlwm_and_herbstutil.md +71 -8
- package/public/checksums.txt +71 -72
- package/public/documents/drift-report.json +1 -1
- package/sonar-project.properties +12 -0
- package/src/content/addons.json +2 -2
- package/src/content/blog.json +2 -3
- package/src/content/blogDirs.ts +3 -2
- package/src/content/configs.json +5 -3
- package/src/content/contacts.json +5 -3
- package/src/content/index.ts +1 -2
- package/src/content/pages.json +2 -1
- package/src/content/projects/development.json +2 -2
- package/src/content/projects/doftiles.json +50 -78
- package/src/content/projects/frontend.json +2 -2
- package/src/content/projects/graphbrowser.json +2 -2
- package/src/content/projects/herbctl.json +177 -22
- package/src/content/projects/herbstutil.json +22 -22
- package/src/content/projects/lightdni-jssas-toggle.json +2 -2
- package/src/content/projects/on-deploy.json +27 -17
- package/src/content/projects/pagerts.json +4 -4
- package/src/content/projects/polyframes.json +13 -13
- package/src/content/projects/rarebert.json +2 -2
- package/src/content/projects/webuser.json +2 -2
- package/src/content/sections.json +11 -5
- package/src/lib/slashes.ts +20 -0
- package/src/lib/tabNav.ts +192 -0
- package/src/pages/BlogDirPage.tsx +2 -1
- package/src/pages/BlogPostPage.tsx +4 -2
- package/src/shell/App.tsx +5 -0
- package/src/shell/resolveRoute.ts +3 -2
- package/src/styles/layout.css +0 -1
- package/src/styles/window.css +12 -7
- package/src/window/MaximizedWindow.tsx +3 -0
- package/src/window/state.tsx +11 -4
- package/test/tabNav.test.js +137 -0
- package/tsconfig.node.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/xp.css/dist/98.css +2 -0
- package/xp.css/dist/98.css.map +1 -0
- package/xp.css/dist/GUI.css +2 -0
- package/xp.css/dist/GUI.css.map +1 -0
- package/xp.css/dist/XP.css +2 -0
- package/xp.css/dist/XP.css.map +1 -0
- package/xp.css/dist/fonts/converted/PerfectDOSVGA437Win.woff +0 -0
- package/xp.css/dist/fonts/converted/PerfectDOSVGA437Win.woff2 +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif.woff +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif.woff2 +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif_bold.woff +0 -0
- package/xp.css/dist/fonts/converted/ms_sans_serif_bold.woff2 +0 -0
- package/src/content/includes/make-recipes.md +0 -18
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "on-deploy",
|
|
3
3
|
"title": "on-deploy",
|
|
4
|
-
"description": "The doftiles deployment orchestrator: verifies the WM-stack binaries, installs the missing ones through per-
|
|
4
|
+
"description": "The doftiles deployment orchestrator: verifies the WM-stack binaries, installs the missing ones through per-distro deploy scripts, runs the make install assurances (bun, postinstall trust, the herbctl binary), deploys the dependencies, and provisions the session stack from declarative profiles.",
|
|
5
5
|
"github": "https://github.com/akinevz2/on-deploy",
|
|
6
6
|
"content": {
|
|
7
7
|
"heading": "on-deploy - the deployment orchestrator",
|
|
8
8
|
"content": [
|
|
9
|
-
"on-deploy turns the dotfiles repo into a one-command deployment. It runs inside the doftiles checkout and reads two manifests: wm.requires (the required binaries; the last line names the platform - ubuntu, arch, ... - selecting the <target>.deploy resolver) and deploy.profile (how the graphical session starts).",
|
|
9
|
+
"on-deploy turns the dotfiles repo into a one-command deployment. It runs inside the doftiles checkout and reads two manifests: wm.requires (the required binaries; the last line names the platform - ubuntu, manjaro, arch, ... - selecting the <target>.deploy resolver) and deploy.profile (how the graphical session starts, which features, which units, which env). The make deploy TUI configures both before anything is stowed.",
|
|
10
10
|
"[https://github.com/akinevz2/on-deploy](https://github.com/akinevz2/on-deploy)",
|
|
11
11
|
{
|
|
12
12
|
"heading": "The verbs",
|
|
13
|
-
"theme": "open",
|
|
14
13
|
"content": [
|
|
15
14
|
"check - report the requirement state; exit 1 when anything is missing (also --json).",
|
|
16
15
|
"deploy - install every missing binary: resolve the package, show the command, confirm (Enter = yes), run it, then re-verify - a binary still missing after its command fails the run. --yes for non-interactive runs; --dry-run to preview.",
|
|
17
|
-
"provision - platform services per profile: the X server set, the ~/.xinitrc session line, a greetd + tuigreet greeter, the nested stack packages.",
|
|
16
|
+
"provision - platform services per profile: the X server set, the ~/.xinitrc session line, a greetd + tuigreet greeter, the nested stack packages, the xrdp layer.",
|
|
17
|
+
"toolchain - the make install assurances: bun through npm when missing, trust of the global bun packages' postinstall scripts, the herbctl binary built from the submodule checkout when missing. (These used to be four separate Makefile recipes - bun-toolchain, bun-trust, on-deploy-ensure, herbctl-ensure - they are steps of one command now.)",
|
|
18
|
+
"deps - the dependency deployment: polyframes (the bar module / rofi menus binary), ensured on install, --force redeployed on update, --method source|npm|release per machine. The install method is recorded in ~/.config/doftiles.conf (stowed from the repo, so method changes show up as tracked diffs).",
|
|
18
19
|
"snapshot - collect a machine's pre-existing config into doftiles' defaults/ (a stow-shaped package) BEFORE the first deploy overwrites it - the machine's prior state, versioned in git, restorable with one make target.",
|
|
19
20
|
"configure - edit the deploy target and the required-package list from an interactive menu (or --target/--add/--remove flags)."
|
|
20
|
-
]
|
|
21
|
+
],
|
|
22
|
+
"theme": "open"
|
|
21
23
|
},
|
|
22
24
|
{
|
|
23
25
|
"heading": "The profiles",
|
|
24
|
-
"theme": "open",
|
|
25
26
|
"content": [
|
|
26
27
|
"Four session models, co-installable where it makes sense:",
|
|
27
|
-
"wsl - hlwm as
|
|
28
|
-
"nested - hlwm inside an Xvfb framebuffer, shared over VNC and browser noVNC
|
|
28
|
+
"wsl-systemd - NO display manager: hlwm runs as the systemd user unit herbst.service, waiting for the Windows-side X server (VcXsrv) to be reachable. The historical bypass; provision even checks the Windows partition for VcXsrv and offers a silent install from the SourceForge feed.",
|
|
29
|
+
"nested - hlwm inside an Xvfb framebuffer, shared over VNC (:5900) and browser noVNC (:6080), with an RDP surface layered on top (xrdp's Xvnc module attaches to the same framebuffer; 3389 stays free for the Windows side). The temporary profile, additive to a primary one.",
|
|
29
30
|
"xinit - startx runs ~/.xinitrc; no display manager.",
|
|
30
|
-
"greetd - greetd + tuigreet own the console.",
|
|
31
|
-
"A profile declares units (systemd user units, enabled additively) and env overrides (written to ~/.config/doftiles/env, read by the units via EnvironmentFile)."
|
|
32
|
-
]
|
|
31
|
+
"greetd - greetd + tuigreet own the console (the bare-OS target).",
|
|
32
|
+
"A profile declares units (systemd user units, enabled additively) and env overrides (written to ~/.config/doftiles/env, read by the units via EnvironmentFile). The make deploy TUI selects the session model, the features, the units and the env - and writes deploy.profile before stowing anything."
|
|
33
|
+
],
|
|
34
|
+
"theme": "open"
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
"heading": "Built to not hang, not lie",
|
|
36
|
-
"theme": "open",
|
|
37
38
|
"content": [
|
|
38
|
-
"Non-interactive runs abort cleanly demanding --yes instead of blocking on prompts; every install is re-verified; a failed install fails the run. The prompts ride a raw line reader (bun's readline wedges), and the menu works scripted or interactive."
|
|
39
|
-
]
|
|
39
|
+
"Non-interactive runs abort cleanly demanding --yes instead of blocking on prompts; every install is re-verified; a failed install fails the run. The prompts ride a raw line reader (bun's readline wedges), and the menu works scripted or interactive. The deploy script contract is <target>.deploy <binary> -> the providing package, install <binary> -> the install command - the resolver per distro, not a package list."
|
|
40
|
+
],
|
|
41
|
+
"theme": "open"
|
|
40
42
|
},
|
|
41
43
|
{
|
|
42
44
|
"heading": "Links",
|
|
43
|
-
"theme": "open",
|
|
44
45
|
"content": [
|
|
45
46
|
{
|
|
46
47
|
"heading": "GitHub repository",
|
|
@@ -48,9 +49,18 @@
|
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
"heading": "doftiles (what it deploys)",
|
|
51
|
-
"link": "
|
|
52
|
+
"link": "/projects/doftiles"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"heading": "herbctl (the binary the toolchain step builds)",
|
|
56
|
+
"link": "/projects/herbctl"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"heading": "polyframes (the artifact the deps step deploys)",
|
|
60
|
+
"link": "/projects/polyframes"
|
|
52
61
|
}
|
|
53
|
-
]
|
|
62
|
+
],
|
|
63
|
+
"theme": "open"
|
|
54
64
|
}
|
|
55
65
|
]
|
|
56
66
|
}
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"pagerts fetches a URL (or reads a local HTML file) and prints every external resource it references - links, meta tags, scripts, styles - as JSON.",
|
|
10
10
|
{
|
|
11
11
|
"heading": "From the README",
|
|
12
|
-
"theme": "open",
|
|
13
12
|
"content": [
|
|
14
13
|
"PagerTS fetches web pages, parses their HTML, and reports each page's title, URL, and external resources - inspecting common resource-bearing tags, or scanning every element for selected link properties.",
|
|
15
14
|
"Requires Node.js 20 or later; installs globally with `npm install --global pagerts`."
|
|
16
|
-
]
|
|
15
|
+
],
|
|
16
|
+
"theme": "open"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"heading": "Quick start",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"heading": "Links",
|
|
49
|
-
"theme": "open",
|
|
50
49
|
"content": [
|
|
51
50
|
{
|
|
52
51
|
"heading": "npm package",
|
|
@@ -60,7 +59,8 @@
|
|
|
60
59
|
"heading": "CHANGELOG",
|
|
61
60
|
"link": "https://github.com/akinevz2/pagerts/blob/main/CHANGELOG.md"
|
|
62
61
|
}
|
|
63
|
-
]
|
|
62
|
+
],
|
|
63
|
+
"theme": "open"
|
|
64
64
|
}
|
|
65
65
|
]
|
|
66
66
|
}
|
|
@@ -10,31 +10,30 @@
|
|
|
10
10
|
"[https://github.com/akinevz2/polyframes](https://github.com/akinevz2/polyframes)",
|
|
11
11
|
{
|
|
12
12
|
"heading": "The bar daemon",
|
|
13
|
-
"theme": "open",
|
|
14
13
|
"content": [
|
|
15
14
|
"A bare invocation is polybar's contract: print one bar line, then keep it fresh - a `herbstclient --idle` hook listener for instant focus/tag/title updates, plus a 1s layout poll that hashes `herbstclient dump` (frame splits and removals emit no hook in hlwm 0.9.5).",
|
|
16
15
|
"`polyframes bar` prints a single line and exits - the same pure renderer, scriptable."
|
|
17
|
-
]
|
|
16
|
+
],
|
|
17
|
+
"theme": "open"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"heading": "Grouping model",
|
|
21
|
-
"theme": "open",
|
|
22
21
|
"content": [
|
|
23
22
|
"Clients on the focused tag arrive in WM order, enriched per window: class, title, minimized, floating, and its parent frame's flat index (`-1` when the root is unsplit).",
|
|
24
23
|
"Group keys: `minflt|wid` and `unframed|wid` are solo labels; `frame|frame|class` groups same-class windows sharing a frame. A group's representative is the frame's selected client - but only when it belongs to the group's class, so a mixed-class frame never leaks another group's title.",
|
|
25
24
|
"Render order keeps WM order, pushes minimized labels last, truncates to `char_limit` with an ellipsis, folds forbidden classes (the bar itself), and emits a `+N` overflow marker past `max_windows`."
|
|
26
|
-
]
|
|
25
|
+
],
|
|
26
|
+
"theme": "open"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"heading": "The keybind registers live in doftiles",
|
|
30
|
-
"theme": "open",
|
|
31
30
|
"content": [
|
|
32
|
-
"The float
|
|
33
|
-
]
|
|
31
|
+
"The float-register state machines (mod-f / mod-x / mod-ctrl-f: float-focus, float-yank, zoom) live in herbctl - the keybinds spawn those herbctl verbs; they are documented in the [herbctl project](/projects/herbctl). The polyframes side of the same bindings is the frame surgery: tile/center/resize/fit re-executed in the bar's click actions."
|
|
32
|
+
],
|
|
33
|
+
"theme": "open"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"heading": "The helper suite, migrated in",
|
|
37
|
-
"theme": "open",
|
|
38
37
|
"content": [
|
|
39
38
|
"The dotfiles' herbst helpers moved in as subcommands, so one binary manages them all:",
|
|
40
39
|
"`tags`, `hidden`, `windows`, `launch` - the rofi menus (script-mode protocol, NUL-separated rows, per-row icons and states)",
|
|
@@ -44,21 +43,21 @@
|
|
|
44
43
|
"`resize` - delta nudges, frame/root deco-flush fills, explicit content rects",
|
|
45
44
|
"`fit` - constraint pass: shrink oversized, nudge off-screen (monitor or frame target)",
|
|
46
45
|
"`spawn` - one-shot `herbstclient rule once` spawns with typed flags (`--class/--float/--center/--tag`)"
|
|
47
|
-
]
|
|
46
|
+
],
|
|
47
|
+
"theme": "open"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"heading": "herbstutil + herbctl inside",
|
|
51
|
-
"theme": "open",
|
|
52
51
|
"content": [
|
|
53
52
|
"Two sibling libraries ride along at build time:",
|
|
54
53
|
"herbstutil (npm) - parseAttr for every WM read: typed JSON out of hlwm's attr output, one round trip instead of a per-client attribute walk.",
|
|
55
54
|
"herbctl - the imperatives the scroll/click actions run: float+center, minimize-keep-frame, empty-frame removal - the keybind state machines as importable functions.",
|
|
56
55
|
"Both resolve as sibling submodules in the doftiles depends/ layout and from the npm/GitHub registries everywhere else."
|
|
57
|
-
]
|
|
56
|
+
],
|
|
57
|
+
"theme": "open"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"heading": "Links",
|
|
61
|
-
"theme": "open",
|
|
62
61
|
"content": [
|
|
63
62
|
{
|
|
64
63
|
"heading": "GitHub repository",
|
|
@@ -76,7 +75,8 @@
|
|
|
76
75
|
"heading": "herbstutil (the JSON bridge)",
|
|
77
76
|
"link": "https://github.com/akinevz2/herbstutil"
|
|
78
77
|
}
|
|
79
|
-
]
|
|
78
|
+
],
|
|
79
|
+
"theme": "open"
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
}
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"[https://github.com/akinevz2/rarebert](https://github.com/akinevz2/rarebert)",
|
|
11
11
|
{
|
|
12
12
|
"heading": "From the README",
|
|
13
|
-
"theme": "open",
|
|
14
13
|
"content": [
|
|
15
14
|
"Rarebert scaffolds modules, opens them in your editor side-by-side with opencode, lets the model implement them, summarises the diff, and commits - then runs the result and remembers what happened.",
|
|
16
15
|
"Built around a TypeScript runtime (`lib/runtime/` + Bun) that orchestrates $EDITOR, git, and opencode, and a memo subsystem that threads observations between the model and your shell.",
|
|
17
16
|
"Each turn ends in a commit, so the working tree is always clean before the next cycle.",
|
|
18
17
|
"Work in progress: the branch is mid-port from Node.js/ESM to TypeScript/Bun, not yet stable for daily use."
|
|
19
|
-
]
|
|
18
|
+
],
|
|
19
|
+
"theme": "open"
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
22
|
}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"[https://github.com/akinevz2/webuser](https://github.com/akinevz2/webuser)",
|
|
11
11
|
{
|
|
12
12
|
"heading": "From the README",
|
|
13
|
-
"theme": "open",
|
|
14
13
|
"content": [
|
|
15
14
|
"A CLI built with Bunli on the Bun runtime: `bun install`, `bun dev -- [command]`, `bun run build`.",
|
|
16
15
|
"MIT licensed."
|
|
17
|
-
]
|
|
16
|
+
],
|
|
17
|
+
"theme": "open"
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"heading": "Welcome to kine's website!",
|
|
3
|
-
"theme": "open",
|
|
4
3
|
"content": [
|
|
5
4
|
"I sometimes change the blurb on the front page here,",
|
|
6
5
|
"Enjoy your visit!",
|
|
@@ -48,7 +47,9 @@
|
|
|
48
47
|
"content": [
|
|
49
48
|
"recently:",
|
|
50
49
|
{
|
|
51
|
-
"content": [
|
|
50
|
+
"content": [
|
|
51
|
+
"graduated University of Sussex!"
|
|
52
|
+
]
|
|
52
53
|
},
|
|
53
54
|
"currently:",
|
|
54
55
|
{
|
|
@@ -133,12 +134,16 @@
|
|
|
133
134
|
{
|
|
134
135
|
"heading": "music",
|
|
135
136
|
"link": "https://soundcloud.com/akinevz",
|
|
136
|
-
"content": [
|
|
137
|
+
"content": [
|
|
138
|
+
"where i post really heavy music"
|
|
139
|
+
]
|
|
137
140
|
},
|
|
138
141
|
{
|
|
139
142
|
"heading": "another music",
|
|
140
143
|
"link": "https://soundcloud.com/akinevz2",
|
|
141
|
-
"content": [
|
|
144
|
+
"content": [
|
|
145
|
+
"where i post music for the sake of memes"
|
|
146
|
+
]
|
|
142
147
|
},
|
|
143
148
|
"and endlessly, deeply",
|
|
144
149
|
{
|
|
@@ -174,5 +179,6 @@
|
|
|
174
179
|
}
|
|
175
180
|
]
|
|
176
181
|
}
|
|
177
|
-
]
|
|
182
|
+
],
|
|
183
|
+
"theme": "open"
|
|
178
184
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Path-slash trimming without regex backtracking scans (Sonar S8786).
|
|
2
|
+
* A trailing run of one character is O(1) per position but the regex
|
|
3
|
+
* matcher re-tries every start position on failure — O(n²) on long
|
|
4
|
+
* paths. These string walks are strictly linear. */
|
|
5
|
+
|
|
6
|
+
/** Strip trailing slashes ("/blog/" -> "/blog", "/" stays "/"). */
|
|
7
|
+
export function stripTrailingSlashes(path: string): string {
|
|
8
|
+
let end = path.length;
|
|
9
|
+
while (end > 1 && path[end - 1] === "/") end--;
|
|
10
|
+
return end === path.length ? path : path.slice(0, end);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Trim slashes on both ends ("/blog//" → "/blog"). */
|
|
14
|
+
export function stripEdgeSlashes(path: string): string {
|
|
15
|
+
let start = 0;
|
|
16
|
+
let end = path.length;
|
|
17
|
+
while (start < end && path[start] === "/") start++;
|
|
18
|
+
while (end > start && path[end - 1] === "/") end--;
|
|
19
|
+
return end - start === path.length ? path : path.slice(start, end);
|
|
20
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/** Tab navigation — the XP-window metaphor's keyboard traversal.
|
|
2
|
+
*
|
|
3
|
+
* Tab / Shift+Tab cycle:
|
|
4
|
+
* 1. the menu items (the menu bar first),
|
|
5
|
+
* 2. the visible buttons and links of the foreground — when a window
|
|
6
|
+
* is maximized, the cycle stays inside the maximized window's
|
|
7
|
+
* backdrop (the dimmed layer below it and the menu bar are out of
|
|
8
|
+
* reach: focus must not escape below it); otherwise it walks the
|
|
9
|
+
* page's windows.
|
|
10
|
+
* 3. window decorations (title-bar controls, the ride-out clones)
|
|
11
|
+
* are never traversed — the chrome is the mouse's business.
|
|
12
|
+
*
|
|
13
|
+
* The cycle is computed per keypress: the DOM changes under the
|
|
14
|
+
* keyboard (windows open, close, minimize, maximize), so no stale
|
|
15
|
+
* stop list is cached. Typing inside an input keeps the browser's
|
|
16
|
+
* native Tab behaviour.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** The window chrome: title-bar controls are decorations, not content. */
|
|
20
|
+
const isDecoration = (el: HTMLElement) =>
|
|
21
|
+
el.closest(".title-bar, .title-bar-controls") !== null;
|
|
22
|
+
|
|
23
|
+
/** True while the user types in a text field: native Tab belongs to it. */
|
|
24
|
+
export const isTypingTarget = (target: EventTarget | null) =>
|
|
25
|
+
target instanceof HTMLElement &&
|
|
26
|
+
(["INPUT", "TEXTAREA", "SELECT"].includes(target.tagName) ||
|
|
27
|
+
target.isContentEditable);
|
|
28
|
+
|
|
29
|
+
/** A candidate is a tab stop when it is interactive AND visible. */
|
|
30
|
+
function isStop(el: HTMLElement): boolean {
|
|
31
|
+
const tag = el.tagName;
|
|
32
|
+
const interactive =
|
|
33
|
+
tag === "BUTTON" ||
|
|
34
|
+
tag === "A" ||
|
|
35
|
+
tag === "INPUT" ||
|
|
36
|
+
tag === "TEXTAREA" ||
|
|
37
|
+
tag === "SELECT" ||
|
|
38
|
+
(el.getAttribute("tabindex") !== null && el.tabIndex >= 0);
|
|
39
|
+
if (!interactive) return false;
|
|
40
|
+
const input = el as HTMLButtonElement;
|
|
41
|
+
if (input.disabled || input.getAttribute("aria-disabled") === "true")
|
|
42
|
+
return false;
|
|
43
|
+
const style = getComputedStyle(el);
|
|
44
|
+
if (style.display === "none" || style.visibility === "hidden") return false;
|
|
45
|
+
// getClientRects() is empty for display:none subtrees and detached
|
|
46
|
+
// elements; visibility-hidden reports rects, hence the style check above.
|
|
47
|
+
return el.getClientRects().length > 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The maximized windows currently on screen, topmost LAST (DOM order is
|
|
51
|
+
* the stacking order: each maximize pushes its backdrop after the
|
|
52
|
+
* previous ones). Empty when no window is maximized. */
|
|
53
|
+
const maximizedBackdrops = () =>
|
|
54
|
+
[
|
|
55
|
+
...document.querySelectorAll<HTMLElement>(
|
|
56
|
+
".maximized-backdrop[data-window-id]",
|
|
57
|
+
),
|
|
58
|
+
].filter((backdrop) => backdrop.getClientRects().length > 0);
|
|
59
|
+
|
|
60
|
+
/** The traversal scope: the topmost maximized window when one exists,
|
|
61
|
+
* the whole page otherwise. The menu bar is a separate stage BEFORE
|
|
62
|
+
* the page and is excluded from maximized scopes (a maximized window
|
|
63
|
+
* covers the menu — focus must not reach it). */
|
|
64
|
+
function scopes(): HTMLElement[] {
|
|
65
|
+
const backdrops = maximizedBackdrops();
|
|
66
|
+
if (backdrops.length > 0) {
|
|
67
|
+
const topmost = backdrops[backdrops.length - 1];
|
|
68
|
+
return topmost ? [topmost] : [];
|
|
69
|
+
}
|
|
70
|
+
const page = document.querySelector<HTMLElement>("main.page");
|
|
71
|
+
return page ? [page] : [];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** One full cycle: the menu items, then the foreground's stops — in
|
|
75
|
+
* DOM order. Decorations and hidden windows are filtered out. */
|
|
76
|
+
export function tabStops(): HTMLElement[] {
|
|
77
|
+
const menuItems = [
|
|
78
|
+
...document.querySelectorAll<HTMLElement>(".menu-bar a[role='menuitem']"),
|
|
79
|
+
].filter(isStop);
|
|
80
|
+
const menuItemsReachable = maximizedBackdrops().length === 0;
|
|
81
|
+
const stops: HTMLElement[] = [];
|
|
82
|
+
if (menuItemsReachable) stops.push(...menuItems);
|
|
83
|
+
for (const scope of scopes()) {
|
|
84
|
+
for (const el of scope.querySelectorAll<HTMLElement>(
|
|
85
|
+
"button, a, input, textarea, select, [tabindex]",
|
|
86
|
+
)) {
|
|
87
|
+
if (isDecoration(el) || !isStop(el)) continue;
|
|
88
|
+
stops.push(el);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return stops;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The section the cycle last traversed: Tab resumes from the TOP of
|
|
95
|
+
* this section instead of resetting to the menu bar. Set whenever a
|
|
96
|
+
* stop inside a .window is focused; cleared when the window is gone. */
|
|
97
|
+
let lastSection: HTMLElement | null = null;
|
|
98
|
+
|
|
99
|
+
/** The first stop inside a window subtree, or undefined. */
|
|
100
|
+
const firstStopInSection = (stops: HTMLElement[], section: HTMLElement) =>
|
|
101
|
+
stops.find((el) => el.closest(".window") === section);
|
|
102
|
+
|
|
103
|
+
/** The first stop positioned AT or AFTER the section's start (Tab's
|
|
104
|
+
* resume point), and the last stop before it (Shift+Tab's). The
|
|
105
|
+
* section itself may be collapsed (its OK just revealed it), so the
|
|
106
|
+
* boundary is a DOM-position comparison, not a membership test. */
|
|
107
|
+
const sectionBoundary = (
|
|
108
|
+
stops: HTMLElement[],
|
|
109
|
+
section: HTMLElement,
|
|
110
|
+
): { forward: HTMLElement | undefined; backward: HTMLElement | undefined } => {
|
|
111
|
+
const anchor = firstStopInSection(stops, section);
|
|
112
|
+
const start = anchor ?? section;
|
|
113
|
+
const forward =
|
|
114
|
+
anchor ??
|
|
115
|
+
stops.find(
|
|
116
|
+
(el) =>
|
|
117
|
+
(start.compareDocumentPosition(el) &
|
|
118
|
+
Node.DOCUMENT_POSITION_FOLLOWING) !==
|
|
119
|
+
0,
|
|
120
|
+
);
|
|
121
|
+
const backward = [...stops]
|
|
122
|
+
.reverse()
|
|
123
|
+
.find(
|
|
124
|
+
(el) =>
|
|
125
|
+
(start.compareDocumentPosition(el) &
|
|
126
|
+
Node.DOCUMENT_POSITION_FOLLOWING) !==
|
|
127
|
+
0,
|
|
128
|
+
);
|
|
129
|
+
return { forward, backward };
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** Move focus within the cycle. Returns the element that received it. */
|
|
133
|
+
export function focusNextStops(backwards: boolean): HTMLElement | undefined {
|
|
134
|
+
const stops = tabStops();
|
|
135
|
+
if (stops.length === 0) return undefined;
|
|
136
|
+
const current = document.activeElement;
|
|
137
|
+
const index = stops.findIndex((el) => el === current);
|
|
138
|
+
let nextIndex: number;
|
|
139
|
+
if (index === -1) {
|
|
140
|
+
// Focus fell off the cycle (the just-pressed OK unmounted): resume
|
|
141
|
+
// at the CURRENT section's boundary — the first stop of the
|
|
142
|
+
// revealed section on Tab, the stop before it on Shift+Tab. No
|
|
143
|
+
// section in play (or a stale one): the menu bar leads the cycle.
|
|
144
|
+
const boundary = lastSection?.isConnected
|
|
145
|
+
? sectionBoundary(stops, lastSection)
|
|
146
|
+
: undefined;
|
|
147
|
+
const resume = backwards ? boundary?.backward : boundary?.forward;
|
|
148
|
+
nextIndex = resume ? stops.indexOf(resume) : 0;
|
|
149
|
+
} else {
|
|
150
|
+
lastSection = stops[index]?.closest(".window") ?? null;
|
|
151
|
+
nextIndex = (index + (backwards ? -1 : 1) + stops.length) % stops.length;
|
|
152
|
+
}
|
|
153
|
+
const next = stops[nextIndex];
|
|
154
|
+
if (!next) return undefined;
|
|
155
|
+
next.focus();
|
|
156
|
+
return next;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** The document-level Tab handler: the cycle is this module's business.
|
|
160
|
+
* Typing in a text field keeps the browser's native Tab behaviour. */
|
|
161
|
+
export function onTabKey(event: KeyboardEvent): void {
|
|
162
|
+
if (event.key !== "Tab") return;
|
|
163
|
+
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
|
164
|
+
if (isTypingTarget(event.target)) return;
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
focusNextStops(event.shiftKey);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Track the section the focus currently sits in — from EVERY focus
|
|
170
|
+
* change, not just Tab walks. The OK press that reveals a section is
|
|
171
|
+
* usually a mouse click: without this, the resume anchor would be
|
|
172
|
+
* stale (or null) and the cycle would reset to the menu bar. */
|
|
173
|
+
const noteSection = (event: FocusEvent): void => {
|
|
174
|
+
const el = event.target;
|
|
175
|
+
if (!(el instanceof HTMLElement)) return;
|
|
176
|
+
lastSection = el.closest(".window") ?? null;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/** Test seam: reset the module's section anchor between scenarios. */
|
|
180
|
+
export function resetSectionAnchor(): void {
|
|
181
|
+
lastSection = null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Install the Tab handler on the document. Returns the unmount. */
|
|
185
|
+
export function installTabNavigation(): () => void {
|
|
186
|
+
document.addEventListener("keydown", onTabKey);
|
|
187
|
+
document.addEventListener("focusin", noteSection);
|
|
188
|
+
return () => {
|
|
189
|
+
document.removeEventListener("keydown", onTabKey);
|
|
190
|
+
document.removeEventListener("focusin", noteSection);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
@@ -2,6 +2,7 @@ import { blogDirListed, blogDirListing, findBlogDir } from "@/content";
|
|
|
2
2
|
import { useSignals } from "@/lib/signals";
|
|
3
3
|
import { useLocation } from "react-router-dom";
|
|
4
4
|
import { PageWindows } from "@/window";
|
|
5
|
+
import { stripTrailingSlashes } from "@/lib/slashes";
|
|
5
6
|
|
|
6
7
|
/** A configured directory under /blog/ (src/content/blogDirs.ts): the
|
|
7
8
|
* page is the directory's LISTING — one window naming each shown file,
|
|
@@ -21,7 +22,7 @@ export const BlogDirPage = () => {
|
|
|
21
22
|
const { dispatch } = useSignals();
|
|
22
23
|
const listing = blogDirListing(pathname);
|
|
23
24
|
if (!listing) return null;
|
|
24
|
-
const parent = pathname
|
|
25
|
+
const parent = stripTrailingSlashes(pathname).replace(/\/[^/]*$/, "") || "/";
|
|
25
26
|
const parentLists =
|
|
26
27
|
parent === "/blog" ||
|
|
27
28
|
(Boolean(findBlogDir(parent)) && blogDirListed(parent));
|
|
@@ -8,6 +8,7 @@ import { useSignals } from "@/lib/signals";
|
|
|
8
8
|
import { useEffect, useMemo, useState } from "react";
|
|
9
9
|
import { useLocation } from "react-router-dom";
|
|
10
10
|
import { PageWindows } from "@/window";
|
|
11
|
+
import { stripTrailingSlashes } from "@/lib/slashes";
|
|
11
12
|
|
|
12
13
|
/** A markdown file from public/blog/, addressed directly by its URL.
|
|
13
14
|
*
|
|
@@ -34,7 +35,8 @@ export const BlogPostPage = () => {
|
|
|
34
35
|
};
|
|
35
36
|
}, [pathname]);
|
|
36
37
|
const isJson = useMemo(() => {
|
|
37
|
-
const parent =
|
|
38
|
+
const parent =
|
|
39
|
+
stripTrailingSlashes(pathname).replace(/\/[^/]*$/, "") || "/";
|
|
38
40
|
const base = decodeURI(pathname).split("/").pop() ?? "";
|
|
39
41
|
return Boolean(findBlogDir(parent)?.files.includes(`${base}.json`));
|
|
40
42
|
}, [pathname]);
|
|
@@ -58,7 +60,7 @@ export const BlogPostPage = () => {
|
|
|
58
60
|
live = false;
|
|
59
61
|
};
|
|
60
62
|
}, [isJson, pathname]);
|
|
61
|
-
const parent = pathname
|
|
63
|
+
const parent = stripTrailingSlashes(pathname).replace(/\/[^/]*$/, "") || "/";
|
|
62
64
|
const parentDir = findBlogDir(parent);
|
|
63
65
|
const foldsUp = Boolean(parentDir) && blogDirListed(parentDir?.path ?? "");
|
|
64
66
|
// A .md post's embed forces its window expanded; a .json post's tree
|
package/src/shell/App.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { ToastContainer } from "react-toastify";
|
|
|
4
4
|
import { pageRegistry } from "@/pages";
|
|
5
5
|
import { NotFoundPage } from "@/pages/NotFoundPage";
|
|
6
6
|
import { applyStoredTheme } from "@/lib/theme";
|
|
7
|
+
import { installTabNavigation } from "@/lib/tabNav";
|
|
7
8
|
import { bindNavigate } from "./routerSignals";
|
|
8
9
|
import { Clippy } from "./Clippy";
|
|
9
10
|
import { MenuBar } from "./MenuBar";
|
|
@@ -33,6 +34,10 @@ export function App() {
|
|
|
33
34
|
return () => document.body.classList.remove("feef69-page");
|
|
34
35
|
}, [blank]);
|
|
35
36
|
useEffect(applyStoredTheme, []);
|
|
37
|
+
// Tab navigation: menu items first, then the foreground's visible
|
|
38
|
+
// buttons — maximized windows keep focus inside their backdrop and
|
|
39
|
+
// window decorations are never traversed. See lib/tabNav.
|
|
40
|
+
useEffect(installTabNavigation, []);
|
|
36
41
|
|
|
37
42
|
if (blank) return <main className="feef69-page" />;
|
|
38
43
|
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
routes,
|
|
6
6
|
type Route,
|
|
7
7
|
} from "@/content";
|
|
8
|
+
import { stripEdgeSlashes, stripTrailingSlashes } from "@/lib/slashes";
|
|
8
9
|
|
|
9
10
|
export const NOT_FOUND = routes.find((r) => r.path === "/404") as Route;
|
|
10
11
|
|
|
@@ -17,7 +18,7 @@ export function normalizePath(pathname: string): string {
|
|
|
17
18
|
return pathname;
|
|
18
19
|
}
|
|
19
20
|
path = path.replace(/\/index(\.html)?$/i, "").replace(/\.html$/i, "");
|
|
20
|
-
path = `/${path
|
|
21
|
+
path = `/${stripEdgeSlashes(path)}`;
|
|
21
22
|
const lower = path.toLowerCase();
|
|
22
23
|
return routes.some((r) => r.path === lower) ? lower : path;
|
|
23
24
|
}
|
|
@@ -66,7 +67,7 @@ export function resolveRoute(pathname: string): Route {
|
|
|
66
67
|
hidden: true,
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
|
-
const parent = path
|
|
70
|
+
const parent = stripTrailingSlashes(path).replace(/\/[^/]*$/, "") || "/";
|
|
70
71
|
const base = path.split("/").pop() ?? "";
|
|
71
72
|
const files = blogDirFiles(parent);
|
|
72
73
|
// The parent of any /blog/** address is /blog or a walk-known
|
package/src/styles/layout.css
CHANGED
package/src/styles/window.css
CHANGED
|
@@ -410,16 +410,21 @@ form#form > label {
|
|
|
410
410
|
box-sizing: border-box;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
.resource-embed-scroll pre
|
|
414
|
-
white-space: pre-wrap;
|
|
415
|
-
overflow-wrap: anywhere;
|
|
416
|
-
word-break: break-word;
|
|
417
|
-
}
|
|
418
|
-
|
|
413
|
+
.resource-embed-scroll pre,
|
|
419
414
|
.window-body pre {
|
|
415
|
+
/* Code soft-wraps, but NOT the min-content-destroying way:
|
|
416
|
+
* pre-wrap + overflow-wrap:anywhere on a pre inside a flex column
|
|
417
|
+
* reports the box's min-content width as ~one character, so the
|
|
418
|
+
* window can shrink below the code's natural width and every
|
|
419
|
+
* line's last word dangles onto its own line. overflow-wrap:
|
|
420
|
+
* break-word keeps the full natural width as the minimum (the
|
|
421
|
+
* window is sized to the code's longest line) and only breaks a
|
|
422
|
+
* word when the code is genuinely wider than the window. */
|
|
420
423
|
white-space: pre-wrap;
|
|
421
|
-
overflow-wrap:
|
|
424
|
+
overflow-wrap: break-word;
|
|
422
425
|
word-break: break-word;
|
|
426
|
+
max-width: 100%;
|
|
427
|
+
box-sizing: border-box;
|
|
423
428
|
}
|
|
424
429
|
|
|
425
430
|
/* 98.css pins window text to its Win98 chrome size: .window{font-size:11px}.
|
|
@@ -266,6 +266,9 @@ export function MaximizedWindow({
|
|
|
266
266
|
ref={controller.backdropRef}
|
|
267
267
|
className={maximized ? "maximized-backdrop" : "maximized-shell"}
|
|
268
268
|
data-window-id={nodeId}
|
|
269
|
+
role={maximized ? "button" : undefined}
|
|
270
|
+
tabIndex={maximized ? 0 : undefined}
|
|
271
|
+
aria-label={maximized ? "Exit maximized view" : undefined}
|
|
269
272
|
onClick={
|
|
270
273
|
maximized
|
|
271
274
|
? (event) => {
|
package/src/window/state.tsx
CHANGED
|
@@ -201,12 +201,19 @@ export function useWindowStore(): WindowStore {
|
|
|
201
201
|
return store;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
export const toSlug = (heading: string): string =>
|
|
205
|
-
heading
|
|
204
|
+
export const toSlug = (heading: string): string => {
|
|
205
|
+
const dashed = heading
|
|
206
206
|
.toLowerCase()
|
|
207
207
|
.normalize("NFKD")
|
|
208
|
-
.replace(/[^\p{L}\p{N}]+/gu, "-")
|
|
209
|
-
|
|
208
|
+
.replace(/[^\p{L}\p{N}]+/gu, "-");
|
|
209
|
+
// Leading/trailing dash trim by string walk — the anchored regexes
|
|
210
|
+
// scan every start position on failure (Sonar S8786).
|
|
211
|
+
let start = 0;
|
|
212
|
+
let end = dashed.length;
|
|
213
|
+
while (start < end && dashed[start] === "-") start++;
|
|
214
|
+
while (end > start && dashed[end - 1] === "-") end--;
|
|
215
|
+
return dashed.slice(start, end);
|
|
216
|
+
};
|
|
210
217
|
|
|
211
218
|
/** Blog posts are addressed as ?post=slug, everything else by #tree-index.
|
|
212
219
|
* The depth-0 root is excluded from ?post= addressing: findTarget's
|