Commit Graph
54 Commits
Author SHA1 Message Date
thallada c43454e214 Add reviews to gitignore 2026-08-12 01:09:52 -04:00
thallada 5daa644d3b feat: add sticky error-aware key mastery
Persist ranked-only mastery and use it consistently across progression, milestones, counts, and localized UI. Preserve mastery during history rebuilds, replay errors accurately, and generate replay-derived test profiles. Document the follow-up plan to remove the drill history cap.
2026-08-12 01:09:52 -04:00
thallada 0f8493eb02 style: tidy the thin-binary split
Follow-up cleanup to the previous commit:

- rustfmt src/run.rs. The mechanical crate:: qualification pushed lines
  past 100 chars and left 'use crate::i18n::t' out of sort order; the
  original main.rs had been rustfmt-clean. Verified whitespace-only:
  the token stream is identical modulo trailing commas and that one
  import moving to its sorted position.
- Drop #![allow(dead_code)] from lib.rs. It existed because the library
  was a benches-only shim exposing modules nothing called. Now that the
  lib IS the application, it masks nothing -- cargo check is warning-free
  without it, so removing it restores real dead-code detection.
- Collapse the duplicated explanatory comments. The rationale lived in
  both lib.rs and main.rs; state it once as a lib.rs doc comment and
  leave main.rs as the three lines it should be. Full history is in
  docs/BUILDING.md.
2026-08-07 01:13:17 +00:00
thallada f8d3bb5b2b docs(build): record the thin-binary layout and its measured effect
Replace the 'known remaining inefficiency' section with the layout that
now exists, plus the measured before/after (clean release build: 2m14s
-> 1m46s wall, keydr units 61.0s -> 32.4s, peak ~2.0 GB unchanged).

Add a maintenance note: new modules go in src/lib.rs, not src/main.rs.
Re-declaring them in the binary would silently restore the double
compile this refactor removed.
2026-08-07 01:08:44 +00:00
thallada 0a74fe3143 refactor: move the TUI into the library so it compiles once
src/main.rs re-declared the entire module tree (`mod app; mod config;
...`), which made the binary a second independent crate. Every module --
and the whole rust-i18n translation table generated by `i18n!` -- was
compiled twice, and 281 unit tests were executed twice.

Move all application code to src/run.rs inside the library, exposed as
`keydr::run()`. main.rs is now a 10-line entry point.

Mechanical changes only; no logic was altered:
- src/run.rs is src/main.rs minus the crate-root preamble
- `fn main()` -> `pub fn run()`; `struct Cli` -> `pub struct Cli`
- bare `use app::...` / inline `ui::theme::Theme` references are now
  qualified with `crate::` (19 imports, 342 inline references), since
  they are no longer resolving from the crate root

Clean release build, measured with --timings:

                        before      after
  keydr (bin)            33.7s       0.3s
  keydr (lib)            26.0s      31.0s
  keydr total            61.0s      32.4s   (-28.6s)
  total unit-seconds    292.2s     264.5s
  wall clock            2m14s      1m46s    (-28s, -21%)

Test coverage is unchanged: 341 unique tests before and after (verified
by diffing `--list` output, not just counts). The apparent drop from
622 to 340 executions is the duplicate run disappearing -- 281 tests
previously ran once per crate copy.

Verified the binary still works: --help/--version intact, TUI renders
its welcome screen under tmux, and translations resolve (checked both
English and German).

Note: `cargo check --benches` fails with 3 errors, but those are
pre-existing on main (NgramStat field renames) and unrelated.
2026-08-07 01:05:23 +00:00
thallada ce4a1a127d docs(build): quantify the double-compile cost instead of guessing
The previous text claimed restructuring main.rs to use the lib crate
would 'roughly halve' build time. Measured with --timings on a clean
release build, that was wrong:

  33.7s  keydr (bin)
  26.0s  keydr (lib)
   1.4s  generate_test_profiles (bin)
  61.0s of 292.2s total unit-seconds (21%)

The duplicated units are indeed the two slowest in the graph, but the
saving is ~26s of unit-work (less in wall time, since they overlap with
dependency compilation across 3 jobs), not half the build. The other
~79% is one-time dependency compilation that incremental builds skip.

Replace the estimate with the measurement.
2026-08-07 00:35:12 +00:00
thallada e2eb50eb85 docs(build): correct OOM-daemon guidance and add global cargo/systemd knobs
systemd-oomd is desktop-only on Ubuntu (reverse-deps are ubuntu-desktop*);
'systemctl is-enabled systemd-oomd' returns not-found on this server, so
the previous advice to enable it would simply have failed. Recommend
earlyoom instead, with --avoid/--prefer tuned to protect the shell and
target rustc.

Also document the machine-wide alternatives to per-project tuning:
- sudo systemctl set-property user-1000.slice MemoryHigh=/MemoryMax=
  (covers every shell and build; sshd lives in system.slice so it can
  never lock you out)
- global ~/.cargo/config.toml, which does support [profile.*]

Clarify that the MemoryHigh warning applies to short-lived build scopes,
not to slice-level limits where gradual throttling is appropriate.
2026-08-07 00:28:03 +00:00
thallada a728c758a7 perf(build): upgrade rust-i18n v3 -> v4 to fix codegen blowup
Release builds consumed 5+ GB and never completed on a 4-core / 7.6 GB
VM, thrashing the machine badly enough to lose SSH access.

Root cause was a codegen bug in rust-i18n v3, not machine size. Its
macro emitted one HashMap::from([...]) and one add_translations() call
per translation string, all in a single function body -- 8,652 of each
for our 21 locales / ~9,000 keys. LLVM scales superlinearly on function
size, so optimising that one initialiser took ~4.5 GB.

Verified via cargo expand (lib target):

                          v3.1.5    v4.2.1
  HashMap::from            8,652         0
  add_translations         8,652        21   (one per locale)
  expanded lines          93,026    73,444

Fixed upstream in v4.0.0.

Clean release builds, same machine:

  v3, opt-level=3, thin LTO      5.2 GB   stalled >18m, never finished
  v3, opt-level=1, no LTO        1.8 GB   15m30s   (previous workaround)
  v4, opt-level=3, thin LTO      2.08 GB  3m25s
  v4, stock cargo defaults       1.92 GB  2m17s

Also:
- Remove the opt-level=1 / lto=false workaround; cargo's release
  defaults are correct now. No shipped code is de-optimised.
- Keep only genuine small-machine hygiene in .cargo/config.toml:
  jobs=3 (keeps the box interactive), lld linker, and trimmed debug
  info on dev/test profiles.
- Document the diagnosis, the cargo expand / llvm-lines workflow that
  found it, and the systemd-based safety nets in docs/BUILDING.md.
- Note in main.rs why i18n! must appear in both crate roots (t! expands
  to crate::_rust_i18n_t, and main.rs re-declares the module tree
  rather than depending on the lib target).

Test suite passes; release binary verified working.
2026-08-07 00:17:21 +00:00
thalladaandGitHub d539c8abe7 Add screenshots to README
Added screenshots and details section to README
2026-05-19 17:16:02 -04:00
thalladaandTyler Hallada e018a742a3 Add README.md 2026-05-19 17:08:02 -04:00
thallada d6447d47b7 Intro pop-up fixes/tweaks 2026-04-18 00:27:12 -04:00
thallada b5ba61a3a3 Add adaptive drill intro, refactor key hints 2026-04-17 20:35:23 +00:00
thallada f855fa5606 Fix i18n of key unlock finger hint 2026-04-12 02:57:59 +00:00
thallada 232f93e054 Remove trigram anamoly calculation
Decided that this wasn't worth it and bigram anamolies are enough.
2026-04-11 00:11:45 +00:00
thallada d1fde5c0c1 Use better tab indicator characters
Works in more fonts/terminals.
2026-04-10 20:16:12 +00:00
thallada 7e13f73b8c Improve repo diversity in some code syntax languages 2026-03-31 05:18:42 +00:00
thallada eeb48157c5 Increase code syntax diversity, use github permalinks 2026-03-31 04:55:55 +00:00
thallada 79021db57f Fix random cycling of ALL code lang/book snippets/passages 2026-03-21 19:44:15 +00:00
thallada 01fc609f8f Fix terminal-default cursor color
Some terminal colors made it impossible to see the character underneath
the cursor.
2026-03-21 19:16:01 +00:00
thallada 84f4aabdff Add full set of locale translations
Generated using Claude Code / Codex so there may be errors
2026-03-17 05:05:32 +00:00
thallada 6d5de33f55 Internationalize UI text w/ german as first second lang
Adds rust-i18n and refactors all of the text copy in the app to use the
translation function so that the UI language can be dynamically updated
in the settings.
2026-03-17 04:29:25 +00:00
thallada 895e04d6ce Multilingual dictionaries and keyboard layouts 2026-03-06 04:49:51 +00:00
thallada f20fa6110d Licence compliance stuff 2026-03-01 05:13:29 +00:00
thallada 5c56a9c3c6 More balanced adaptive drill generation, Tab fixes, mouse control tweaks 2026-02-28 21:11:11 +00:00
thallada 8b8703b9b9 Mouse input improvements 2026-02-28 17:56:09 +00:00
thallada 7c1aad84af Mouse support & branch milestone popups 2026-02-28 07:25:40 +00:00
thallada 8e4f9bf064 Skill Tree page UI tweaks and improvements 2026-02-28 06:03:20 +00:00
thallada b37dc72b45 Various UI fixes, better capital letter injection, paginated history 2026-02-28 05:07:33 +00:00
thallada c67ddf577a Improve synthetic data in test profiles 2026-02-28 03:41:28 +00:00
thallada de236284ea Enhanced paith input with cursor navigation and tab completion in settings import/export 2026-02-28 03:19:38 +00:00
thallada ca2a3507f4 Create test user profiles to test skill progression 2026-02-28 02:02:39 +00:00
thallada da907c0f46 Prevent tests from writing to user data 2026-02-27 05:39:33 +00:00
thallada a088075924 Adaptive auto-continue input lock overlay 2026-02-27 02:31:37 +00:00
thallada 3ef433404e Increase adaptive drill word diversity 2026-02-26 21:33:16 +00:00
thallada 54ddebf054 N-gram metrics overhaul & UI improvements 2026-02-26 01:26:25 -05:00
thallada e7f57dd497 N-gram error tracking for adaptive drill selection 2026-02-24 14:55:51 -05:00
thallada 0c5a70d5c4 Fix some theme colors & drill summary delete continue 2026-02-22 21:23:13 -05:00
thallada f8bcad247b Fix kitty protocol, caps lock, code source desc 2026-02-22 16:51:34 -05:00
thallada 9d59c265dd Tweak value display in statistics keyboard visualizer 2026-02-22 15:28:05 -05:00
thallada 9deffc3d1d Import/export feature for config and data 2026-02-22 07:36:34 +00:00
thallada 9cc8a214ad Split up and clean up Keyboard Explorer detail stats 2026-02-20 23:44:31 +00:00
thallada 9e0411e1f4 Key milestone overlays + keyboard diagram improvements
Also splits out a separate store for ranked stats from overall key
stats.
2026-02-20 23:15:13 +00:00
thallada 4e39e99732 Some tweaks to pop-up UIs 2026-02-18 05:26:52 +00:00
thallada d0605f8426 Code drill feature parity, downloading snippets from github
Phase 1 and 2. Phase 3 will allow custom github repo input.
2026-02-18 05:16:04 +00:00
thallada 2d63cffb33 Passage drill improvements, stats page cleanup 2026-02-18 00:14:37 +00:00
thallada a61ed77ed6 Skill tree integration + tons of random fixes 2026-02-17 04:00:58 +00:00
thallada edd2f7e6b5 Add more themes and rustfmt 2026-02-16 22:12:29 +00:00
thallada 6d6815af02 Skill tree progression system & whitespace support 2026-02-15 07:30:34 +00:00
thallada 13550505c1 Consistently refer to drills as drills now, rename from lesson/practice
Also fix some issues in the stats screen.
2026-02-15 04:44:49 +00:00
thallada a51adafeb0 Continue into another drill after completing one 2026-02-15 00:41:59 +00:00