Skip to content

Promote catalog fields to base#4651

Draft
richardhjtan wants to merge 1 commit intomainfrom
CS-10020-promote-catalog-fields-to-base
Draft

Promote catalog fields to base#4651
richardhjtan wants to merge 1 commit intomainfrom
CS-10020-promote-catalog-fields-to-base

Conversation

@richardhjtan
Copy link
Copy Markdown
Contributor

@richardhjtan richardhjtan commented May 5, 2026

Summary

Promotes the catalog atomic field primitives that authors actually reach for(date, datetime, datetime-stamp, number, currency, amount-with-currency,color, time + their subfields) from packages/catalog-realm/fields/ into packages/base/. External realms (host, experiments-realm, software-factory, openrouter-realm, boxel-homepage-realm) already import via https://cardstack.com/base/..., so the rich versions are now picked up everywhere automatically — no consumer-side changes required.

The boxel-catalog Speccoverage is a separate follow-up PR.

What moved

Family Files
date base/date.gts + base/date/{day,month,month-day,month-year,quarter,week,year}.gts
datetime base/datetime.gts, base/datetime-stamp.gts
number base/number.gts + base/number/{components,util}/*
color base/color.gts (unchanged) + base/color-field/{components,modifiers,util}/* (new)
currency base/currency.gts, base/amount-with-currency.gts
time base/time.gts + base/time/{duration,relative-time,time-range}.gts
shared base/components/{age,business-days,countdown,expiration-warning,time-ago,time-slots,timeline}.gts

Notable decisions

  • Single class per field: rich features merged directly into the
    existing base classes (DateField, DateTimeField, NumberField).
    No BaseX shim layer.
  • Backwards-compatible defaults: when no configuration is passed,
    embedded/atom fall back to base's existing simple View. Existing
    callers see identical rendering.
  • DateRangeField: kept base's canonical implementation
    (CS-10786 markdown, Reset/Save dropdown UX); merged the
    presentation: 'businessDays' mode + BusinessDays component from
    legacy.
  • Datetime serialization: kept base's DatetimeSerializer
    (with timezone). Dropped legacy date-time.gts's timezone-stripping
    override — that would have broken existing data round-tripping.
  • color.gts left intact; the new color-field/ tree is an
    additional resource that authors can import directly for richer
    pickers (variant: standard / wheel / slider / swatches-picker /
    advanced, plus contrast checker and recent-colors history).

Consumer-side changes

External realms: zero — they already use https://cardstack.com/base/....

Test plan

  • Manual: open a card with DateField (verify countdown / timeline / age presentation modes), NumberField (Stat / ProgressBar / Gauge), ColorField (palette + picker switch), CurrencyField, AmountWithCurrency. Edit + save round-trip.

Follow-ups

  • Port packages/base/fields/*.json Specs into the new boxel-catalog
    repo and add new Specs for the newly-promoted fields
    (currency, amount-with-currency, datetime-stamp,
    date/{day,month,…}, time + time/*).
  • Consider lifting genuinely-reusable presentation components
    (Countdown, Timeline, TimeAgo) from base/components/ into
    boxel-ui once their config-coupled API is refactored.

@richardhjtan richardhjtan requested a review from Copilot May 5, 2026 04:57
@richardhjtan richardhjtan review requested due to automatic review settings May 5, 2026 05:00
@richardhjtan richardhjtan force-pushed the CS-10020-promote-catalog-fields-to-base branch from d1097e4 to a4780b5 Compare May 5, 2026 05:18
@richardhjtan richardhjtan requested a review from Copilot May 5, 2026 05:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR promotes several catalog-realm “field” implementations (notably number/date/datetime/color and supporting UI) into packages/base, and updates catalog cards/specs to import these fields from https://cardstack.com/base/* instead of local packages/catalog-realm/fields/* paths.

Changes:

  • Updated catalog cards, field previews, and field spec docs to import promoted fields from the Base realm URLs.
  • Removed catalog-realm implementations for fields that are now provided by packages/base.
  • Added/expanded Base implementations (Number field presentation components, Date/Datetime presentation modes, DateRange business-days view, Color field picker variants + utilities).

Reviewed changes

Copilot reviewed 53 out of 74 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/catalog-realm/threejs-car-customizer/threejs-car-customizer.gts Switch ColorField import to Base URL.
packages/catalog-realm/spotify-track/spotify-track.gts Switch NumberField/DateField imports to Base URLs.
packages/catalog-realm/reward-card-program/reward-card-program.gts Switch AmountWithCurrency import to Base URL.
packages/catalog-realm/fields/number.gts Removed (Number field implementation moved into packages/base/number.gts).
packages/catalog-realm/fields/date/date-range.gts Removed (DateRange behavior moved/extended in packages/base/date-range-field.gts).
packages/catalog-realm/fields/date.gts Removed (Date field presentation moved/extended in packages/base/date.gts).
packages/catalog-realm/fields/date-time.gts Removed (Datetime field presentation moved/extended in packages/base/datetime.gts).
packages/catalog-realm/fields/color.gts Removed (Color field moved/extended under packages/base/color-field/*).
packages/catalog-realm/fields-preview/amount-with-currency.gts Switch AmountWithCurrencyField import to Base URL.
packages/catalog-realm/field-spec/year-field-spec.gts Switch YearField import to Base URL.
packages/catalog-realm/field-spec/week-field-spec.gts Switch WeekField import to Base URL.
packages/catalog-realm/field-spec/time-range-field-spec.gts Switch TimeRangeField import to Base URL.
packages/catalog-realm/field-spec/time-field-spec.gts Switch TimeField import to Base URL.
packages/catalog-realm/field-spec/relative-time-field-spec.gts Switch RelativeTimeField import to Base URL.
packages/catalog-realm/field-spec/quarter-field-spec.gts Switch QuarterField import to Base URL.
packages/catalog-realm/field-spec/number-field-spec.gts Switch NumberField import to Base URL.
packages/catalog-realm/field-spec/month-year-field-spec.gts Switch MonthYearField import to Base URL.
packages/catalog-realm/field-spec/month-field-spec.gts Switch MonthField import to Base URL.
packages/catalog-realm/field-spec/month-day-field-spec.gts Switch MonthDayField import to Base URL.
packages/catalog-realm/field-spec/duration-field-spec.gts Switch DurationField import to Base URL.
packages/catalog-realm/field-spec/day-field-spec.gts Switch DayField import to Base URL.
packages/catalog-realm/field-spec/datetime-stamp-field-spec.gts Switch DatetimeStampField import to Base URL.
packages/catalog-realm/field-spec/datetime-field-spec.gts Switch DateTimeField import to Base URL.
packages/catalog-realm/field-spec/date-range-field-spec.gts Switch DateRangeField import to Base URL.
packages/catalog-realm/field-spec/date-field-spec.gts Switch DateField import to Base URL.
packages/catalog-realm/field-spec/color-field-spec.gts Switch ColorField import to Base URL.
packages/catalog-realm/email-template-editor/email-template-editor.gts Switch ColorField import to Base URL.
packages/catalog-realm/airbnb-listing/airbnb-listing.gts Switch NumberField/DateField imports to Base URLs.
packages/base/time/time-range.gts Convert imports to local ../card-api path.
packages/base/time/relative-time.gts Convert imports to local Base paths.
packages/base/time/duration.gts Convert imports to local Base paths.
packages/base/time.gts Convert imports to local Base paths; minor template/comment cleanup.
packages/base/number/util/index.gts Added shared number formatting/parsing utilities.
packages/base/number/components/stat.gts Added “stat” number presentation component.
packages/base/number/components/score.gts Added “score” number presentation component.
packages/base/number/components/progress-circle.gts Added “progress-circle” number presentation component.
packages/base/number/components/progress-bar.gts Added “progress-bar” number presentation component.
packages/base/number/components/number-input.gts Added reusable number input with min/max enforcement.
packages/base/number/components/gauge.gts Added “gauge” number presentation component.
packages/base/number/components/badge-notification.gts Added “badge-notification” number presentation component.
packages/base/number/components/badge-metric.gts Added “badge-metric” number presentation component.
packages/base/number/components/badge-counter.gts Added “badge-counter” number presentation component.
packages/base/number.gts Replaced re-export-only module with full Number field (edit/atom/embedded + presentations).
packages/base/datetime.gts Added presentation modes and atom/embedded implementations; retains markdown behavior.
packages/base/datetime-stamp.gts Update DatetimeStampField to extend local DateTimeField implementation.
packages/base/date/year.gts Convert imports to local Base paths.
packages/base/date/week.gts Convert imports to local Base paths.
packages/base/date/quarter.gts Convert imports to local Base paths.
packages/base/date/month.gts Convert imports to local Base paths.
packages/base/date/month-year.gts Convert imports to local Base paths.
packages/base/date/month-day.gts Convert imports to local Base paths.
packages/base/date/day.gts Convert imports to local Base paths.
packages/base/date.gts Added presentation modes and atom/embedded implementations; retains markdown behavior.
packages/base/date-range-field.gts Add embedded presentation switch (standard vs business-days).
packages/base/currency.gts Convert imports to local Base paths; adds icon.
packages/base/components/timeline.gts Added Timeline presentation component.
packages/base/components/time-slots.gts Added TimeSlots presentation component.
packages/base/components/time-ago.gts Added TimeAgo presentation component.
packages/base/components/expiration-warning.gts Added ExpirationWarning presentation component.
packages/base/components/countdown.gts Added Countdown presentation component.
packages/base/components/business-days.gts Added BusinessDays presentation component.
packages/base/components/age.gts Added Age presentation component.
packages/base/color-field/util/css-color-parsers.gts Added browser/canvas-based CSS color parsing utilities.
packages/base/color-field/util/color-utils.gts Added color parsing, normalization, caching, and configuration types.
packages/base/color-field/util/color-field-signature.gts Added shared signature for color-field components.
packages/base/color-field/modifiers/setup-element-modifier.gts Added modifier for element setup callbacks.
packages/base/color-field/components/swatches-picker.gts Added swatches-picker variant component.
packages/base/color-field/components/slider-picker.gts Added slider variant component (RGB/HSL sliders).
packages/base/color-field/components/recent-colors-addon.gts Added recent-colors addon UI.
packages/base/color-field/components/contrast-checker-addon.gts Added WCAG contrast checker addon UI.
packages/base/color-field/components/color-wheel-picker.gts Added hue wheel picker variant component.
packages/base/color-field/components/color-picker-field.gts Added orchestrator for color variants + addons + recent-colors persistence.
packages/base/color-field/components/advanced-color-picker.gts Added advanced color picker variant.
packages/base/amount-with-currency.gts Convert imports to local Base paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/base/components/age.gts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Preview deployments

Host Test Results

    1 files  ±0      1 suites  ±0   1h 43m 21s ⏱️ -25s
2 563 tests ±0  2 535 ✅  - 11  15 💤 ±0   0 ❌ ± 0  13 🔥 +11 
2 582 runs  ±0  2 541 ✅  - 22  15 💤 ±0  13 ❌ +11  13 🔥 +11 

Results for commit a265d72. ± Comparison against earlier commit aa34196.

For more details on these errors, see this check.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   15m 58s ⏱️ - 2m 59s
1 234 tests ±0  1 234 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 306 runs  ±0  1 306 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a265d72. ± Comparison against earlier commit aa34196.

@richardhjtan richardhjtan force-pushed the CS-10020-promote-catalog-fields-to-base branch 2 times, most recently from 4148de4 to aa34196 Compare May 5, 2026 09:10
@richardhjtan richardhjtan force-pushed the CS-10020-promote-catalog-fields-to-base branch from aa34196 to a265d72 Compare May 5, 2026 09:43
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.

2 participants