Commit Graph
19 Commits
Author SHA1 Message Date
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
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 7c1aad84af Mouse support & branch milestone popups 2026-02-28 07:25:40 +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 9deffc3d1d Import/export feature for config and data 2026-02-22 07:36:34 +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 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 a61ed77ed6 Skill tree integration + tons of random fixes 2026-02-17 04:00:58 +00:00
thallada 6d6815af02 Skill tree progression system & whitespace support 2026-02-15 07:30:34 +00:00
thalladaandClaude Opus 4.6 a0e8f3cafb Implement six major improvements to typing tutor
1. Start in Adaptive Drill by default: App launches directly into a
   typing lesson instead of the menu screen.

2. Fix error tracking for backspaced corrections: Add typo_flags
   HashSet to LessonState that persists error positions through
   backspace. Errors at a position are counted even if corrected,
   matching keybr.com behavior. Multiple errors at the same position
   count as one.

3. Fix keyboard visualization with depressed keys: Enable crossterm
   keyboard enhancement flags for key Release events. Track depressed
   keys in a HashSet with 150ms fallback clearing. Depressed keys
   render with bright/bold styling at highest priority. Add compact
   keyboard mode for medium-width terminals.

4. Responsive UI for small terminals: Add LayoutTier enum (Wide >=100,
   Medium 60-99, Narrow <60 cols). Medium hides sidebar and shows
   compact stats header and compact keyboard. Narrow hides keyboard
   and progress bar entirely. Short terminals (<20 rows) also hide
   keyboard/progress.

5. Delete sessions from history: Add j/k row navigation in history
   tab, x/Delete to initiate deletion with y/n confirmation dialog.
   Full chronological replay rebuilds key_stats, letter_unlock,
   profile scoring, and streak tracking. Only adaptive sessions update
   key_stats/letter_unlock during rebuild. LessonResult now persists
   lesson_mode for correct replay gating.

6. Improved statistics display: Bordered summary table on dashboard,
   WPM bar graph using block characters (green above goal, red below),
   accuracy Braille trend chart, bordered history table with WPM goal
   indicators and selected-row highlighting, character speed
   distribution with time labels, keyboard accuracy heatmap with
   percentage text per key, worst accuracy keys panel, new 7-month
   activity calendar heatmap widget with theme-derived intensity
   colors, side-by-side panel layout for terminals >170 cols wide.

Also: ignore KeyEventKind::Repeat for typing input, clamp history
selection to visible 20-row range, and suppress dead_code warnings
on now-unused WpmChart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 00:21:55 +00:00
thallada c78a8a90a3 First improvement pass 2026-02-10 23:32:57 -05:00