[docs] TauriPlatforms: Review, measurements on the tablet and Windows, lessons, gaps
This commit is contained in:
@@ -8,11 +8,11 @@ and **how to apply it**.
|
||||
|:--|:--|:--|
|
||||
| `soul.md` | none yet | What comforts and what only looks like comfort. **The most important file here.** No mechanic exists yet that could teach anything. |
|
||||
| `architecture.md` | none yet | Layering, ownership, seams. |
|
||||
| `design.md` | none yet | Wording, silence, empty states. |
|
||||
| [`design.md`](design.md) | 1 | Wording, silence, empty states. |
|
||||
| [`art.md`](art.md) | 3 | The image pipeline. |
|
||||
| [`code.md`](code.md) | 3 | TypeScript, Svelte, async ordering, Rust. |
|
||||
| [`technical.md`](technical.md) | 6 | The browser and the build as platforms. |
|
||||
| [`testing.md`](testing.md) | 10 | What makes a test worth having, and how a passing test lies. |
|
||||
| [`technical.md`](technical.md) | 8 | The browser and the build as platforms. |
|
||||
| [`testing.md`](testing.md) | 13 | What makes a test worth having, and how a passing test lies. |
|
||||
| `privacy.md` | none yet | What could leave the device or make a person findable. (The geocell finding is in the review, not here: it was caught before it cost anything.) |
|
||||
| [`process.md`](process.md) | 4 | Workflow, commits, credentials, honesty about what shipped. |
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Design lessons
|
||||
|
||||
What the player is shown and why: wording, silence, empty states (CLAUDE.md §5.1b).
|
||||
|
||||
## Words that are true in a browser can be false, and frightening, in an app
|
||||
|
||||
**What happened.** In the Android and Windows apps (2026-11-17, `feature/tauri-platforms`) *Keep her
|
||||
safe* said *This browser may clear her if the garden is not opened for a long time. A saved file
|
||||
keeps her for sure.* and offered *Ask the browser to keep her*. In an app there is no browser to ask,
|
||||
`persist()` always answers no, the inactivity warning is not true of an app's own storage, and on
|
||||
Android *Save her to a file* did nothing at all. The comfort became a worry with a broken remedy.
|
||||
|
||||
**Why it bit.** The words were written, carefully, for one place (a browser tab or an installed PWA)
|
||||
and were carried unchanged into another. Copy states facts about the platform; when the platform
|
||||
changes, the facts do.
|
||||
|
||||
**How to apply it.** When the game reaches a new platform, read every sentence that speaks about the
|
||||
device, the browser, storage or files, on that platform, and check that each claim is still true and
|
||||
each offered action still works. A remedy that silently fails is worse than none. Until then the
|
||||
platform is not shipped to players (here: G-T4, a release blocker).
|
||||
@@ -83,3 +83,30 @@ that was imagined, not the one that was built.
|
||||
|
||||
**How to apply it.** Before acting on a predicted trap, write the test that would show it, run it
|
||||
against the built app, and fix what fails. Then rewrite the trap's row with what was measured.
|
||||
|
||||
## A generated project is newer than anything you made before it
|
||||
|
||||
**What happened.** The first Android APK (2026-11-17) carried Tauri's logo. `scripts/icons.ts` copied
|
||||
Rosea's icons only when the target was older than `icon.svg`, but `tauri android init` had just
|
||||
written its own icon into `gen/android`, newer than both.
|
||||
|
||||
**Why it bit.** A date check answers "has the source changed since?", not "is this file mine?". A
|
||||
generator that runs later wins every date comparison.
|
||||
|
||||
**How to apply it.** Copy what must survive a generator unconditionally, and check it by content
|
||||
(`android.ts check` compares the icon's bytes). Then look at the artefact: the APK's own icon was
|
||||
hashed against ours.
|
||||
|
||||
## The proof of an app's permissions is the built package
|
||||
|
||||
**What happened.** Following Amicitia (its lessons/technical.md), `pnpm tauri:android` ends by reading
|
||||
the APK with `aapt2 dump permissions` and `dump xmltree`, and the device check reads
|
||||
`dumpsys package` on the tablet. The source manifest was right; the APK also held a
|
||||
`DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION` that the source never mentions (androidx merges it).
|
||||
|
||||
**Why it bit.** The manifest merge adds what libraries declare. A check on the source would never see
|
||||
a permission a library adds.
|
||||
|
||||
**How to apply it.** Check permissions, backup flags and WebView switches on the APK and on the
|
||||
installed package, and name each allowed exception precisely (this package's own receiver guard,
|
||||
not any app's).
|
||||
|
||||
@@ -146,3 +146,41 @@ asserts something the edge makes false.
|
||||
**How to apply it.** Bound every search to the region the test means (here: daytime on the
|
||||
pour's own local day), and when a test built on a search fails, print what the search
|
||||
returned before debugging the code under test.
|
||||
|
||||
## A constant the minifier folds cannot be found in the bundle
|
||||
|
||||
**What happened.** The first shell-build test (`apps/rosea-tauri/test/shell-build.test.ts`, 2026-11-17)
|
||||
asserted that the string `"tauri"` was in the built JavaScript, to prove `__ROSEA_SHELL__` was
|
||||
`'tauri'`. Vite replaces the constant, and the minifier then folds `'tauri' === 'tauri'` to `!0`:
|
||||
the string is gone whether the build was right or wrong.
|
||||
|
||||
**Why it bit.** A test that reads build output tests every step of the build, the minifier included.
|
||||
An assertion about a literal that only exists before minification is about the source, not the bundle.
|
||||
|
||||
**How to apply it.** Assert what the bundle must not contain (the constant's name, which would throw
|
||||
in the webview), and prove the behaviour where it runs: here, the device check.
|
||||
|
||||
## A window after a match can read the neighbour's value
|
||||
|
||||
**What happened.** The first APK check looked for a WebView switch's value in the 300 characters
|
||||
after its name in `aapt2 dump xmltree`. The next `<meta-data>` element starts within those 300
|
||||
characters, so a switch turned the wrong way could pass on its neighbour's value.
|
||||
|
||||
**Why it bit.** A fixed window feels safe because the right answer is inside it; so is a wrong one.
|
||||
|
||||
**How to apply it.** Read structured output by its structure (here: the value attribute on the line
|
||||
after the name attribute), and keep a test that flips exactly one value on real output and expects
|
||||
that one name back.
|
||||
|
||||
## A dropped device link is not a failed test, and must not look like a pass either
|
||||
|
||||
**What happened.** On 2026-11-17 the USB link to the Android tablet dropped at least twice within the
|
||||
hour (`device offline`; adb's transport id went 1 → 4 → 5), once between the two visits of the
|
||||
garden check, which then failed on `am force-stop`.
|
||||
|
||||
**Why it bit.** A real device is a second machine with its own life. Retrying everything hides real
|
||||
failures; retrying nothing makes the check a coin toss.
|
||||
|
||||
**How to apply it.** Retry only the failure that names the link (`offline`, `closed`, `no devices`),
|
||||
after `adb wait-for-device`, a bounded number of times; find the device handle again after a drop;
|
||||
let every other failure end the check at once. Report how many runs failed and why.
|
||||
|
||||
Reference in New Issue
Block a user