The app gets its look and navigation before more features land on them. - Theme (core/theme/): hand-written light and dark Material 3 colour schemes around cobalt and copper; ThemeExtras for the colours Material has no role for (states, the four FSRS ratings); the 20 colours a person can give content. Tests hold text to WCAG AA contrast on each palette colour and on the dark theme's primary colour and surface. - Layout and shared widgets: Material 3's window-size classes (core/layout/); SectionCard, AppLoadingIndicator, confirmDestructiveAction and FoundById (core/widget/). Lucide icons. - Navigation with go_router: four tabs (Home, Library, Explore, Profile), each keeping its own stack of screens, as a navigation rail with the app's icon from 600 dp and as a navigation bar below; choosing the open tab again returns to its first screen. A studyset's screen sits in the library; studying, cards and settings cover the tabs. - Routes carry ids: FoundById finds the item in the repository's live list, so a studyset deleted on another device, or an old link, says it no longer exists. A screen that deletes its own item keeps showing it while it closes, rather than flashing that message. - Every person gets an app of their own (PersonApp, lib/src/app/): a MaterialApp.router with its own GoRouter and PersonScope around the navigator, built by SessionGate inside the person's keyed subtree. Screens read the person's repositories wherever they are built, so the static route() helpers and the listener that closed every pushed screen on a change of person are gone: a change of person now disposes the whole router and starts again at home. - The account dialog becomes the Profile tab, with Settings (sign out, delete the account, About) behind a gear. A waiting GitHub sign-in now keeps waiting while another tab shows; a change of person still cancels it. - The new screens' strings come from Flutter's gen-l10n (English for now). The generated files are committed, left out of analysis and formatting, and written anew by `flutter pub get`, so CI's check of generated code also catches stale ones. Widget tests now start the whole app (test/support/pump_app.dart) at the screen's path and move through it as a person would, by tabs and taps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
46 lines
1.6 KiB
Shell
Executable file
46 lines
1.6 KiB
Shell
Executable file
#!/usr/bin/env bash
|
|
# The checks every push has to pass: formatting, static analysis (infos are fatal too), and
|
|
# the server's and the app's tests. The pre-push hook runs this script, and so does CI on
|
|
# every push (.forgejo/workflows/ci.yaml).
|
|
#
|
|
# Install the hook in a fresh clone: ln -s ../../tool/check.sh .git/hooks/pre-push
|
|
# Skip it for one push: git push --no-verify
|
|
#
|
|
# It checks the working tree, so uncommitted changes count as well.
|
|
set -euo pipefail
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
if ! git diff --quiet HEAD; then
|
|
echo 'Note: the working tree has uncommitted changes; they are checked too.'
|
|
fi
|
|
|
|
# Our own Dart files. Generated code is left out: the client package as a whole, the
|
|
# server's generated sources and test tools, and the app's localizations (gen-l10n). (A
|
|
# loop instead of mapfile: macOS ships bash 3.)
|
|
own=()
|
|
while IFS= read -r file; do own+=("$file"); done < <(
|
|
git ls-files '*.dart' |
|
|
grep -v -E '^halkyon_learn_client/|/lib/src/generated/|/serverpod_test_tools\.dart$|/lib/l10n/app_localizations'
|
|
)
|
|
|
|
echo '▸ Formatting'
|
|
if [ ${#own[@]} -gt 0 ]; then
|
|
dart format --output=none --set-exit-if-changed "${own[@]}"
|
|
fi
|
|
|
|
echo '▸ Analysis'
|
|
dart analyze --fatal-infos
|
|
|
|
echo '▸ Server tests'
|
|
if git ls-files 'halkyon_learn_server/test/*_test.dart' | grep -q .; then
|
|
(cd halkyon_learn_server && dart test)
|
|
else
|
|
echo 'No server tests yet.'
|
|
fi
|
|
|
|
echo '▸ App tests'
|
|
# The sync tests need `serverpod start` running; run them by hand with
|
|
# `flutter test -t requires-server` in the app package.
|
|
(cd halkyon_learn_flutter && flutter test -x requires-server)
|
|
|
|
echo '✓ All checks passed.'
|