Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9517b88
feat(cli): add learning platform course export (#5)
meashgrey Sep 27, 2026
ea15e04
feat(cli): reconnect (#5) expired sessions for protected commands
meashgrey Sep 27, 2026
de92984
feat(study): add course (#5) catalog UI for desktop and mobile
meashgrey Sep 28, 2026
07a5aec
refactor(test): group tests by scope and feature (#5)
meashgrey Sep 28, 2026
1aa63e4
style(study): refine course list font size
meashgrey Sep 28, 2026
3121f80
feat(cli): add Learn homework counts
meashgrey Oct 14, 2026
65b9fe2
feat(study): show unsubmitted homework badges (#5)
meashgrey Oct 14, 2026
b861616
feat(homework): add cached assignment overview (#5)
meashgrey Oct 22, 2026
ffd0dd5
feat(cli): add learn materials listing (#5)
meashgrey Oct 22, 2026
7953124
feat(cli): download (#5) learn course materials
meashgrey Oct 29, 2026
4d4c01c
agents: update project instruction for agents
meashgrey Oct 29, 2026
d93b570
refactor(cli): split command dispatch from runtime
meashgrey Oct 29, 2026
ab700a8
Merge branch 'main' into feat/courses-info
meashgrey Nov 5, 2026
5a85dbf
fix(nix): provide libsecret for Linux CLI secure storage
meashgrey Nov 17, 2026
be0031b
fix(nix): include SDK components required by Android JNI builds
meashgrey Nov 17, 2026
2484252
style: replace course and assignment list borders with dividers
meashgrey Nov 17, 2026
3305b6d
style(assignment): keep assignment backgrounds stable and actions she…
meashgrey Nov 17, 2026
f1752d8
feat(study): add course content browsing and document previews
meashgrey Nov 17, 2026
fdf6032
refactor(ui): unify quiet surfaces, copy and page transitions
meashgrey Nov 17, 2026
9230e75
fix(auth): coordinate session recovery across app screens
meashgrey Nov 17, 2026
ba0f97a
fix(auth): reuse trusted-browser SSO across login stages
meashgrey Nov 17, 2026
d4774f3
fix(auth): isolate Learn failures from university session recovery
meashgrey Nov 18, 2026
8ea3357
feat(diagnostics): export persistent logs and repair session renewal
meashgrey Nov 18, 2026
5857321
fix(auth): handle trusted-device registration failures explicitly
meashgrey Nov 18, 2026
c6dd90a
chore(format): add format command
meashgrey Nov 19, 2026
b16b707
ci: align Flutter SDK with locked dependencies
meashgrey Nov 19, 2026
01ca134
fix(windows): remove unavailable PDFium version override
meashgrey Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .agents/skills/thulium-ui/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
name: thulium-ui
description: Implement or review Thulium Flutter screens, UI copy, lists, interaction states, loading, and navigation using the project's restrained Forui design language. Use for Thulium UI changes, not generic website design or backend-only work.
---

# Thulium interface

Thulium is a campus tool for students checking courses, deadlines, files, and
calendar plans. Prioritize finding real information quickly. The established
identity is a quiet neutral surface, readable text, compact rows, fine dividers,
and color reserved for urgency, categories, selection, and errors.

## Start from the implementation

Read repository `AGENTS.md` and the affected screen. Check the Forui version in
`pubspec.yaml`: online docs may describe APIs newer than the pinned dependency.
Use the installed package source to confirm a style or variant API. Reuse:

- `lib/widgets/flat_tile_style.dart` for list groups and rows
- `lib/widgets/app_page_scaffold.dart` for nested page chrome and reading width
- `lib/navigation/app_page_route.dart` for pushed routes
- `lib/widgets/course_content_loading.dart` for course loading surfaces

## Calendar boundary

The user has approved the central calendar panel. Preserve its grid, layout,
colors, and interactions during general UI work. Shared navigation outside the
panel may be updated; changing the panel itself needs an explicit user request.

## Surfaces and hierarchy

- Use `context.theme` colors, typography, spacing, and border tokens. Keep light
and dark themes coherent. The neutral dark reference is background `#09090B`,
foreground `#FAFAFA`, muted foreground `#A1A1AA`, border `#27272A`; these are
design references, not permission to hard-code runtime colors.
- Use the existing system type family. Titles are semibold; metadata is smaller
and muted. Keep the same left edge and page padding through a navigation flow.
- Courses, assignments, and file lists use a single page surface and thin lines
between adjacent rows. Do not add per-row boxes, outer list borders, stacked
cards, shadows, or gradients. Preserve meaningful badges and deadline colors.
- Navigation rows keep the page background on press and hover. Retain a visible
keyboard focus outline, semantic labels, and practical touch targets. Selected
controls and destructive buttons still need their semantic interaction states.
- Use Forui controls and Lucide icons for product surfaces. Flutter layout and
platform integration are fine; avoid Material-styled product controls.

## Copy

- Short titles, labels, notices, empty states, and slogans normally have no final
period in English or Chinese. Preserve questions, necessary punctuation within
multi-sentence explanations, decimal numbers, and file extensions.
- A title plus an icon should usually explain a navigation action. Do not add
subtitles that restate them or explain the categories on the following screen.
- Keep actual content metadata: instructor, schedule, file size/type, deadline,
and assignment state. These are not slogans.
- Loading, errors, and empty states should explain the current state concisely.
Provide an action when it helps. Keep safety-critical explanations intact.
- Put interface copy in `lib/l10n/app_en.arb`, translate the other ARBs, and run
`flutter gen-l10n`. Update affected copy assertions. Do not trim translations
at render time or silently rewrite user-provided course/document content.

## Navigation and asynchronous content

- Keep back/title/action placement and background stable from course detail to
files or assignments to document preview. Forms and settings use the same
nested-page shell. Calendar grids can retain their dense, full-width layout.
- Use the shared route: a short fade with a small directional horizontal offset
on navigation. Honor reduced motion with zero duration. Avoid unanimated
`PageRouteBuilder`, inconsistent platform transitions, decorative page-load
entrances, or staggered list-item animation.
- Keep existing content visible during refresh. Show progress in an existing
action slot; don't replace the whole page with an empty spinner.
- Match loading placeholders to the eventual layout. Use the same document
loading surface while fetching bytes and opening the native PDF renderer.
Loading-to-content transitions should be brief and honor reduced motion.
- Do not invert document pages to simulate dark mode. Theme the viewer chrome
and surrounding surface; keep the document's actual colors.
- Preserve cached campus information if background reauthentication needs user
verification. Offer an explicit sign-in action rather than an abrupt redirect.

## Review and finish

Check the affected flow in both themes and on a narrow screen. Check pressed
rows, keyboard focus, long titles, loading, empty/error states, refresh, back
navigation, and reduced motion where relevant. Prefer screenshots for visual
review when the environment supports them; describe device-only gaps honestly.
Run relevant analysis and behavioral tests. Include a Git commit description
that matches the actual diff and any new untracked files.

## Reference documentation

Use these for interaction and composition principles, not as pixel templates or
permission to replace Flutter with React:

- [Forui themes](https://forui.dev/docs/concepts/themes)
- [Forui tile groups](https://forui.dev/docs/widgets/tile/tile-group)
- [Forui widget styles](https://forui.dev/docs/guides/customizing-widget-styles)
- [shadcn/ui items](https://ui.shadcn.com/docs/components/item)
- [shadcn/ui separators](https://ui.shadcn.com/docs/components/separator)
- [shadcn/ui semantic themes](https://ui.shadcn.com/docs/theming)
4 changes: 4 additions & 0 deletions .agents/skills/thulium-ui/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Thulium UI"
short_description: "Maintain Thulium’s quiet Forui interface"
default_prompt: "Use $thulium-ui to implement or review a Thulium interface change"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.44.8
flutter-version: 3.47.4
cache: true

- name: Run project quality checks
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.44.8
flutter-version: 3.47.4
cache: true

- name: Run project quality checks
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.44.8
flutter-version: 3.47.4
cache: true

- name: Build Android APK
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.44.8
flutter-version: 3.47.4
cache: true

- name: Install Linux build dependencies
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
- name: Set up Flutter and Dart
uses: subosito/flutter-action@v2
with:
flutter-version: 3.44.8
flutter-version: 3.47.4
cache: true

- name: Prepare CLI output directory
Expand Down
29 changes: 29 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Interface Style

For Thulium UI work, consult `.agents/skills/thulium-ui/SKILL.md` for shared
components, copy, interaction states, navigation, and review conventions.

Use a restrained, dark, minimalist visual language for Thulium, consistent with
the existing calendar and Forui components.

- Prefer Forui components and their theme tokens. Keep surfaces simple, with
clear hierarchy, fine borders, compact spacing, and consistent interaction
states.
- Use near-black backgrounds, subtle grid lines, and low-contrast cards for
dense calendar views. Reserve saturated colors for meaningful categories,
urgency, selection, or other necessary emphasis.
- Favor legible typography, concise labels, and predictable alignment. Let
spacing, weight, and a small number of semantic colors establish hierarchy
instead of decoration.
- Keep shadows, gradients, rounded containers, and ornamental effects subtle.
Avoid visual clutter and unnecessary card-on-card layouts.
- Maintain sufficient contrast and readable text in both light and dark themes;
use the shared theme rather than hard-coding colors when practical.
- Keep interactions visually quiet and consistent: use unobtrusive controls,
clear selected and focus states, and touch targets appropriate to each
platform.
- Do not introduce Material-styled widgets into Forui product surfaces. Use the
existing project patterns for platform integration where needed.
- Preserve the accepted central calendar panel: its grid, layout, colors, and
interactions should remain unchanged during general UI refactors unless the
user explicitly requests changes to that panel.
78 changes: 5 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Thulium is a cross-platform Flutter application for Tsinghua University
students. It uses [Forui](https://github.com/duobaseio/forui) for UI components
and reserves `packages/cli` for future Dart command-line tools.
and reserves `packages/cli` for Dart command-line tools.

## Development

Expand All @@ -11,75 +11,7 @@ flutter pub get
flutter run -d chrome
```

The project currently uses Forui `0.22.x`, which is compatible with Flutter
3.44. Forui `0.26.x` requires Flutter 3.47 or newer; upgrade the dependency
after upgrading Flutter.

## Localization

Application strings are stored in ARB files under `lib/l10n` and generated with:

```bash
flutter gen-l10n
```

Add new user-facing strings to `app_en.arb` first, then add translations to the
other locale files. Do not put localized text directly in Dart source files.

## Authentication

Authentication logic is shared by the Flutter application and the future CLI
through `packages/auth`. The Flutter application uses `SecureAuthSessionStore`,
which persists the authenticated session and reusable credentials under separate
keys in platform secure storage. Passwords are never included in the shared
session model or calendar cache.

## CLI authentication

The Dart CLI provides interactive authentication and persists the resulting
session in the operating system credential store:

```bash
cd packages/cli
dart run bin/thulium.dart login
dart run bin/thulium.dart login --verbose
dart run bin/thulium.dart status
dart run bin/thulium.dart schedule
dart run bin/thulium.dart schedule --refresh
dart run bin/thulium.dart logout
```

The optional `--verbose` flag prints safe authentication diagnostics for
troubleshooting. It never prints passwords, verification codes, or cookie
values. The CLI never accepts the password as a command-line argument and never writes
it to a project file. Linux uses Secret Service and macOS uses Keychain. Other
platforms will report that a secure session backend is not available until one
is added.

The application and CLI cache the current academic calendar per account in
platform secure storage. A successful fetch is reused for 24 hours; an older
copy can be shown if the portal is temporarily unavailable. Manual refresh and
`schedule --refresh` request a new copy instead of silently using stale data.
Logging out removes the saved calendar.

Interactive login attempts can be retried after credential, verification-code,
or network errors. Each retry starts a fresh authentication flow.

## Project structure

```text
lib/ Flutter application
lib/l10n/ ARB resources and generated localization code
packages/auth/ Shared Dart authentication and session library
packages/cli/ Standalone Dart CLI package for future tools
android/ ios/ web/ Mobile and web targets
linux/ macos/ windows/ Desktop targets
```

## Checks

```bash
flutter analyze
flutter test
dart analyze packages/cli
```
Use Flutter `3.47.4`, matching the pinned Nix development environment, CI and
release workflows. Flutter's SDK packages constrain several test dependencies,
so a different SDK version may require changes to `pubspec.lock` and fail
`--enforce-lockfile`. The project currently uses Forui `0.22.x`.
27 changes: 24 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,39 @@
{
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs = import nixpkgs {
inherit system;
config = {
android_sdk.accept_license = true;
allowUnfreePredicate = pkg:
(pkg.meta.homepage or "") == "https://developer.android.com/tools";
};
};
androidSdk = pkgs.androidenv.composeAndroidPackages {
# jni_flutter compiles against API 35; the app uses API 36.
platformVersions = [ "35" "36" ];
buildToolsVersions = [ "36.0.0" ];
includeCmake = true;
cmakeVersions = [ "3.22.1" ];
includeNDK = true;
ndkVersions = [ "28.2.13676358" ];
};
in
{
default = pkgs.mkShell {
packages = with pkgs; [
flutter
git
just
];
jdk17
androidSdk.androidsdk
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.libsecret ];

ANDROID_HOME = "${androidSdk.androidsdk}/libexec/android-sdk";
ANDROID_SDK_ROOT = "${androidSdk.androidsdk}/libexec/android-sdk";

shellHook = ''
echo "Thulium development shell ready. Run 'flutter pub get' to fetch dependencies."
echo "Thulium Flutter and Android development shell ready."
'';
};
});
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ auth-deps:
cli-deps:
cd packages/cli && {{ DART }} pub get --enforce-lockfile

format:
{{ DART }} format lib test packages/auth/lib packages/auth/test packages/cli/bin packages/cli/lib

format-check:
{{ DART }} format --output=none --set-exit-if-changed lib test packages/auth/lib packages/auth/test packages/cli/bin packages/cli/lib

Expand Down
Loading
Loading