Add inline format editor for clock and countdown#140
Merged
Conversation
Adds a Format editor dialog (marked preview) reachable from the Display and Countdown sections. It offers one-click presets for common scenarios with live rendered examples, building-block chips that insert tokens at the cursor, a live preview that updates every second, and the raw format string as the escape hatch. Previews render through the same Tokenizer/TimeStringFormatter pipeline as the clock, including the humanized automatic countdown and error state.
Replace the dialog prototype with a FormatEditor control embedded in the Display and Countdown cards, replacing the examples dropdown and the countdown format reset button. Presets for common scenarios show their live rendered output, building-block chips insert tokens at the cursor, and a live preview updates as you type. Edits bind straight to settings so the clock reflects changes immediately.
The presets, custom box, token chips, and preview ran together as one undifferentiated dump. Add "Common formats" and "Custom format" captions, an inline "Insert:" label on the token row, and anchor the live preview in its own subtle bordered panel with a caption.
The raw datetime box was the least approachable control left in the
card. Wrap it in the same inline-editor structure as the formats:
one-click preset targets (midnight tonight, tomorrow morning, Friday
5 PM, New Year) computed when clicked, the free-form box with Reset,
and a plain-words preview that humanizes the target ("in 4 days") or
explains that countdown mode is off.
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the raw format controls with a bespoke inline editor so customizing the clock and countdown is approachable for common scenarios without losing the free-form escape hatch.
A reusable
FormatEditorcontrol (with aClock/Countdownmode) is embedded directly in the Display and Countdown cards — no dialog — and is organized into labeled sections:TimeStringFormatterpath as the clock itself, and turns red on invalid formats. With no countdown target set, previews use a sample target 3 days out so the chips aren't empty.Edits bind straight to settings (
UpdateSourceTrigger=PropertyChanged), so the desktop clock updates as you type — the app itself is the final preview.The countdown target gets the same treatment via a
CountdownTargetEditor: one-click preset targets (Midnight tonight, Tomorrow morning, Friday 5 PM, New Year's) computed at click time and labeled with the actual date they resolve to, the free-form box with Reset, and a plain-words preview that humanizes the target ("Friday, July 10, 2026 5:00 PM — 3 days from now") or states that countdown mode is off.Removed
ComboBoxnext to the clock format box (presets supersede it).FormatEditorWindowdialog from the first prototype commit — feedback moved the editor inline.Notes
{%d}etc. in countdown mode) so they survive the standard-format-string interpretation.SettingsWindowheadlessly under the dark palette; 78/78 tests pass anddotnet formatis clean.DateFormatExample.DefaultExamplesis no longer referenced from XAML but is kept since tests cover it; can drop it in a follow-up if preferred.Before/after