Skip to content

Web editor for the Acronymizer database (Compose Web + GitHub pipeline) - #2

Merged
kdroidFilter merged 8 commits into
masterfrom
feat/web-db-editor
Jun 14, 2026
Merged

kdroidFilter merged 8 commits into
masterfrom
feat/web-db-editor

Conversation

@kdroidFilter

@kdroidFilter kdroidFilter commented Jun 14, 2026 •

Copy link
Copy Markdown
Owner

A complete system to edit the acronymizer.db database from a Compose for Web app published on GitHub Pages.

What it does

  • Compose Web app (:editor, wasmJs primary + js fallback) built with compose-unstyled; full in-browser CRUD over the database (sql.js via the SQLDelight web-worker-driver).
  • English UI with Compose Resources i18n (English default + Hebrew strings) and automatic RTL (layout direction follows the browser locale).
  • GitHub token stored in a cookie; edits are auto-saved to localStorage (restored on reload) with a full reset.
  • The base is bundled into the app resources (no runtime repo fetch); it is regenerated from data/acronymizer.sql on every build/deploy.
  • Edits are exported as a deterministic SQL dump and a Pull Request is opened straight from the app (GitHub Git Data API).
  • Source of truth = deterministic SQL dump (data/acronymizer.sql); the binary .db is rebuilt in CI.
  • Workflows: pr-diff (semantic added/removed comment), release (publishes the .db on merge), deploy-pages (publishes the editor).
  • Shared :db module reusing the existing .sq schema (async codegen) with no duplication; the JVM :acronymizer tool is unchanged.
  • Bump Kotlin 2.4.0 / Compose 1.11.0.

Validated locally

  • Round-trip export-canonical -> build-db -> re-export is byte-identical.
  • diff-db is correct (added/removed books, acronyms, links).
  • :editor compiles and bundles for wasmJs and js.
  • Kotlin canonical header == scripts/canonical-header.sql (byte-for-byte).

One-time setup

Settings -> Pages -> Source = GitHub Actions (replaces the docs/ service).

Note: merging triggers release.yml (new public release) and deploy-pages.yml.

- New :editor Compose for Web app (wasmJs primary, js fallback) using
  compose-unstyled; full CRUD over the acronymizer DB in-browser (sql.js via
  SQLDelight web-worker-driver).
- New :db KMP module reusing the existing .sq schema (async codegen) without
  duplicating it; JVM :acronymizer left untouched.
- GitHub token stored in a cookie; edits auto-saved to localStorage (restored
  on reload) with a full reset.
- Source of truth is a deterministic SQL dump (data/acronymizer.sql); the .db
  is rebuilt in CI. Editor proposes a PR via the GitHub API.
- Workflows: pr-diff (semantic add/remove comment), release (publish .db on
  merge), deploy-pages (publish the editor).
- Bump Kotlin 2.4.0 / Compose 1.11.0.
@github-actions

github-actions Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

📊 Diff de la base Acronymizer

Précédent Proposé Δ
Livres 6878 6878 0
Acronymes 50528 50528 0
Liens 55813 55813 0

Ajouts : 0 livres · 0 acronymes · 0 liens — Suppressions : 0 livres · 0 acronymes · 0 liens

➕ Livres ajoutés (0)

aucun

➖ Livres supprimés (0)

aucun

➕ Acronymes ajoutés (0)

aucun

➖ Acronymes supprimés (0)

aucun

➕ Liens ajoutés (0)

aucun

➖ Liens supprimés (0)

aucun

…o-RTL

- The editor now loads its base from a bundled Compose resource (files/acronymizer.sql,
  copied from data/acronymizer.sql at build time) instead of fetching it from the repo —
  removes the runtime 404 and any branch dependency.
- Add Compose Resources i18n: English (default) + Hebrew strings; UI fully in English.
- Auto RTL: layout direction follows the active browser locale (Hebrew -> RTL).
- GitHub client: only add Authorization header when a token is present; drop unused dump fetch.
@kdroidFilter kdroidFilter changed the title Éditeur web de la base Acronymizer (Compose Web + pipeline GitHub) Web editor for the Acronymizer database (Compose Web + GitHub pipeline) Jun 14, 2026
Executing the whole ~9 MB dump in a single db.exec overflowed the sql.js wasm
memory (memory access out of bounds). Stream it as the header + 1000-line INSERT
batches inside one transaction. Validated with sql.js under Node: 6878 books /
50528 acronyms / 55813 links, view and Hebrew preserved.
Compose/Skiko on web ships no Hebrew-capable font, so Hebrew text did not render.
Bundle Heebo Regular/Bold (covers Latin for the English UI and Hebrew for the data,
including gershayim/geresh) and provide it via LocalTextStyle so every compose-unstyled
Text/TextField uses it.
Hebrew strings are now the default resource (dropped the English values-he split) and
the layout direction is forced to RTL regardless of browser locale.
…marter search

- Replace dingbat glyphs absent from Heebo: ✕ -> × (U+00D7); drop ✓ (use color/text).
- index.html: overflow:hidden so the page never shows native scrollbars (Compose scrolls).
- Wrap the book and acronym lists in compose-unstyled ScrollArea with a styled vertical scrollbar.
- Search now matches book titles AND their acronyms, ranking title-prefix matches first.
…d thumb

The lists now reserve a 14dp end gutter so rows never sit under the thumb, the
scrollbar track is top-aligned and 8dp wide, and the thumb fills the track width
with a rounded background (canonical compose-unstyled ScrollArea setup for 1.49.9).
The library's lazy scrollbar mis-estimated long lists. Compute the thumb directly
from LazyListState.layoutInfo (size + position), make it draggable (scrollBy), and
keep the reserved gutter so it never overlaps rows. Also alias to Unstyled* APIs to
drop deprecation warnings.
@kdroidFilter
kdroidFilter merged commit 32b3a69 into master Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant