Skip to content

feat(app): new compact date range view option for UI and Print for upcoming events - #5321

Open
ux-git wants to merge 3 commits into
sws2apps:mainfrom
ux-git:feat_flexible_event_dates
Open

feat(app): new compact date range view option for UI and Print for upcoming events#5321
ux-git wants to merge 3 commits into
sws2apps:mainfrom
ux-git:feat_flexible_event_dates

Conversation

@ux-git

@ux-git ux-git commented Jul 27, 2026

Copy link
Copy Markdown
Member

Description

duration was encoding two separate things: how long an event spans, and whether it has a specific time. That conflation is why a single-day circuit overseer visit forced a start and end time, and why only Special Campaign weeks collapsed to a date range.

This splits the two axes:

  • wholeDay added to event data, defaulted per category alongside duration. When absent it falls back to duration === MultipleDays, so existing records render exactly as before and no migration is needed.
  • Single-day events get a "Whole day" toggle; the times collapse when it is on. New events default to 09:00-10:00 rather than the current clock time and an arbitrary five-hour span.
  • Picking the start date of a circuit overseer visit prefills the end date with that week's Sunday.
  • How multi-day events are laid out is a congregation setting, surfaced both under "Meeting materials, forms and schedules" and as a quick setting on the events page. Events longer than 7 days always collapse to a range, which keeps two-week campaigns on one line without special-casing the category.
  • The ICS export keys off wholeDay instead of duration, so a whole-day event now exports as an all-day entry.

Two pre-existing bugs fixed along the way:

  • The PDF export read the unfiltered event list while the on-screen list filtered by data view, so a language group printed every other group's events alongside its own.
  • Deleting an event went through on a single click; it now asks for confirmation.

Also corrects the names of UpcomingEventCategory members 7 and 8, which were swapped relative to the decorations table. The stored value is the array index, so the table order is deliberately left alone and no records change meaning.

Fixes #4597

Note for reviewers

Congregations created before this release have no stored value for the new setting. There is no settings migration mechanism in the project, so the three read sites fall back to the schema default, following the same pattern as first_day_week and schedule_songs_weekend. Nothing existing is rewritten.

One deliberate behaviour change: a Special Campaign of 7 days or fewer now renders as a day list rather than a single row, because the default is "Separate days". Campaigns of two weeks, the common case, are unaffected.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

ux-git added 2 commits July 27, 2026 12:57
The shared rules that recolour icons (`& svg, & svg g, & svg g path`, in
menuitem, textfield, dashboard menu and elsewhere) only reach a path
nested inside a <g>. Every other icon in the set wraps its shapes that
way; the cart did not, so none of its twelve shapes matched and the
inline fill stayed black on hover. The same gap is why theme_switch had
to hand-patch `& svg ellipse` for its own icon.

Wrap the shapes in a <g>, and express the wheel as a path rather than an
<ellipse> so `svg g path` reaches it too. The path draws the same
geometry — both give a bbox of 15.317,18.894 3.457x4.502. The artwork is
otherwise untouched.
DatePicker already forwards both to its text field slot. TimePicker
renders a PickersTextField, which supports them just as well, so expose
the same two props rather than making callers render their own error
line underneath.
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
staging-organized-app Ready Ready Preview Jul 27, 2026 3:05pm
test-organized-app Ready Ready Preview Jul 27, 2026 3:05pm

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR adds whole-day event editing, configurable multi-day display modes, data-view filtering, shared event formatting/grouping, delete confirmation, and updated calendar/PDF rendering. It also forwards TimePicker validation props and updates the cart icon SVG structure.

Changes

Upcoming event flexibility

Layer / File(s) Summary
Event contracts and display settings
src/definition/..., src/services/dexie/schema.ts, src/states/..., src/features/congregation/settings/..., src/pages/activities/upcoming_events/...
Adds whole-day and display-mode types, persists per-data-view display settings, filters events by data view, and exposes administrative quick settings.
Event selection and formatted output
src/services/app/upcoming_events.ts, src/features/activities/upcoming_events/upcoming_event/..., src/features/activities/upcoming_events/export_upcoming_events/..., src/views/activities/upcoming_events/...
Centralizes event grouping, computes wholeDay and showAsRange, and applies those fields to rendering and PDF export.
Event editing and calendar behavior
src/features/activities/upcoming_events/edit_upcoming_event/..., src/features/activities/upcoming_events/add_to_calendar/..., src/components/time_picker/...
Adds whole-day toggling, end-date/time validation, delete confirmation, date normalization, whole-day ICS formatting, and TimePicker validation forwarding.
Cart icon SVG structure
src/components/icons/IconCart.tsx
Wraps icon paths in a group and replaces the wheel ellipse with a path.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant MultiDayDisplay
  participant SettingsStore
  participant UpcomingEventsState
  participant UpcomingEventData
  participant UpcomingEvent
  Admin->>MultiDayDisplay: choose display mode
  MultiDayDisplay->>SettingsStore: persist events_multiday_display
  UpcomingEventsState->>UpcomingEventData: provide filtered event
  SettingsStore-->>UpcomingEventData: provide display setting
  UpcomingEventData-->>UpcomingEvent: return wholeDay and showAsRange
  UpcomingEvent->>UpcomingEvent: render timed, daily, or range output
Loading

Possibly related PRs

Suggested reviewers: rhahao

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR makes range rendering optional and defaults short multi-day events to day lists, so it does not fully meet the requested concise PDF ranges. Render multi-day events as date ranges in PDF exports by default, or update #4597 to reflect the new opt-in display setting.
Out of Scope Changes check ⚠️ Warning The PR includes unrelated work like deletion-confirmation UI and icon updates that are not required by #4597. Split unrelated fixes such as delete confirmation and icon changes into separate PRs, leaving only the event-date and PDF work here.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately highlights the new compact date range view option for upcoming events, which is a major part of the PR.
Description check ✅ Passed The description matches the implemented event display, export, and deletion changes, so it is clearly related to the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

@ux-git ux-git changed the title feat(upcoming-events): flexible event dates and PDF output feat(app): upcoming events – new compact date range view option for UI and Print Jul 27, 2026
@ux-git
ux-git force-pushed the feat_flexible_event_dates branch from 52ae7cf to 1969aa0 Compare July 27, 2026 12:38
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 27, 2026
@mergify

mergify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

coderabbitai[bot]

This comment was marked as resolved.

Closes sws2apps#4597.

`duration` was doing double duty: it encoded both how long an event
spans and whether it has a specific time. That conflation is why a
single-day circuit overseer visit forced a start and end time, and why
only Special Campaign weeks collapsed to a date range.

Split the two axes:

- add `wholeDay` to event_data, defaulted per category alongside
  `duration`. Absent means `duration === MultipleDays`, so existing
  records render exactly as before and no migration is needed.
- single-day events get a "Whole day" toggle; the times collapse when it
  is on. Pioneer meeting keeps its times, a circuit overseer visit does
  not.
- new events default to 09:00-10:00 rather than the current clock time
  and an arbitrary five-hour span.
- the end of an event is validated against its start, and the end time
  shifts along when the start passes it.
- picking the start date of a circuit overseer visit prefills the end
  date with that week's Sunday, since the visit runs to the weekend.
- the ICS export keys off `wholeDay` instead of `duration`, so a
  whole-day event now exports as an all-day entry.

How multi-day events are laid out is a congregation setting
(`events_multiday_display`), surfaced both in congregation settings
under "Meeting materials, forms and schedules" and as a quick setting on
the events page. Events longer than seven days always collapse to a
range regardless, which keeps two-week campaigns on one line without
special-casing the category the way the old code did.

Two pre-existing bugs fixed along the way:

- the PDF export read the unfiltered event list while the on-screen list
  filtered by data view, so a language group printed every other group's
  events alongside its own. Both surfaces now read one
  upcomingEventsByDataViewState atom.
- deleting an event went through on a single click; it now asks first.

Also corrects the names of UpcomingEventCategory members 7 and 8, which
were swapped relative to the decorations table. The stored value is the
array index, so the table order is deliberately left alone and no
records change meaning.
@ux-git
ux-git force-pushed the feat_flexible_event_dates branch from 59f0db9 to 216415f Compare July 27, 2026 15:04
@sonarqubecloud

Copy link
Copy Markdown

@ux-git ux-git changed the title feat(app): upcoming events – new compact date range view option for UI and Print feat(app): new compact date range view option for UI and Print for upcoming events Jul 27, 2026
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.

[FEAT] Flexible event dates and PDF output enhancements

1 participant