Skip to content

1.16 part 4/18: Home, Library and Settings in the browser - #175

Closed
epheterson wants to merge 1 commit into
line/1.16.0-03-stringsfrom
line/1.16.0-04-home
Closed

epheterson wants to merge 1 commit into
line/1.16.0-03-stringsfrom
line/1.16.0-04-home

Conversation

@epheterson

@epheterson epheterson commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Part 4 of 18 of Zimi 1.16.0: Home, Library and Settings in the browser. Base: line/1.16.0-03-strings (part 3); the diff shows only this part's files. The PR carries the not-a-release label and the version stays 1.15.7, so merging it cuts no release. Merge in order (1 to 17, then 18) with a merge commit, not a squash.

What this is

The browser side of Home, the Library and Settings: Home's layout at every width, one menu on every tile, row and card, touch targets of 44 px, no flash while Home boots, and the Almanac's files and words kept off Home's first load. It also holds Settings' new panels (Add-ons, Ready for offline, Deep check, the debug log switch, Library tidy). The server side of these panels is in parts 1 and 2.

What changes

  • zimi/static/app.js: Home's layout (Discover, then apps as launcher squares, then Favorites and the Library), the ⋯ menu and About sheet on every tile, row and card (_cardMoreHtml, _openZimAbout, _ziPop for Back and focus return), Discover's language badge, the "Did you mean" and no-result suggestion lines (applyDidYouMean, _suggestSheet), and the app About sheets.
  • zimi/static/app.js, Almanac loading: _i18nFetch, _mergeAlmanacWords and _loadAlmanacWords fetch i18n/almanac/<lang>.json only when the Almanac's first file runs. _almAsset adds ?v=<content hash> from __ZIMI_CONFIG.assets. The Moon's map loads in steps (_moonLoadMidMap, _moonLoadHiMapNow) and not until the Almanac opens.
  • zimi/static/manage.js: Settings panels for Add-ons (_addonsListHtml, _addonAct), Ready for offline (_renderOfflineReady), Deep check and the quick health check with Cancel (runDeepCheck, runLibraryHealth), a debug log switch, merge-or-replace on restoring data (_askReplace), Library tidy and older copies (_renderOlderCopies), and a per-ZIM auto-update switch. A reload returns to the same tab and filters (_syncManageUrl, _applyManageDeepLink).
  • zimi/static/app.css: 1,486 changed lines. The layout in one to four columns, compact tiles that fit names up to three lines, the hit-area boxes for controls drawn under 44 px (a transparent ::after in the coarse-pointer block), and the red night theme for the new surfaces.
  • zimi/static/tokens.css (new): one scale for type, radius, spacing, touch and motion, plus the shared neutrals and amber. The server inlines it in the shell's head and in front of apps.css, so it costs no request.
  • zimi/static/zimifooter.js and zimifooter.css (new): the "Zimi · Powered by Kiwix" line, one function drawn the same on Home, the Games and the Almanac.
  • zimi/templates/index.html: an inline script that sets the bar's first paint to what Home settles on (no re-layout on boot), preload links for the Almanac's files when the address is #almanac, alm-3d-boot for a reload into the 3D view, and the tokens and footer placeholders.
  • Tests: browser files (layout, tiles, touch areas, menus, corners, boot flash, scrollbars, Library tidy) and the node and Python files for the panels above, with tests/hit_area.py and tests/hit_probe.js as the shared probe.

How to review

  • Start with _loadAlmanacWords and _i18nFetch in zimi/static/app.js: one load per language, dropped on failure so the next ask retries, and the kept copy in localStorage as the offline answer. A wrong key split shows as a raw key name in a teaser card.
  • Then zimi/templates/index.html's boot script: it runs before the boot code and must set only what updateTopbar sets, or the bar flashes again.
  • Risk: touch handling and hit areas on a phone (app.css's coarse-pointer block, the ⋯ menu's history entry in _ziPop: Back closes the sheet before leaving the page).
  • Risk: Home's first load. tests/test_perf_budgets.py (part 17) holds the budget; check no new request is added before first paint.
  • Risk: manage.js actions that start downloads or installs (_addonInstall, _offlineGetAll) go through the admin routes in parts 1 and 2; check each is admin-only there.
  • Skip: app.css beyond the first read; its hunks are layout and theme rules each covered by a browser test.
  • Landed earlier: zimi/static/app.js is in part 1's diff (the Almanac ZIM's build reads named functions from it); the app.js changes listed here are reviewed there.
  • Rides here: tests/test_i18n_split.py (guards part 3's split and reads Home's scripts as they are at this tip), and small edits to tests/test_books_page.cjs, tests/test_tube_surface.cjs, tests/test_wiki.py and other tests that assert on strings or markup landing here.

Tests

  • Layout and tiles: tests/test_home_layout_live.py, tests/test_compact_tiles_live.py.
  • Touch: tests/test_touch_areas_live.py and tests/test_hit_areas_browser.py measure what elementFromPoint hands a finger; the count of controls under 44 px can only go down.
  • Menus: tests/test_home_more_menu.py.
  • Boot: tests/test_home_boot_flash_live.py samples every frame of a cold and warm load; tests/test_design_tokens.py checks tokens are declared once.
  • Library and Settings: tests/test_library_tidy.py, tests/test_manage_row_auto_update.cjs, tests/test_addons_row_browser.py, tests/test_settings_*.
  • tests/test_i18n_split.py: Home keeps every key its code names.
  • Most of these need a browser and run in the whole matrix, not this PR's quick tier.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@epheterson epheterson added the not-a-release Ships nothing; CI skips the version check label Nov 23, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Sorry @epheterson, your pull request is larger than the review limit of 150,000 diff characters

@epheterson epheterson mentioned this pull request Nov 23, 2026
@epheterson
epheterson force-pushed the line/1.16.0-03-strings branch from efa0b56 to 25339b7 Compare November 23, 2026 10:07
@epheterson
epheterson force-pushed the line/1.16.0-03-strings branch from 25339b7 to c25f54c Compare November 23, 2026 10:51
@epheterson
epheterson force-pushed the line/1.16.0-04-home branch 2 times, most recently from 581db33 to 958e666 Compare November 23, 2026 16:37
@epheterson
epheterson force-pushed the line/1.16.0-03-strings branch 2 times, most recently from 1a57b2d to 3bc60c8 Compare November 23, 2026 16:44
@epheterson

Copy link
Copy Markdown
Owner Author

Reviewed here; included in the release PR #189.

@epheterson epheterson closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-a-release Ships nothing; CI skips the version check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant