Skip to content

feat: v0.5.0 map subpath exports + DatePickerCard [BDOK-155]#19

Merged
DuncanAForbes merged 1 commit into
mainfrom
feat/v0.5.0-map-subpaths-datepicker
Apr 18, 2026
Merged

feat: v0.5.0 map subpath exports + DatePickerCard [BDOK-155]#19
DuncanAForbes merged 1 commit into
mainfrom
feat/v0.5.0-map-subpaths-datepicker

Conversation

@DuncanAForbes
Copy link
Copy Markdown
Contributor

@DuncanAForbes DuncanAForbes commented Apr 18, 2026

Summary

  • Splits map provider adapters into subpath exports so consumers only pay for the adapter they use. Map is removed from the root bundle.
  • Adds DatePickerCard tool card for move-in / move-out date selection in the agent sidebar (already consumed by apps/customer's AgentSidebarPanel).
  • Normalises address handling in SearchResultsCard and FacilityDetailCard so both string and object shapes render consistently.
  • Null-safety guards on optional plan.coverAmount / plan.pricePerMonth / addon.pricePerMonth in HiveCheckoutFlow (fixes runtime crashes when plan entries are partial).
  • Switches tsup to a config-driven entry map; moves all map-SDK externals into tsup.config.ts so build and dev scripts stay in sync.

New subpath exports

Subpath Contents
@bagdock/hive-react/map HiveMapView + shared types (HiveMapAdapter, HiveMapViewProps, MapFacility, MapAppearance)
@bagdock/hive-react/map/mapbox mapboxAdapter + MapboxAdapterOptions
@bagdock/hive-react/map/maptiler maptilerAdapter + MapTilerAdapterOptions
@bagdock/hive-react/map/stadia stadiaAdapter + StadiaAdapterOptions
@bagdock/hive-react/map/radar radarAdapter + RadarAdapterOptions
@bagdock/hive-react/map/google googleMapsAdapter + GoogleMapsAdapterOptions

Breaking change

Consumers importing map adapters from the root bundle must switch to the new subpaths:

- import { HiveMapView, mapboxAdapter } from "@bagdock/hive-react"
+ import { HiveMapView } from "@bagdock/hive-react/map"
+ import { mapboxAdapter } from "@bagdock/hive-react/map/mapbox"

Types hygiene

This package owns its own public types via dist/types-*.d.ts. It does not import from @bagdock/types (verified — zero matches in src/).

Why now

Monorepo apps (apps/operator, apps/customer, apps/customer-platform, apps/web, packages/ui) pin @bagdock/hive-react@^0.5.0. The current npm max is 0.4.2, so bun install --frozen-lockfile in the Hono deploy workflow fails with:

No version matching "^0.5.0" found for specifier "@bagdock/hive-react"

This release unblocks those deploys. A follow-up monorepo PR (BDOK-156) will also DRY the CI clone loop.

Test plan

  • bun run typecheck — clean
  • bun run build — emits 7 entry bundles (index + 6 map subpaths) in CJS + ESM + DTS
  • CI (.github/workflows/ci.yml) passes on the PR
  • After merge: gh release create v0.5.0 --target main triggers publish.yml
  • npm view @bagdock/hive-react@0.5.0 version returns 0.5.0

Linear

Closes BDOK-155

Summary by CodeRabbit

  • New Features

    • Added date picker card for selecting move-in and move-out dates with flexible and calendar options
    • Introduced separate entry points for map providers (Mapbox, MapTiler, Stadia, Radar, Google)
  • Bug Fixes

    • Improved handling of missing price and coverage amount values to prevent display errors
  • Chores

    • Updated build configuration and simplified build scripts
    • Version bumped to 0.5.0

- Split map provider adapters into separate subpath exports so consumers
  only pay for the adapter they use:
    @bagdock/hive-react/map            — core HiveMapView + types
    @bagdock/hive-react/map/mapbox     — Mapbox GL adapter
    @bagdock/hive-react/map/maptiler   — MapTiler adapter
    @bagdock/hive-react/map/stadia     — Stadia adapter
    @bagdock/hive-react/map/radar      — Radar adapter
    @bagdock/hive-react/map/google     — Google Maps adapter
  The map exports are dropped from the root bundle; consumers must update
  their imports to the subpaths.

- Add DatePickerCard tool card for move-in / move-out date selection in
  the agent sidebar.

- Normalise facility address handling in SearchResultsCard and
  FacilityDetailCard so both string and object shapes (with line1/street,
  city, postcode) render consistently.

- Guard optional price/cover fields in HiveCheckoutFlow with ?? 0 so
  undefined plan entries no longer crash.

- Switch tsup to a config-driven entry map and move map SDK externals
  (mapbox-gl, @maptiler/sdk, maplibre-gl, radar-sdk-js) into
  tsup.config.ts so build/dev scripts stay in sync.

Bumps package.json to 0.5.0. No @bagdock/types imports — the package
owns its own public types via dist/types-*.d.ts.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3743dad8-a225-43a5-baf2-0ee8789b1e53

📥 Commits

Reviewing files that changed from the base of the PR and between 8a32db7 and 7b52c1b.

📒 Files selected for processing (11)
  • package.json
  • src/checkout-flow.tsx
  • src/index.ts
  • src/map-entry.ts
  • src/map-google-entry.ts
  • src/map-mapbox-entry.ts
  • src/map-maptiler-entry.ts
  • src/map-radar-entry.ts
  • src/map-stadia-entry.ts
  • src/tool-cards.tsx
  • tsup.config.ts

Walkthrough

The pull request restructures module exports to support granular imports via dedicated entry points for map providers (mapbox, maptiler, stadia, radar, Google), updates the build configuration to generate multiple distribution bundles, consolidates main barrel exports, adds a new DatePickerCard component for date selection workflows, and implements defensive null-handling in price/coverage display logic.

Changes

Cohort / File(s) Summary
Package & Build Configuration
package.json, tsup.config.ts
Bumped version to 0.5.0, added subpath exports for ./map and provider variants, simplified build scripts; updated tsup config with multiple named entry points and expanded external dependencies for map libraries.
Map Module Entry Points
src/map-entry.ts, src/map-mapbox-entry.ts, src/map-maptiler-entry.ts, src/map-stadia-entry.ts, src/map-radar-entry.ts, src/map-google-entry.ts
Created new dedicated entry modules that re-export HiveMapView and adapter-specific exports (adapters and their options types) to enable granular public access to map functionality.
Main Exports Consolidation
src/index.ts
Removed map-related exports and types from main barrel export; added DatePickerCard export. Map consumers must now use dedicated entry points instead of importing from root.
Feature & Logic Updates
src/tool-cards.tsx, src/checkout-flow.tsx
Implemented new DatePickerCard component with date selection UI and confirm flow; integrated collectDates tool rendering; enhanced facility address parsing to handle object-format addresses; added nullish coalescing for price/coverage calculations to prevent runtime errors.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ToolSystem as Tool Rendering<br/>System
    participant DatePicker as DatePickerCard
    participant MessageHandler as Message<br/>Handler

    User->>ToolSystem: Receives collectDates tool with suggested dates
    ToolSystem->>DatePicker: Renders DatePickerCard with suggestedMoveIn/Out
    DatePicker->>DatePicker: User selects dates or flexibility option
    User->>DatePicker: Clicks confirm
    DatePicker->>MessageHandler: onConfirm({moveIn, moveOut}) via onSendMessage
    MessageHandler->>MessageHandler: Formats message with selected dates
    MessageHandler->>User: Sends move-in/move-out confirmation message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related PRs

Poem

🐰 Modular maps hop freely now with entries fine,
Date pickers bloom with calendars that softly shine,
Defensive code guards prices safe from null's cruel bite,
Build scripts lean and bundled bright—a rabbit's delight! 🗓️✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v0.5.0-map-subpaths-datepicker

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DuncanAForbes DuncanAForbes merged commit 7af3e4d into main Apr 18, 2026
1 of 2 checks passed
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