Skip to content

feat: set date and time pickers from an ISO 8601 date - #79

Merged
iamnbutler merged 1 commit into
mainfrom
feat/date-values
Oct 17, 2026
Merged

iamnbutler merged 1 commit into
mainfrom
feat/date-values

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

Item 1 from #75.

API: desktop_set_value accepts a string value on AXDateTimeArea, AXDateField and AXTimeField:

  • 2026-10-17 is local midnight, 2026-10-17T15:30[:SS] is local time, and Z/±HH:MM sets the zone.
  • The TS client (src/date-value.ts) validates the string and normalizes it to UTC to the second (2026-10-17T13:30:00Z). Impossible dates such as Feb 30 are refused.
  • The native client refuses a string on any other role and a number/bool on date roles. An unsettable date control is refused with the keyboard route.
  • A non-completed date result carries keyboard_route: click the first field, type the digits, Tab to the next field, or step with Up/Down.

Host (peekaboo-date-value.patch, appended): when the element's AXValue is an NSDate and the request is a string, ActionInputDriver takes a date path:

  • The string must be the canonical UTC spelling.
  • A value that is already equal → confirmedNoChange.
  • Otherwise it writes an NSDate via the new setAutomationDate, polls for up to 1 s, and confirms only on the same instant. A mismatch → the usual unverified mutation (unknown).
  • The readback is reported as the same string, so the existing signed set-value binding (readback == requested string) applies unchanged, with no bridge changes.

Tests:

  • ActionInputDriverTests: 89 pass, including the write, no-change, refused spellings and mismatched-readback cases.
  • New test/date-value.test.mjs; npm test and npm run check pass.

Live: pending. The session was locked at last check, and another session's swift test helper is currently holding ~/.peekaboo/global.lock. The signed dev app is built at /tmp/dt/app; I'll check against a TextEdit/Calendar or Settings date picker when possible.

Co-Authored-By: Claude noreply@anthropic.com

desktop_set_value takes an ISO 8601 string for AXDateTimeArea, AXDateField
and AXTimeField. The client normalizes it to UTC to the second, the host
(peekaboo-date-value.patch) writes it as an NSDate and confirms it by
reading the same instant back. Refusals and unknown results carry the
keyboard route.

Co-Authored-By: Claude <noreply@anthropic.com>
@iamnbutler
iamnbutler merged commit ceb45af into main Oct 17, 2026
2 checks passed
@iamnbutler
iamnbutler deleted the feat/date-values branch October 17, 2026 05:59
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