Commit 25ac9ed
ci: typecheck the extension and run the Android unit tests (#282)
* ci: typecheck the extension and run the Android unit tests
`tsc --noEmit` never ran in CI (#152) and did not pass: the ambient asset
declarations in global.d.ts sat in a file that a top-level `import type`
had turned into a module, so every scss/svg/mp3 import failed to resolve,
and without skipLibCheck third-party typings failed too. That noise hid a
handful of real errors: a timer id typed as NodeJS.Timeout in a browser
file, a manifest override read off an untyped JSON import, and the
background message listener's implicitly-any parameters.
- keep global.d.ts a script (import() types instead of a top-level import)
- tsconfig: skipLibCheck, resolveJsonModule, explicit include
- fix the four real errors; the listener now narrows its message
- add `npm run typecheck` and a CI step for it
- run the Android JVM unit test suite as its own CI job (#151)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
* fix(android): every overlay that covers an app opens on the sky (#118, #196)
The fresh intervention already opens on the clock-matched loading sky with
the native sun blooming on it; what was left of #118 were the two sibling
overlays. The sleep wind-down window still fell back to the flat dark
ground, faded in over the blocked app for 300ms, forced a hardware layer
on its WebView (the very thing that makes an overlay WebView skip its
first composite), and had none of the first-frame nudges or the failed-
WebView teardown. The success sun window never opted out of system-bar
insets, so its gradient could leave an uncovered strip under the gesture
bar.
- CommonWindow: the initial shield is painted before addView through an
overridable hook; the first-frame hardening (alpha nudge, invalidate
pump) and the failed-WebView teardown move here so every WebView overlay
shares one copy instead of re-deriving it.
- LoadingSky: the sky backdrop composable and the local-hour helper are
shared rather than private to the intervention window.
- SleepWindDownOverlayWindow: instantly-opaque loading-sky shield,
transparent WebView over it, no forced hardware layer, the shared
hardening, full-screen insets.
- SuccessSunWindow: layout under the system bars and the cutout like its
siblings.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
* feat(android): say when minded can't see your apps
Detection lives inside the accessibility service and dies with it. The
permission checks catch the service being switched off, but not the
failure that actually happens in the field: the toggle still shows on
after an OEM kill or an update, nothing is bound, no intervention ever
fires, and a local-only app has no other way to tell the user it has
gone quiet.
- the service keeps a connected flag across onServiceConnected /
onUnbind / onDestroy
- the main bridge exposes it with the settings state as DetectionHealth
(JSON shape covered by a JVM test)
- the Android shell reads it on every refresh and shows one calm line
when enabled-but-unbound; the tap opens the accessibility settings,
where switching the service off and on re-binds it. A missing or
malformed read counts as watching, so the line can only ever appear
on a known fact - never on event silence, which an idle phone
produces too.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
* feat(settings): save a copy of your answers, and bring one back
All data is local and every platform is an island: the extension's sync
storage is small and prunes the oldest answers when it fills, a lost
phone takes its answers with it, and nothing moves between the
extension and the app. The answer journal is the most personal thing
minded holds, so it gets a way out that doesn't depend on us - a plain
JSON file the user keeps, restorable on any platform.
- journalBackup.ts: the file format (answers + custom questions),
tolerant parsing, and an additive merge by id that never overwrites
an existing entry and is idempotent; unit-tested
- fileTransfer.ts: Blob download on the extension; on Android the
bridge opens the system "save as" sheet (ACTION_CREATE_DOCUMENT), and
a plain <input type="file"> is routed to the document picker through
WebChromeClient.onShowFileChooser
- one "Your answers" section on both settings pages: Save a copy /
Bring a copy back, with a single result line
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
* refactor(interaction): pull pure logic out of the two orchestrators
InteractionCommon.tsx and Sun.tsx are the files every audit flags as too
large, and both kept growing anyway - each polish pass landed inside
them. This moves the pieces that don't need the component into tested
modules next to them, and adds a ratchet test that pins both files at
their new size so a change can't quietly add to either.
- interactionCommonHelpers.ts: the widget-line match and the two DOM
probes that were module-level in InteractionCommon
- interactionCornerSettle.ts: the Little Sun corner settle (arriving /
departing, per platform, honouring Android's dragged rest centre) and
the platform-sized phase settle
- sun/sunGeometry.ts: anchor point for a settle, rest scale, and the
rendered-translate parse
- sun/sunGlow.ts: the rest/hover glow constants with their reasoning,
the glow-axis temperature read, and the pointer-feedback scale
- the interaction's cleanup lists its frames and timeouts instead of
eleven copies of the same if-block
Behaviour is unchanged; the extracted functions are covered by unit
tests, and the full suite, typecheck, and production build pass.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
* fix: address review findings on the journal, detection line, and overlays
From an adversarial and a normal review of the branch:
- journal import on the extension: answers live in one browser sync item
of a few kilobytes, so a phone's journal was rejected wholesale. The
import now brings back the most recent imported answers that fit,
never touching the device's own, and says so plainly; a non-quota
failure gets a neutral message instead of a guessed cause. The quota
check moves to a platform-neutral module so the app bundles don't pull
in the extension's storage code.
- journal entries are rebuilt from known fields only; oversized picks
are refused before parsing
- Android "save a copy": the export is staged in a cache file, so a
process reclaimed behind the system picker can no longer leave the
chosen document empty; a second tap while the sheet is up is ignored
- detection line: sits above the optional-permissions invite (which
says "minded already works"), and the state is re-read shortly after
mount so a cold-start bind race can't leave a stale line standing
- CommonWindow owns the loading-sky shield behind one flag instead of
two copies in the intervention and wind-down windows
- Play internal and release builds run the Android unit suite before
bundleRelease (#151)
- copy: drop the "stays on this device" claim (untrue on the extension);
the size ratchet gets a few lines of headroom; README lists the new
checks and no longer names a landing-page directory that isn't here
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
* fix(android): restore MainActivity's companion and route helpers
The review-fix edit that staged the export in a cache file replaced the
whole span between saveTextFile and onCreate, taking the companion
object (widget intent extras, fade constants) and the intent-route
helpers with it. CI's first Kotlin compile of the branch caught it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vfDHpx2YT8CkxPPATgigc
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d6fd872 commit 25ac9ed
52 files changed
Lines changed: 2088 additions & 478 deletions
File tree
- .github/workflows
- android/app/src
- main/java/com/minded/minded
- detection
- overlay
- test/java/com/minded/minded/detection
- docs
- extension
- src
- android
- components/settingsAndroid
- main
- util
- __tests__
- dataInterface
- android
- extension
- pages
- background
- newtab/components/onboardingWeb
- options
- types
- util
- __tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
116 | | - | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
Lines changed: 94 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
62 | 123 | | |
63 | 124 | | |
64 | 125 | | |
| |||
229 | 290 | | |
230 | 291 | | |
231 | 292 | | |
| 293 | + | |
| 294 | + | |
232 | 295 | | |
233 | 296 | | |
234 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
235 | 324 | | |
236 | 325 | | |
237 | 326 | | |
| |||
451 | 540 | | |
452 | 541 | | |
453 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
454 | 548 | | |
455 | 549 | | |
456 | 550 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
152 | 178 | | |
153 | 179 | | |
154 | 180 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
107 | 118 | | |
108 | 119 | | |
109 | 120 | | |
| |||
313 | 324 | | |
314 | 325 | | |
315 | 326 | | |
| 327 | + | |
316 | 328 | | |
317 | 329 | | |
318 | 330 | | |
319 | 331 | | |
320 | 332 | | |
| 333 | + | |
321 | 334 | | |
322 | 335 | | |
323 | 336 | | |
| |||
358 | 371 | | |
359 | 372 | | |
360 | 373 | | |
| 374 | + | |
361 | 375 | | |
362 | 376 | | |
363 | 377 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments