Offer AM/PM clock formats when right-clicking the bar clock - #6536
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds 12-hour AM/PM options to the bar clock’s right-click format cycle.
Changes:
- Adds horizontal and vertical AM/PM presets.
- Tests preset validity and cycling order.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
shell/plugins/panels/clock/Model.js |
Adds AM/PM clock formats. |
test/shell.d/clock-test.sh |
Tests AM/PM presets and cycling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
test/shell.d/clock-test.sh:164
- These predicate checks can pass when only one AM/PM entry remains in each orientation, so they do not cover the other two new horizontal twins, the exact vertical preset, or the required adjacency. The ISO check likewise passes if its time portion is removed entirely. Assert the complete ordered preset arrays so every new format and the unchanged 24-hour ISO entry are pinned.
for (const vertical of [false, true]) {
const meridiem = calendar.clockFormats(vertical).filter((format) => /\bAP\b/.test(format))
assert(meridiem.length > 0, `clock offers an AM/PM format on ${vertical ? 'vertical' : 'horizontal'} bars`)
scottjones
force-pushed
the
clock-ampm-formats
branch
from
August 3, 2026 14:40
7f4a417 to
1287f4e
Compare
Every preset in the right-click ring was 24-hour, so a 12-hour label was something you had to hand-write into shell.json. Pair each locale-shaped time preset with its AM/PM twin, and give vertical bars one stacked variant. The ISO preset keeps its 24-hour clock, since ISO 8601 writes time that way. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
scottjones
force-pushed
the
clock-ampm-formats
branch
from
August 3, 2026 18:36
1287f4e to
c0a2f9a
Compare
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.
Right-clicking the bar clock walks a ring of label formats, but every time preset in it was 24-hour — getting a 12-hour label meant hand-writing one into
shell.json. This pairs the locale-shaped time presets with their AM/PM twins, so the walk fromdddd HH:mmtodddd h:mm APis a single click rather than a lap of the ring. The ISO preset keeps its 24-hour clock, since ISO 8601 defines time that way. Vertical bars get one stacked variant; a meridiem costs a fourth line there, so only the plain time carries it.Shipped defaults are unchanged — a fresh install still shows
dddd HH:mm. This only widens what right-click offers, for people in locales that write 12-hour time.Test plan
test/shell.d/clock-test.shcovers the new presets at both orientations, and pins the ISO preset staying 24-hourMon 3 Aug 10:14 AM,Monday 10:14 AM,10:15 AMall render with the bar recentring cleanly10 / — / 15 / AMinside the bar width, no clipping🤖 Generated with Claude Code