Skip to content

The Console calendar does not read calendar.initialDate, so it still opens on today #28102

Closed

Description

@objectstack-fleet

domain:spec#4 · marchtian · session_017ihL2fi9zfJhUTubyJYb6V

Filing gate: ② the consumer half of #28021. The spec half declares the key; this card is the renderer that reads it. It lands after that PR merges.
Reach: any calendar view whose records fall months ahead. HotCRM's renewals calendar opens on an empty month (#27386 row 3). Once the spec key ships, an author who writes calendar.initialDate: 'next_record' or '{next_month_start}' gets a view that parses and saves, and still opens on today.
Reader who acts: domain:ui.
Seam: spec:CalendarConfigSchema.initialDate → renderer:ui/packages/plugin-calendar/src/ObjectCalendar.tsx#ObjectCalendar

Observed (this repo, ui/ tree, on main at 549203d)

  • ObjectCalendar sets its current date with useState(new Date()) (ObjectCalendar.tsx, the currentDate state). It reads no anchor from the calendar config.
  • The spec PR for A calendar view always opens on the current month #28021 adds an optional initialDate to CalendarConfigSchema. It takes one of two forms: a record anchor, 'first_record' or 'next_record', or a wrapped, known date-macro token such as '{today}', '{next_month_start}' or '{3_months_from_now}' (the vocabulary is DATE_MACRO_TOKENS plus the parameterised grammar in packages/spec/src/data/date-macros.zod.ts). That schema is the list view's calendar block, and it is also the object-calendar node's calendar prop. @object-ui/types takes the block by reference, so the mirror accepts the key without an edit.

Wanted

  • ObjectCalendar reads calendar.initialDate where it seeds currentDate:
    • absent: today, as now.
    • a date-macro token: the period that holds the date the token resolves to when the calendar opens. Resolve it with the client resolver filter values already use (resolveDateMacros() in @object-ui/core), not a second one.
    • 'first_record': the period that holds the earliest startDateField value among the records the view selects, with its filter applied.
    • 'next_record': the period that holds the earliest startDateField value on or after the start of today.
    • When no record qualifies, today.
    • The period is the month, week or day of the active view mode.
  • The renderer fetches only the visible range. So the two record anchors need their own one-row read: sort by startDateField ascending, limit 1, plus a lower bound for next_record. Seed once on mount. After that, user navigation owns the date.
  • Copies that are owned by ui/ and list the calendar block's keys, kept in step:
    • the list-view registry input description in ui/packages/plugin-list/src/index.tsx, which feeds sdui.manifest.json and content/docs/ui/components/plugins.mdx;
    • the object-calendar registry calendar input description in plugin-calendar;
    • the hand-typed calendar options in ui/packages/types/src/designer.ts.
      Regenerate the manifest with node scripts/gen-sdui-manifest-node.mjs.
  • Amend the calendar row note in packages/spec/liveness/view.json. It now says initialDate rides at planned strength. Change it to plain live, citing the read.

Dedupe words: calendar initialDate renderer, ObjectCalendar currentDate seed, calendar first_record next_record.

Related: #28021, #27386 (row 3).

Body refreshed 2026-10-30T15:31Z: the values follow the formula form the maintainer asked for on #28021 (a record anchor or a date-macro token; the bare 'today' is gone). The triage comment 6523386496 carries no request for the body; its Blocked-by: line is kept.

Blocked-by: #28021

Activity

  1. objectstack-fleet commented on Oct 30, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: 看数据的视图 | none | P②

    Triage: p2 · domain:ui · area:records · pm:blocked on #28021 · 2026-10-30T12:57Z

    ⛔ Not a claim.

    • Read fresh. This is the consumer half of the calendar.initialDate Seam. ObjectCalendar opens on the declared anchor, next_record included, after the spec key lands. Pin it.
    • Blocked-by: #28021 is now in the body.
    • pm:blocked.

    Generated by Claude Code

  2. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#4 · marchtian · session_017ihL2fi9zfJhUTubyJYb6V

    Carry-forward from the spec half (PR #28138, contract review 6537839837, should-fix 2) · 2026-10-31T02:41Z. When this card's console change removes the [PLANNED — not yet rendered] marker from CalendarConfigSchema.initialDate, also split the describe into two short sentences, one per form (the record anchors first_record / next_record, then the wrapped date-macro token). Studio's inspector shows the describe as a tooltip, and today it is one long paragraph repeated in four reference tables. Not blocking; it rides on the marker removal.

  3. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: unblocked · p2 · pm:queue · 2026-10-31T04:01Z

    ⛔ Not a claim.


    Generated by Claude Code

  4. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#3 · os-tesla · session_01L9qibz8HEj53Wx2uphTo2o

    Claim: PM loop round 4 · 2026-10-31T04:11Z
    Session: session_01L9qibz8HEj53Wx2uphTo2o (seat; implementation by card thread session session_01L9qibxTJuzeiDxzGXxzFbe, mode:thread)
    Account: os-tesla (the seat's linked user as GET /user answers it; the card's assignee)
    Branch: claude/project-thread-1tllxq (the card thread's designated push branch, the recorded platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-28102
    Domain: domain:ui
    Seat: domain:ui#3
    File surface: ui/packages/plugin-calendar/**, ui-owned copies of the calendar key list the card names, packages/spec/src/** only for CalendarConfigSchema.initialDate's marker/describe (+ regenerated references), tests, .changeset/28102-*.md (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (dispatch-gates --tier re-run on the actual diff), effort: high
    Clause-②: yes if the PR touches packages/spec (CalendarConfigSchema.initialDate marker + describe, carry-forward 6537924895); contract review then owed, routed by the seat
    Metadata-protocol: none
    Responsibility: the renderer not reading the declared key is ours (ui consumer half of #28021; spec half #28138 merged)
    Thread-read: none
    Premise: per the card's measurement; the dev re-measures on current main before code
    Serial constraints cleared: seat-3 siblings #28239 #28240 #28241 #28179 #28164 hold declared regions of shared files (FRAME.md); #28148 (paused) holds views/setup/PackagedAutomationPage.tsx + packagedFlowLedger.ts

    Maintainer 2026-10-31 「ui 车道一堆任务啊,应该并发开满啊」. Order: /mnt/project-files/ui-seat-3/r2026-10-31/dispatch-28102.md under FRAME.md.

  5. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#3 · os-tesla · session_01L9qibz8HEj53Wx2uphTo2o

    Claim amendment (6538841986) · 2026-10-31T04:12Z
    File surface adds: the calendar-block forward in ui/packages/plugin-list/src/ListView.tsx (case 'calendar', the calendarBlock literal, one line) and ui/packages/plugin-view/src/ObjectView.tsx (generateViewSchema case 'calendar', one line), each with a producer pin; and packages/spec/liveness/view.json (the calendar row's note, PLANNED → live, agreeing with the marker removal).
    Why: the dev measured on main 91e46522 that both producers forward the calendar keys by name and drop initialDate, so a stored list view's key never reaches ObjectCalendar (the card's HotCRM renewals reach).
    Serial note: domain:ui#4 holds #25918's (schema as any) reads in plugin-list/src/ListView.tsx; this card touches only the calendarBlock literal. The second PR to land merges origin/main.

  6. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#3 · os-tesla · session_01L9qibxTJuzeiDxzGXxzFbe
    os-dev-report

    {
     "issue": 28102,
     "status": "done",
     "branch": "claude/project-thread-1tllxq",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/28334",
     "head": "471be6e722d42329d229b032157594798cc632c7",
     "session": "session_01L9qibxTJuzeiDxzGXxzFbe",
     "premise_still_valid": true,
     "summary": "ObjectCalendar seeds currentDate from calendar.initialDate once on mount: a date-macro token through resolveDateMacros in the useState initializer, first_record/next_record through a one-row read (view filter + is_not_null or >= start of today, start field asc, $top 1) from the record fetch's own source; no record, no source or a failed read opens on today; a late answer after user navigation is discarded. ListView and ObjectView now forward initialDate inside the node's calendar block (seat-approved). Spec PLANNED marker removed and describe split per form; liveness calendar note now plain live; registry descriptions, designer type, manifest and reference regenerated.",
     "tests": "471be6e7: pnpm --dir ui exec vitest run packages/plugin-calendar/ + ListView.calendar* + ObjectView.calendar* -> Test Files 74 passed (74), Tests 530 passed | 95 skipped (625). Pre-merge: list/view calendar + packages/types -> 392 files passed; spec calendar-config-initial-date + view tests -> 537 passed; type-check plugin-calendar/plugin-list/plugin-view/types -> VERDICT command-exit 0. Ablations via scripts/ablation-replace.mjs, restore proven blob == HEAD: A ListView forward -> 3 red/1 green; B ObjectView forward -> 3 red/1 green; C macro seed -> 2 red/12 green; D anchor setCurrentDate -> 5 red/9 green; E navigation guard -> 1 red/13 green.",
     "gates": "dispatch-gates --ran: 115 derived, 113 run exit 0, 2 NOT MEASURED (exit 3 PREREQUISITE NOT MET: spec check:skill-examples needs client-react dist; check:dual-build-cjs-loads needs full pnpm build). check-plugin-teardown-shape --self-test exit 0 after fetching its pinned fixture commit (first run exit 3 on the shallow clone). Post-merge on 471be6e7: check-sdui-manifest, check:sdui-reference, spec check:liveness, check:issue-citations, check:doc-authoring all exit 0; spec build + check:generated: all 14 up to date. eslint --no-inline-config on the 11 changed ts/tsx files: 0 errors. CI check-runs: in_progress at report time. Record: /mnt/project-files/ui-seat-3/r2026-10-31/out/28102-gates-ran-a0933cac.list",
     "line_budget": "18 files, +652 / -21 (PR read-back), under the 3000 human-merge threshold; no skills/** or governed surface touched",
     "files_changed": [
      ".changeset/28102-calendar-opens-on-initial-date.md",
      "content/docs/references/ui/component.mdx",
      "content/docs/references/ui/view.mdx",
      "content/docs/ui/components/plugins.mdx",
      "packages/spec/liveness/view.json",
      "packages/spec/src/ui/view.zod.ts",
      "scripts/sdui-manifest.record.json",
      "sdui.manifest.json",
      "ui/packages/plugin-calendar/src/ObjectCalendar.initialDate-28102.test.tsx",
      "ui/packages/plugin-calendar/src/ObjectCalendar.tsx",
      "ui/packages/plugin-calendar/src/index.tsx",
      "ui/packages/plugin-calendar/src/initialDate.ts",
      "ui/packages/plugin-list/src/ListView.tsx",
      "ui/packages/plugin-list/src/__tests__/ListView.calendarInitialDate-28102.test.tsx",
      "ui/packages/plugin-list/src/index.tsx",
      "ui/packages/plugin-view/src/ObjectView.tsx",
      "ui/packages/plugin-view/src/__tests__/ObjectView.calendarInitialDate-28102.test.tsx",
      "ui/packages/types/src/designer.ts"
     ],
     "deviations": [
      "file surface extended with seat approval (claim amendment 6538859721): ListView.tsx calendarBlock forward, ObjectView.tsx generateViewSchema calendar forward, packages/spec/liveness/view.json calendar note",
      "worked in the platform-provided card-thread checkout on the designated branch, not a separate git worktree (single-agent container)",
      "gates-ran record edited once: the first teardown --self-test line (exit 3, shallow clone) removed after the rerun went green, so the record states one code per family"
     ],
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "mcp_calls": "3 — reads only: issue_read get, issue_read get_comments, pull_request_read get; 0 writes",
     "api_writes": "2 — relay pr_create (#28334, read back identical, no assignees) and this os-dev-report comment via post-stamped",
     "open_questions": [],
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — ListView initialCalendarWindow (plugin-list calendarWindow.ts) still assumes the hosted calendar opens on today, costing one extra window fetch when initialDate seeds another month; in the PR's Acceptance notes"
     ]
    }
  7. objectstack-fleet commented on Oct 31, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#3 · os-tesla · session_01L9qibz8HEj53Wx2uphTo2o

    Landed · 2026-10-31T09:44Z

    probe reading
    PR #28334 merged through the queue at 2026-10-31T07:13:09Z, merge commit 71de0608e9 (ACCEPT 6540276588)
    this card closed completed by the PR's Fixes line

    State: pm:dispatched removed (closed card).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:recordsBusiness objects, records, the views that show data, usable forms, searchdomain:uifindingpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions