Skip to content

feat(agenda): daily deadline cutoff, per-item timeline tails and restyled event cards - #38

Merged
PurpleRain-PR merged 26 commits into
mainfrom
refactor/drop-unified-completion
Nov 14, 2026
Merged

PurpleRain-PR merged 26 commits into
mainfrom
refactor/drop-unified-completion

Conversation

@PurpleRain-PR

@PurpleRain-PR PurpleRain-PR commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR adds

1. Daily pseudo-deadline window (opt-in)

A new settings page (Settings → DDL 每日伪截止), default off with a preset 22:00–08:00 window. Start/end times are picked with the native Material time picker (dial, with keyboard toggle); a separate minutes-precision text input is not needed and not offered.

  • A deadline due inside the window is displayed and laid out at the window start as its effective deadline. The real due time is never rewritten: the projection is presentation-only and lives in app settings, so toggling the window on/off or moving its hours can never overwrite user data.
  • Handles overnight windows (early-morning deadlines group to the previous night's start), inclusive endpoints, and a start equal to end — which then matches only that single instant, at minute precision.
  • On the timeline, an adjusted deadline draws a wide slanted band between the effective and real deadlines that scales with zoom, with the real marker faded and always painted last (even under overlap). Adjusted cards carry a compact label, and list rows show the original deadline underneath.

2. Timeline layout width — global default with per-item tails

  • A global layout width D (default 4 days, range 1–30) controls how far DDL cards and the event/exam info area reserve space to the left.
  • Per deadline, the editor's "更多选项" offers a 1–30-day tail slider plus a "跟随全局设置" switch. The choice is stored per entry as an optional tailDays — null/missing means follow the global setting, so existing files keep loading unchanged.
  • A developer-only migration button ("将默认拖尾长度设为 null", under 关于弹窗五次连击解锁的开发者选项) converts stored 4-day tails — including recycled entries — to follow-global in one write, leaving custom lengths alone. Nothing migrates automatically.

3. Event and exam timeline cards

  • The real span of an event or exam is painted as 45° two-tone wide stripes between the start and end markers, scaled to the actual duration.
  • The left info area (title, times, course, location) uses the matching hatch with an inward accent border, so a card reads as one continuous object.
  • A new 日程与考试信息栏 setting (default on) switches these cards to the old plain box style — title and time inside the box, left reservation released — without touching DDL or open-ended entries.

4. Consistency groundwork

One shared caption helper now renders the time line for every card style (deadline, event, exam), and the timeline grid header reuses the same short-day formatter; the 1–30 day tail range is sourced from a single model constant used by the editor, the settings page and layout validation alike.

Data & compatibility

  • New optional tailDays key in the agenda JSON; absent means inherit. No storage schema change and no load-time writes.
  • The cutoff window is saved as app settings only; enabling, re-timing or disabling it never writes agenda files.

Docs

New docs/deadline-cutoff.md (time rules, layout reservation, card styling); docs/architecture.md updated.

Testing

GitHub Actions on the PR head is the arbiter for all builds and the full widget/unit suite.

PurpleRain-PR and others added 24 commits November 9, 2026 12:04
Preserve native scrolling, stable lane projection, card caching, storage migration and custom colors from main while retaining feature layout, UI and completion semantics.
Add a settings switch (on by default) that hides the left information
card of ordinary events and exams in the timeline: its text, stripes and
inner border disappear and the layout no longer reserves the lead, so
back-to-back intervals share a lane. Real intervals, boundary lines and
taps are untouched, and deadlines keep their own information cards.

Restyle the visible information region: the inner half-line border now
uses the accent color, and the 45-degree bands alternate between the
solid fill and its half alpha instead of the previous .5/.25 pair.
Completion fading still multiplies the existing alpha.

Includes persistence, projection, pixel and settings-switch regressions.
Paint the real event/exam interval as 45-degree two-color bands that
alternate the whole fill and the accent, the fill band first at the
start line, both only faded by the completion factor. This reuses the
shared stripe painter through a new optional secondColor.

A hidden information card previously clipped the start indicator, which
is drawn left of its time, against the surface now beginning exactly at
the real start. The painted surface keeps one line width of lead in the
hidden state so the start line stays visible at its true position;
lane reservation stays at the real interval.
The settings ListView builds children lazily, so the switch row did not
exist for ensureVisible yet.
A cascade expression is not a valid operand of a conditional
expression; the release kernel compiler rejects it. Choose the band
color into a local first.
The lessThan matcher needs the < operator, which DateTime does not
implement; assert the exact projected start instead.
Erases the exam/event overdue-and-completion state model introduced by 90f0f69: the persisted completion fields, the one-shot exam auto-completion clock, the completion-aware write paths, widget derivation, tests and docs. Exams and events fall back to the pre-feature elapsed semantics where past entries fade through isFinished; the DDL completion path is untouched.
Use global layout width as the fallback for individual DDL tail lengths, restore the editor controls, and preserve overrides during sync.

Restore legacy event boxes when information bars are disabled, simplify settings copy, and reuse the existing time picker for deadline cutoffs.

(cherry picked from commit 73b6b3b)
Expose a developer action to reset four-day DDL tails to null, including recycled entries, while retaining other widths and reporting the migrated count.

Keep inheritance in the existing tailDays field and cover default editor state, persistence, repeated migration, and write failure recovery.

(cherry picked from commit 34bbb87)
Paint every timeline card style from one caption helper, and let the existing AgendaEntry constants be the only source for the one to thirty day tail range.

The preview status line keeps its isFinished branch: on this branch finishing a card still follows elapsed time, so the ended state is reachable and must stay.

Card text, semantics, validation, persistence and error copy stay identical; the shared day marker also replaces the grid header's own copy.

(cherry picked from commit 619fe86)
@PurpleRain-PR PurpleRain-PR changed the title Refactor/drop unified completion refactor(agenda): drop the unified completion model, then replay #36 on top Nov 14, 2026
…-completion

# Conflicts:
#	docs/architecture.md
The panel's children had no top padding, so the first outlined field's
floating label was clipped at the expansion area's hard edge. Only
event/exam editing hit it, where the location field leads the children.
@PurpleRain-PR PurpleRain-PR changed the title refactor(agenda): drop the unified completion model, then replay #36 on top feat(agenda): daily deadline cutoff, per-item timeline tails and restyled event cards Nov 14, 2026
@PurpleRain-PR
PurpleRain-PR marked this pull request as ready for review November 14, 2026 08:27
@PurpleRain-PR
PurpleRain-PR merged commit ad859ba into main Nov 14, 2026
11 checks 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.

2 participants