feat(panel): chat composer offers dates after an @

Merged
DA
1d ago
+234-30

What

The workspace chat's composer now lets you @-mention dates, as the plan editor and the agent composer already do (#3879).

  • Words after @ that read as a date (@tomorrow, @next fri, @oct 20 to 24) offer that date first in the list, named the way its chip says it, with the date in full beside it.
  • Picking it writes the same [@Oct 20, 2026](luke://date/2026-10-20) link the other editors write. This works in the editor box and in the plain textarea fallback.
  • A sent message draws the date as the date chip. Chat bodies already render through TranscriptWords, which draws date links, so no change was needed there. A test now covers it.

How

  • packages/ui/src/chat-mention.ts: chatRows lists the date the @ words name (via dateOfWords, dateChipText and dateLabel), then the members from matchingTargets exactly as before. A date row carries its luke://date/… target, so the one chooseTarget writes a member, a channel or a date.
  • chat-mention-picker.tsx and chat-composer.tsx list that row and write it as a chip in the editor box. The editor already reports multi-word @ queries (atWord, up to six words).
  • The plain textarea fallback, used only when the editor bundle fails to load, reads its @ word as one word, as a handle is. It offers a date that one word names (@tomorrow, @fri, @2026-10-20). Multi-word dates are the editor's.

Member and channel matching are unchanged. The only multi-word query that adds a row is one that reads as a date, so prose after a handle (@agent-1 please look) still opens no list.

Bundle budget: the app entry is 934,497 of 934,621 gzipped bytes, 124 under the ceiling. This PR adds about 150 bytes over main. To fit, I folded the date into the existing row and pick paths and dropped multi-word dates from the plain fallback. The baseline is not re-recorded.

Screenshots

These were taken from a throwaway page that renders the fixture chat. The page is not committed.

The list @next fri opensThe sent message
listsent

Tests

  • packages/ui/src/chat-mention.test.ts covers:
    • which @ words list a date: across words, and not prose after a handle
    • the date listed first, before the members
    • the link a pick writes
  • packages/panel/src/desktop/desktop-chat.test.ts covers:
    • the editor box: the list, the pick as a chip, and the sent message drawn as the date chip
    • a date listed before the members, and prose after a handle opening no list
    • the plain fallback writing and sending a one-word date's link

All of these tests use a fixed Date and day-only dates.

pnpm check:affected ran out of memory in the sandbox, so I ran its parts one at a time, and all of them passed:

  • lint, knip, and discarded-effect
  • typecheck for ui, panel, web, and desktop
  • the ui and panel test suites

Made with Luke


Devin Review