Skip to content

Offer AM/PM clock formats when right-clicking the bar clock - #6536

Merged
dhh merged 1 commit into
basecamp:quattrofrom
scottjones:clock-ampm-formats
Aug 3, 2026
Merged

Offer AM/PM clock formats when right-clicking the bar clock#6536
dhh merged 1 commit into
basecamp:quattrofrom
scottjones:clock-ampm-formats

Conversation

@scottjones

@scottjones scottjones commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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 from dddd HH:mm to dddd h:mm AP is 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.sh covers the new presets at both orientations, and pins the ISO preset staying 24-hour
  • Cycled the whole ring on a running shell and screenshotted each new format: Mon 3 Aug 10:14 AM, Monday 10:14 AM, 10:15 AM all render with the bar recentring cleanly
  • Flipped the bar to the left edge to check the stacked variant — reads 10 / — / 15 / AM inside the bar width, no clipping

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings August 3, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread shell/plugins/panels/clock/Model.js
Copilot AI review requested due to automatic review settings August 3, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`)

Copilot AI review requested due to automatic review settings August 3, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 3, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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>
Copilot AI review requested due to automatic review settings August 3, 2026 18:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@dhh
dhh merged commit 72ffd58 into basecamp:quattro Aug 3, 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.

3 participants