Commit Graph

145 Commits

Author SHA1 Message Date
Oleksandr Kozachuk fa0fd841b6 helwasm: shorten quick-gen hint (iphone); round out the About panel
Hint cut ~35% to two sentences. About 'Console' now notes form<->console share the
same catalog/session and that pb copies to the clipboard; About note mentions
home-screen install.
2026-06-10 00:13:57 +02:00
Oleksandr Kozachuk ebb09c7cb9 help: list every command (add keep, pb, and the other/help/quit line)
keep <n> (keep a listed ls/gen entry by its left-column index), pb <command> (copy a
command's output to the clipboard), and a final line for help / # comments / quit were
missing. cargo test green; rebuilt wasm.
2026-06-10 00:07:59 +02:00
Oleksandr Kozachuk eef2104f25 helwasm: let hint + About text fill the block (drop ch max-width caps) 2026-06-09 23:59:49 +02:00
Oleksandr Kozachuk 15245d027c helwasm: fix hint — Store files the entry (name + rules), not just the name
Store saves the full entry spec (name, length, mode, seq, date, parent), never the
password; the old wording said 'just the entry name', which contradicts the recall-
full-spec behaviour. Fixed the quick-gen hint and the About blurb.
2026-06-09 23:57:10 +02:00
Oleksandr Kozachuk 4c6884c947 helwasm: footer respects the body gutter (use padding-block)
The .foot padding shorthand zeroed the inline padding, overriding .wrap's gutter so
the footer text ran to the window edge. Use padding-block so it lines up with the
body cards.
2026-06-09 23:54:13 +02:00
Oleksandr Kozachuk 7c651d0bb5 pb: copy to the clipboard in the browser
Instead of erroring, the wasm `pb` branch now writes the inner command's data to the
host page's clipboard via navigator.clipboard (new hel_clipboard_write host hook).
Runs inside the Enter-keypress handler, so the clipboard user-gesture requirement is
met. Native pbcopy/xclip path unchanged.
2026-06-09 23:51:51 +02:00
Oleksandr Kozachuk 30fbc1caae helwasm: merge Store + Mark correct into one progressive button
The two buttons encoded different facts (catalog membership vs verified hash) but
looked alike. Combine into a single button that walks the states, each a real engine
command: Store (add) -> Correct (correct) -> Correct ✓ (uncorrect), and Stored ✓
(disabled) when filed but no master is typed. Shorter label: "Correct", not
"Mark correct". Help texts updated.
2026-06-09 23:45:31 +02:00
Oleksandr Kozachuk 2f55846f70 helwasm: Stored button matches Correct (filled ocean); refocus console after pass modal
- is-stored now uses the same filled-ocean look as is-correct, so both confirmed
  states read identically
- closing the pass overlay (Set or Cancel) returns focus to the command line
2026-06-09 23:31:46 +02:00
Oleksandr Kozachuk 05613813de parser: a mode must end at a word boundary
A single-letter mode was stolen from the middle of a longer word, so `gen testG r
now` mis-parsed as name=r, mode=n (the 'n' of 'now'), leaving 'ow' dangling and
failing with a trailing-input error. Require a non-alphanumeric after a mode so 'now'
parses as the date it is. Adds a regression test.
2026-06-09 23:24:57 +02:00
Oleksandr Kozachuk 0dd173f113 helwasm: store-on-correct, store button reflects existence, use stored spec
- new read-only export hel_entry(name): the entry's canonical stored form, or ""
- Mark correct now also stores the name (keeps the entry); unmark keeps the stored
  name and just drops the hash (wraps add/rm for an ephemeral entry so the right
  hash is removed)
- Store button shows "Stored ✓" (disabled, ocean outline) when the name is already
  in the catalog, "Store" otherwise
- when a typed name already exists, the field adopts the full stored spec on blur
  (real mode/seq/date/parent) instead of a default-extended parse
2026-06-09 23:12:48 +02:00
Oleksandr Kozachuk c60e6c8ce2 helwasm: colour is per name+master, not per root master
Mark correct now stores/checks the leaf's own SHA1(name||password) (correct <name>),
read from the leaf warning in the enc output. Changing the name (or mistyping the
master) drops back to black until that exact name+master is marked. Mark/unmark wraps
add/rm for an ephemeral (not Stored) entry.
2026-06-09 22:53:44 +02:00
Oleksandr Kozachuk 10a21d1f9d helwasm: hierarchical quick-gen, pure sugar over the engine
Quick form now drives the one shared engine through commands only, so it and the
console give identical results (form == console).

- password hook answers only the "/" prompt, so read_master climbs and computes
  every ^parent from a single root master (Req 4)
- new master in the field is authoritative via `unpass`; empty field reuses the
  stored session master, so later names generate without re-typing it (Req 1/2)
- `unpass` with no name now clears ALL cached masters (real command, not a private
  hook) so the form stays reproducible in the console
- result colour = root master marked correct (correct / / uncorrect /), derived
  live from the engine; black otherwise (Req 3)
- Mark-correct toggle button; click the master to reveal it; honest memory-only hint
- master stays in memory only, never written to storage; only the one-way correct
  hash is saved on the device

parser: bare-name forms now keep a trailing comment, and a ^-led token is never a
name, so `name ^parent` / `name MODE ^parent` link the parent instead of qpname
reading it as prefix+name (was silently mis-stored).
2026-06-09 22:45:44 +02:00
Oleksandr Kozachuk e25746d5f0 web: add an always-visible '← Kaizenkodo' back link to the main site
The brand only reloaded the tool and the byline was hidden on mobile, so there
was no easy way back. Add a pill back link (href='../') as the first header item,
shown on every width; drop the wordmark below 540px so it still fits on phones.
2026-06-09 21:38:14 +02:00
Oleksandr Kozachuk fc0e9bfafd web: clarify + shorten the Store/privacy hint (browser-only, never a server) 2026-06-08 23:11:58 +02:00
Oleksandr Kozachuk 1370e640fb web: drop em-dashes from style.css comments 2026-06-08 23:03:30 +02:00
Oleksandr Kozachuk 1005e5a8e2 web: forward-port the no-horizontal-scroll rules into source style.css (de-em-dashed comments) 2026-06-08 23:02:44 +02:00
Oleksandr Kozachuk 29c26ddda1 web: drop em-dashes from the help/UI copy, reword to not need them 2026-06-08 23:00:41 +02:00
Oleksandr Kozachuk 77352093c9 web: official ensō+key icon, Kaizenkodo link, installable home-screen app
- App icon = the official Kaizenkodo ensō (logo/current/exports/tight) with a key
  inside: cream bg for the home-screen/app icon, transparent for the header +
  favicons. Source: assets/enso-base.png + icon-source.svg / enso-mark.svg.
- Attribution: a 'by Kaizenkodo' header link and a footer line, both to kaizenkodo.no.
- PWA install: manifest (standalone, start_url/scope '../', maskable icons) + iOS
  metas (apple-mobile-web-app-capable/title/status-bar) so it adds to the iPhone
  home screen and runs as a standalone app.
2026-06-08 22:39:30 +02:00
Oleksandr Kozachuk b163cc440f web: stack the result row cleanly on phones
On narrow screens the result row (tag + password + len + buttons) wrapped
awkwardly. Reorder under @media: password on its own full-width line, then a
tidy meta line (result + len ........ Copy / Store).
2026-06-08 22:18:07 +02:00
Oleksandr Kozachuk be2078779d web: quick-gen result scales + wraps on small screens
The result password was a fixed 19px with white-space:pre, so it overflowed the
card on phones. Scope .result .secret to a dynamic font (clamp 13-19px, ~15px at
390px) that wraps (pre-wrap + overflow-wrap:anywhere + min-width:0). Desktop is
unchanged (fits one line at 19px); the console gen-table keeps its pre alignment.
2026-06-08 22:12:53 +02:00
Oleksandr Kozachuk 509a66a609 web: prevent iOS focus-zoom — inputs/textarea >= 16px
iOS Safari auto-zooms (and stays zoomed) when a focused input is under 16px.
Bumped the form inputs (15px) and modal textareas (13px) to 16px; the console
input inherits the base. No viewport user-scalable hack (keeps pinch-zoom).
2026-06-08 22:04:55 +02:00
Oleksandr Kozachuk db0eb9ebc4 web: stop browser autofill on the name + master fields
The master and pass-overlay inputs are now type=text with a CSS visual mask
(-webkit-text-security) instead of type=password, so the browser never treats
them as password fields — no autofill, no save prompt, no 'suggest strong
password'. Added autocomplete=off + autocapitalize/autocorrect off and
data-1p-ignore / data-lpignore / data-bwignore on the name + master + pass.
2026-06-08 21:59:16 +02:00
Oleksandr Kozachuk d44a54002b parser: default mode for a bare name is now R (six S/KEY words), not C
Matches the prefix-name default, the README, and the app's own help text (which
already says the default is six memorable words). Explicit modes are unaffected,
so existing catalogs round-trip unchanged.
2026-06-08 21:51:03 +02:00
Oleksandr Kozachuk 14d404744c web: fix mobile horizontal overflow
main is a grid; its items default to min-width:auto, so the console card (pre /
no-wrap lines) refused to shrink and pushed the whole page wider than the phone
screen, clipping the About panel text. Set grid-template-columns: minmax(0,1fr)
so cards shrink to the viewport and the console scrolls internally instead.
2026-06-08 21:41:35 +02:00
Oleksandr Kozachuk 349bbe1557 web: link RFC 2289 in the About panel 2026-06-08 21:24:59 +02:00
Oleksandr Kozachuk f8e8a9981a help: note the S/KEY (RFC 2289) heritage + xkcd 936 memorable-words idea
The default R mode is the six-word S/KEY form. Mention it in the help command
(CLI + web console) and the web About panel, with a link to xkcd 936.
2026-06-08 21:15:15 +02:00
Oleksandr Kozachuk ba884037b0 web: state the no-server/in-browser privacy clearly + self-host fonts
- Make the privacy promise true: bundle the fonts (Poppins/Inter/JetBrains Mono
  latin subsets + the text-security mask font) under helwasm/assets/fonts/ and
  drop the Google Fonts + jsDelivr links. The page now makes zero external
  requests once loaded — it talks to no third party.
- Say it plainly throughout the UI: a "Private by design" callout in the About
  panel, the meta description, the quick-gen and console hints, and the footer —
  nothing you type leaves the browser, no server, no account, no tracking.
2026-06-08 20:42:33 +02:00
Oleksandr Kozachuk 3031105000 feat(web): polish the WASM site - UX, help, parsing, assets
- About panel (collapsible, closed by default with a pulsing "Help" badge)
  explaining the tool; the `help` command now prints a full command reference
  instead of "HELP" (benefits the CLI too).
- Live generation as you type; Store button; masked output that stays mono-width
  (gen masks only the password column, never the header); command history with
  Up/Down (persisted); console auto-scroll; Export fixed (uses `dump`); Import.
- Name field normalizes to its canonical parsed form on blur; quick-gen and Store
  resolve the real entry name, so a leading prefix like `*P0 test1` is handled
  correctly (new hel_parse / hel_parse_name wasm helpers).
- Parser: prefix-only forms now parse with defaults - `*P0 test1` ->
  `*P0 test1 R 99 <today>`, `*P0 test1 R`, `*P0 test1 20R` - via new qpname/npname
  rules mirroring qname/nname; the fully-qualified form is unchanged.
- Favicons + web app manifest + enso asset; pkg rebuilt.
2026-06-08 20:11:24 +02:00
Oleksandr Kozachuk 03c5dadccb feat: WASM web app (browser LesS/KEY) backed by the hel core
Run the real hel core in the browser via WebAssembly, replacing the plain-JS
ooke.github.io/sk reimplementation so the web and the CLI share one generator.

- hel core: new storage module (native fs / wasm localStorage) backs
  init/source/dump/correct; the pipe and pb branches are gated out of wasm;
  the wasm editor is completed (EditorRef) and its password prompt no longer
  blocks the single JS thread (synchronous hel_get_password instead of a
  thread::sleep poll).
- helwasm: hel_load_script for bulk import, a panic hook in hel_init, dropped
  the ok_add / web-sys leftovers; build.sh runs wasm-bindgen into a committed
  pkg/ so GitHub Pages can serve the static dir with no CI.
- UI: rewritten index.html + style.css in the kaizenkodo.org style — responsive,
  masked-but-copyable passwords with click-to-reveal, a quick-generate card plus
  a full command console, localStorage persistence, and paste import/export.
2026-06-08 18:43:19 +02:00
Oleksandr Kozachuk 74d3296882 feat: Notion backend for the catalog + set command + ls/source/save UX
Persist the entry catalog to a Notion page instead of an external script.

- `hel store notion:<ref>` reads the dump from stdin and writes it into a
  single code block on the page; `hel load notion:<ref>` prints it back.
  `<ref>` is a page id (UUID) or a page title (case-insensitive search).
  Token from HEL_NOTION_TOKEN. Networking lives in helcli (ureq + serde_json);
  the core lib and the wasm build are untouched. argv is dispatched before the
  REPL starts, so the subcommands never read ~/.helrc or prompt for a master.

- `set <key> <value>`: runtime config (e.g. hel_dump, hel_notion_token) from
  ~/.helrc instead of env vars. The map is exported (uppercased) into spawned
  pipe/source children, so `set hel_notion_token ...` reaches `hel store`.
  Values are redacted in history.

- `ls` now matches case-insensitively.
- `source` echoes `source <target>`.
- `save` prints a `< removed` / `> added` diff against the last load/save
  snapshot so removals are noticed before they persist.
2026-06-08 16:53:23 +02:00
Kiyomichi Kosaka 38e7df982f Merge pull request #1 from ok2/codex/fix-typo,-bug,-comments,-and-improve-tests
Fix typos and improve radix output
2025-06-08 17:01:17 +02:00
Kiyomichi Kosaka ff4215fbab Fix typos and improve Radix 2025-05-23 13:47:58 +02:00
Oleksandr Kozachuk d4eeea73d8 Improve readline history. 2023-07-18 14:22:15 +02:00
Oleksandr Kozachuk b3260e04fb Do not print error on adding, when exactly the same already exist, it ignores it then silently. 2023-02-02 10:54:08 +01:00
Oleksandr Kozachuk 464ac458d2 Simplify call_cmd_with_input. 2023-01-11 14:29:10 +01:00
Oleksandr Kozachuk 8db5e66f83 Small refactoring/simplification of radix code. 2023-01-10 13:58:25 +01:00
Oleksandr Kozachuk ab79a100d3 Small changes for the html. 2023-01-09 13:53:58 +01:00
Oleksandr Kozachuk ccc318b2ad Increase the max history size for hel to 10000. 2023-01-07 13:55:37 +01:00
Oleksandr Kozachuk a180291e94 Fix handling of empty password. 2023-01-07 13:46:33 +01:00
Oleksandr Kozachuk 122aeaf75b Refactor read_password function to take just the name as argument, not the prompt. 2023-01-07 13:40:00 +01:00
Oleksandr Kozachuk 54c2c0e5a1 Store pass command without password to history. 2023-01-07 13:18:39 +01:00
Oleksandr Kozachuk 2b56aed28e Refactor history handling: store only save and usefull commands, save them in LKEval state, do not safe pass command into history. 2023-01-07 13:16:47 +01:00
Oleksandr Kozachuk 4ee1d38be7 pass command accepts now optionally the password from command line, instead of stdin. 2023-01-07 12:06:41 +01:00
Oleksandr Kozachuk 44c6f371a8 Wrap lines in HTML. 2023-01-06 17:31:57 +01:00
Oleksandr Kozachuk ed894b8b16 Remove warning. 2023-01-06 17:22:52 +01:00
Oleksandr Kozachuk e0b5c0280e Integrate the REPL, now WASM32 works, just some functions missing. 2023-01-06 17:21:28 +01:00
Oleksandr Kozachuk 77f7db7dec Add possibility to add input instead of calling readline. 2023-01-06 17:13:42 +01:00
Oleksandr Kozachuk e9dba54750 Develop wasm support further. 2023-01-06 16:16:04 +01:00
Oleksandr Kozachuk 3416ea96ae Remove deadlock_detection feature from parking_lot, because it is incompatible with wasm32 2023-01-06 15:27:58 +01:00
Oleksandr Kozachuk 127f386e35 Fix compilation and tests. 2023-01-06 15:08:52 +01:00