Skip to content

File-based schedule picker, side-by-side layout, display mode fixes#6

Merged
lastowl merged 4 commits intoavalonia-portfrom
feature/file-based-schedules
Apr 12, 2026
Merged

File-based schedule picker, side-by-side layout, display mode fixes#6
lastowl merged 4 commits intoavalonia-portfrom
feature/file-based-schedules

Conversation

@lastowl
Copy link
Copy Markdown
Owner

@lastowl lastowl commented Apr 12, 2026

Batch of timer output and operator enhancements. See commit messages for details.

Lastowl added 4 commits April 12, 2026 16:15
)

Expands file-based operating mode so users can manage multiple
schedule templates instead of hand-editing a single XML file.

Schedule templates folder:
- FileUtils.GetScheduleTemplatesFolder() creates and returns
  {Documents}/OnlyT/Schedules/ on all platforms.

Export current schedule:
- ScheduleExporter.Export() serializes the current Talks collection
  to the file-based XML format (meeting > items > item elements
  with name, duration, editable, bell, countup, persist, closing
  attributes). Works from any mode — export an Auto midweek
  schedule, a Manual setup, or an existing file-based template.
- 'Save' button on the operator page triggers the export with an
  auto-generated filename (mode-timestamp.xml).

Schedule picker:
- When File-Based mode is active, a dropdown appears above the talk
  list showing all .xml files in the Schedules folder. Selecting a
  different template saves the choice to AppOptions.SelectedScheduleFile,
  resets the schedule service, and reloads the talk list.
- TalkScheduleFileBased.Read() now accepts an optional selectedFile
  parameter. If provided, it resolves the path within the Schedules
  folder. Falls back to the legacy talk_schedule.xml for backward
  compatibility when no template is selected.

First-use seeding:
- When the user switches to File-Based mode and the Schedules folder
  is empty, the current talk list is automatically exported as
  default.xml so there's something to start from immediately.
Clock format not updating:
- TimerOutputViewModel.RefreshSettings() now calls ApplyClockHourFormat()
  which maps the ClockHourFormat enum to the three boolean flags
  (DigitalTimeFormat24Hours, ShowLeadingZero, AMPM) that the analogue
  clock control binds. Previously these were initialized to defaults
  and never updated from options.

Clock mode not updating output window:
- Wrap the OptionsChanged subscription in Dispatcher.UIThread.Post to
  guarantee property-changed notifications reach Avalonia bindings on
  the correct thread. The raw event fires on the calling thread (UI
  in practice, but not guaranteed by contract).

Schedule file picker in Settings:
- SettingsViewModel gains AvailableScheduleFiles + SelectedScheduleFile
  properties, populated when OperatingMode == ScheduleFile (either on
  load or when the user switches to File-Based mode).
- SettingsWindow shows a 'Schedule file' combo below the OperatingMode
  selector, visible only in File-Based mode. The selected file is
  persisted to AppOptions.SelectedScheduleFile on Save.
… visibility

Clock format ComboBox blank: ClockHourFormats was a computed property
(=>) that created new ClockHourFormatItem instances on every access.
ComboBox.ItemsSource got one set, SelectedItem got a different
reference from FirstOrDefault on a fresh array — reference equality
failed so nothing appeared selected. Changed to a field initializer
({ get; } =) so the same instances are used throughout.

Display mode not updating output window: Added explicit
OnPropertyChanged calls for ShowBothClocks, ShowDigitalClockOnly,
ShowAnalogueClockOnly after ApplyClockMode in RefreshSettings.
The [NotifyPropertyChangedFor] chain on the backing fields fires
when the setters run, but the dispatched OptionsChanged path may
miss the cascade. Belt-and-suspenders: raise them explicitly too.

Export button always visible: Moved the 'Save template' button from
the file-based-only picker row to the footer icon bar. Now visible
in all modes so users can export Auto/Manual schedules as file-based
templates without first switching to File-Based mode.
…t toggle

Timer output window layout:
- Port the WPF side-by-side column layout for 'Both' mode: analogue
  clock on the left, digital timer on the right, with the split
  slider controlling column widths via a new GridLength converter.
- Retain the vertical stack as the default (better for portrait
  displays). New HorizontalClockLayout option (default false)
  toggles between them. Checkbox in Settings > Timer Window.
- Split slider now enabled only in horizontal layout with an
  analogue clock mode.

Display mode switching:
- Replace computed ShowBothClocks/ShowDigitalClockOnly/
  ShowAnalogueClockOnly with explicit ObservableProperty fields to
  fix compiled-binding propagation issues.
- Fix OptionsChanged event to iterate handlers individually so one
  failure doesn't skip the rest.
- Add live preview: changing the clock mode combo updates the output
  window immediately without saving.
- Direct RefreshSettings call from OperatorPageVM as fallback.

Clock format:
- Fix blank ComboBox: ClockHourFormats was a computed property
  creating new instances per access. Now a field initializer.
- Add ApplyClockHourFormat to RefreshSettings mapping the enum to
  the three boolean flags the analogue clock control binds.

File-based schedule (AntonyCorbett#21):
- Schedule templates folder, ScheduleExporter utility, schedule
  picker in both operator page and Settings window.
- Export button in footer (hidden by default, toggle in Settings).
- First-use seeding: auto-exports current schedule as default.xml.

Export toggle: ShowExportScheduleButton option (default off).
@lastowl lastowl merged commit 632e7a6 into avalonia-port Apr 12, 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.

1 participant