Skip to content

feat(F0AnalyticsDashboard): add reusable location item - #5272

Draft
zygisS22 wants to merge 5 commits into
mainfrom
codex/time-tracking-location-widget
Draft

feat(F0AnalyticsDashboard): add reusable location item#5272
zygisS22 wants to merge 5 commits into
mainfrom
codex/time-tracking-location-widget

Conversation

@zygisS22

@zygisS22 zygisS22 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Product review

This draft is currently intended for product review of the location-based analytics experience, its responsive behavior, and the reusable component API.

The first planned adoption is a new Time Tracking analytics template. That template will use the widget to help customers understand clock-ins and clock-outs by location, location density, the employees associated with a selected workplace, and activity across a 24-hour period.

This PR provides the reusable F0 analytics building block; it does not yet ship the final Time Tracking template or connect it to the production Time Tracking cube. The component lives in F0AnalyticsDashboard and deliberately stays domain-neutral so future analytical-dashboard templates can reuse it for IT inventory, software and asset distribution, or other location-based datasets without introducing domain-specific UI into F0.

Description

Add a generic location item to F0AnalyticsDashboard for map-based analytical datasets. Consumers provide domain data and labels through the public contract and can independently show or hide the summary, location details, density legend, and timeline; omit timeline data entirely; and supply a partial F0-token density palette that stays consistent between markers, clusters, and the legend.

Type of change

  • New component (aligned in #f0-support, lands in experimental/)
  • Component enhancement / variant (existing component, no breaking change)
  • New pattern (composition of existing F0 components)
  • Variant or improvement of existing pattern
  • Promotion (experimental/ → stable)
  • Deprecation (adds @deprecated + @removeIn + @migration)
  • Removal (deletes a deprecated component past @removeIn)
  • Bug fix
  • Documentation only
  • Refactor / internal change (no API or behavior change)
  • Other

Lifecycle phase (if applicable)

Not applicable. This extends the existing experimental F0AnalyticsDashboard pattern.

Screenshots (if applicable)

image image image

Visual and responsive states are covered by the consolidated AnalyticsDashboard/Location item / Snapshot story and dedicated Default, SideBySide, IntermediateWidth, Narrow, Dark, NoSelection, CrowdedDetails, MapUnavailable, CustomDensityPalette, WithoutSummary, WithoutDetails, WithoutDensityLegend, WithoutTimeline, and MapOnly stories.

Implementation details

  • Add a domain-neutral location item contract and renderer to F0AnalyticsDashboard.
  • Prepare the visualization for adoption by the new Time Tracking analytics template without coupling F0 to Time Tracking data or terminology.
  • Demonstrate the same public contract with both Time Tracking and IT inventory examples; software, assets, and other domains can provide their own labels and datasets.
  • Add optional section controls for summary, location details, density legend, and timeline; every section defaults to the complete experience.
  • Make timeline data optional and derive responsive layout offsets from the sections that are actually visible.
  • Add a partial densityPalette API using F0 color tokens. One resolved palette drives markers, clusters, and the legend, with contrast-safe normalization.
  • Preserve responsive disclosure state and keyboard focus across container resizing and runtime section changes.
  • Keep dashboard-owned fullscreen, Ask One, per-widget filters, designer, drag/reorder, resize, loading, error, and export behavior.
  • Export localized spreadsheet labels through stable internal keys, including heterogeneous detail columns.
  • Document the complete public API and copy-paste examples in MDX, including clock activity, IT inventory, custom palettes, and map-only composition.

Validation

  • 169 changed unit tests passing across 11 files in the pre-push gate, including 23/23 focused location-item tests
  • pnpm --dir packages/react build:types
  • Full and focused oxfmt --check plus oxlint --max-warnings 0
  • pnpm --filter @factorialco/f0-react build-storybook
  • Built Storybook verified across Default, SideBySide, IntermediateWidth, Narrow, WithoutSummary, CustomDensityPalette, fullscreen/designer, and fallback states
  • Browser geometry checks confirm that the density legend and location-details accordion remain independently aligned when expanded or collapsed
  • F0 pre-commit and pre-push checks, including circular dependencies, component Definition of Done, file sizes, and untranslated-copy enforcement
  • Independent final reviews: API/modularity PASS, accessibility/responsiveness PASS, docs/stories/tests PASS

Implemented-with: factorial-f0
@github-actions github-actions Bot added feat new-component Adds a new component (story file) to packages/react — must meet the full Definition of Done react Changes affect packages/react labels Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Review policy: Feature

The PR title starts with feat, so this is a feature: it needs one approval from f0-devs AND one from f0-designers (rule 3).

Required approvals

Team Why Status
@factorialco/f0-devs Features need a dev approval ⏳ pending
@factorialco/f0-designers Features need a design approval ⏳ pending
How this was decided
  • PRs touching only sds/ modules require their owners and nothing else.
  • Otherwise, docs-only changes (*.md, *.mdx, *.stories.tsx, anything in __stories__/) → one f0-general approval.
  • Otherwise, feat: titles → one f0-devs and one f0-designers approval. Not a feature? Fix the title prefix.
  • Anything else → one f0-devs approval.
  • Add the needs-design-review label to also request a design approval on any PR.
  • Creating a new sds/ module (new package.yml) additionally requires an f0-general approval.

Policy source: ownership/review-policy.ts · Team members: ownership/teams.yml

@github-actions

Copy link
Copy Markdown
Contributor

✅ No untranslated copy added

Every user-visible string in this PR comes from the i18n layer. Codebase total unchanged at 132.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

✅ Storybook docs — no pages lost

Every page reachable on main is still reachable here.

➕ 4 added · ✏️ 32 updated

➕ Added (4)

1 new docs page(s) and 3 new story/stories.

✏️ Updated — 32 page(s)/story/stories across 6 file(s)

The source file behind each of these changed. Detection is per file, so editing one story flags its siblings too.

🔇 Added but not in the sidebar — 23

Expected for snapshot-only and internal stories (no-sidebar / !dev). Listed in case one was meant to be visible.

  • Patterns/AnalyticsDashboard › Layout And Fullscreenexperimental
  • Patterns/AnalyticsDashboard › Shared Row Custom Itemexperimental
  • Patterns/AnalyticsDashboard/Location item › Crowded Detailsexperimental
  • Patterns/AnalyticsDashboard/Location item › Custom Density Paletteexperimental
  • Patterns/AnalyticsDashboard/Location item › Darkexperimental
  • Patterns/AnalyticsDashboard/Location item › Designer And Fullscreenexperimental
  • Patterns/AnalyticsDashboard/Location item › Emptyexperimental
  • Patterns/AnalyticsDashboard/Location item › Errorexperimental
  • Patterns/AnalyticsDashboard/Location item › Intermediate Widthexperimental
  • Patterns/AnalyticsDashboard/Location item › IT Inventoryexperimental
  • Patterns/AnalyticsDashboard/Location item › Loadingexperimental
  • Patterns/AnalyticsDashboard/Location item › Map Onlyexperimental
  • Patterns/AnalyticsDashboard/Location item › Map Unavailableexperimental
  • Patterns/AnalyticsDashboard/Location item › Minimum Usable Widthexperimental
  • Patterns/AnalyticsDashboard/Location item › Narrowexperimental
  • Patterns/AnalyticsDashboard/Location item › No Selectionexperimental
  • Patterns/AnalyticsDashboard/Location item › Paired Narrowexperimental
  • Patterns/AnalyticsDashboard/Location item › Side By Sideexperimental
  • Patterns/AnalyticsDashboard/Location item › Snapshotexperimental
  • Patterns/AnalyticsDashboard/Location item › Without Density Legendexperimental

…and 3 more added but hidden.

Links point at this PR's Storybook build — browse the full Storybook.

Snapshot of the Storybook index (docs pages + stories) compared against main. Non-blocking.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-5272 to install the package

Use pnpm i github:factorialco/f0#bc3b5831b54338b7b5c334d4e136bfadcc5a2737 to install this specific commit

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

⚠️ Breaking public API changes (1)

These public exports were renamed/removed, or had a property/parameter removed, retyped, or newly required compared to main — that breaks consumers. Adding new exports or new optional props is always safe and is not flagged. If a breaking change is intentional, note it in the PR description and use a feat!:/BREAKING CHANGE commit so the release is a major bump.

Comparing f0, experimental and ai against main. Adding components, types, or optional props is safe. This check is non-blocking.

experimental

  • ✏️ f0MapMarkerVariantsbreaking change

    • entries.return changed: ArrayIterator<[ number, "company" | "default" | "employee" | "stop" | "workplace" ]>ArrayIterator<[ number, "company" | "default" | "density" | "employee" | "stop" | "workplace" ]>
    • values.return changed: ArrayIterator<"company" | "default" | "employee" | "stop" | "workplace">ArrayIterator<"company" | "default" | "density" | "employee" | "stop" | "workplace">
    • __@iterator.return changed: ArrayIterator<"company" | "default" | "employee" | "stop" | "workplace">ArrayIterator<"company" | "default" | "density" | "employee" | "stop" | "workplace">
    • required 5 was added
    • type index signature changed
    before → after
    // before
    readonly ["default", "workplace", "employee", "company", "stop"]
    // after
    readonly ["default", "workplace", "employee", "company", "stop", "density"]
➕ Additive changes (safe) — 30
  • f0: DashboardCustomItem, DashboardLocationConfig, DashboardLocationData, DashboardLocationDetailRow, DashboardLocationDetailValue, DashboardLocationDetailValueTone, DashboardLocationExportLabels, DashboardLocationItem, DashboardLocationPoint, DashboardLocationSections, DashboardLocationSummaryMetric, DashboardLocationSummaryTone, DashboardLocationTimelineData, F0DataChartGridLineContrast, F0DataChartGridLineType, dashboardLocationDetailValueTones, dashboardLocationSummaryTones, f0DataChartGridLineContrasts, f0DataChartGridLineTypes
  • experimental: F0MapDensityColor, F0MapDensityColorStep, F0MapDensityLevel, F0MapDensityPalette, F0MapDensityStyle, f0MapDensityColorSteps, f0MapDensityColors, f0MapDensityLevels, f0MapDensityPalette, f0MapDensitySurfaceStyle, resolveF0MapDensityStyle

⚠️ Could not analyze component-status (no-base) — a build may have failed; results may be incomplete.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

♿ Accessibility (axe) — components changed in this PR

✅ No a11y issues in the stories this PR changed.

Scope: only stories in the files/component folders this PR changed. It can't yet flag downstream ripple from shared-code/token changes, or diff against main (planned: base-vs-head delta).

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 69.74% 29778 / 42693
🔵 Statements 68.72% 31522 / 45869
🔵 Functions 62.56% 7115 / 11373
🔵 Branches 62.35% 22463 / 36026
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/experimental/OneTable/Table/index.tsx 96.42% 90% 80% 100% 32
packages/react/src/kits/F0DataChart/index.ts 100% 100% 100% 100%
packages/react/src/kits/F0DataChart/types.ts 100% 100% 100% 100%
packages/react/src/kits/F0DataChart/components/BarChart/useBarChartOptions.ts 96.03% 89.72% 100% 98.55% 91, 93-95, 112, 323, 364, 588-602, 702, 741, 793, 958
packages/react/src/kits/F0DataChart/components/HeatmapChart/HeatmapChart.tsx 100% 100% 100% 100%
packages/react/src/kits/F0DataChart/components/LineChart/useLineChartOptions.ts 88.37% 74.5% 92.3% 90% 50-52, 210, 249-256
packages/react/src/kits/F0DataChart/utils/options.ts 81.63% 85.98% 76.92% 83.14% 162, 255, 348, 657-704
packages/react/src/kits/F0DataChart/utils/useEChartsInstance.ts 95% 87.5% 80% 95% 28
packages/react/src/lib/storybook-utils/docs-nav.tsx 0% 0% 0% 0% 1-25
packages/react/src/patterns/F0AnalyticsDashboard/F0AnalyticsDashboard.tsx 73.07% 70% 100% 72% 72-79, 108-109
packages/react/src/patterns/F0AnalyticsDashboard/index.ts 0% 100% 100% 0% 53-56
packages/react/src/patterns/F0AnalyticsDashboard/types.ts 0% 100% 100% 0% 422-435
packages/react/src/patterns/F0AnalyticsDashboard/components/CustomItem/CustomItem.tsx 100% 100% 100% 100%
packages/react/src/patterns/F0AnalyticsDashboard/components/DashboardGrid/DashboardGrid.tsx 88.75% 73.17% 92.38% 91.48% 180-181, 188, 201, 258-266, 311-328, 377, 396, 401, 416-425, 435, 452, 475, 542, 592, 653, 780, 835, 949, 1048, 1060, 1072, 1128, 1174-1177, 1266, 1311, 1319, 1342, 1364, 1393, 1438, 1474, 1609-1621
packages/react/src/patterns/F0AnalyticsDashboard/components/DashboardItem/DashboardItem.tsx 80.7% 90.74% 60% 84% 204, 225, 453-478, 530-531
packages/react/src/patterns/F0AnalyticsDashboard/components/LocationItem/LocationItem.tsx 100% 100% 100% 100%
packages/react/src/patterns/F0AnalyticsDashboard/components/LocationItem/LocationVisualization.tsx 93.75% 88.07% 92.59% 94.31% 71, 76-94, 578-580, 864-865, 868
packages/react/src/patterns/F0AnalyticsDashboard/components/MetricItem/MetricItem.tsx 87.5% 83.33% 100% 86.95% 54-65
packages/react/src/patterns/F0AnalyticsDashboard/hooks/useDashboardExport.ts 88.42% 83.78% 100% 89.65% 77-78, 82-85, 89, 125-128, 138-142, 158, 162-166
packages/react/src/patterns/F0Map/F0Map.tsx 83.52% 73.5% 75.67% 88% 180, 183, 302-307, 317, 318, 320-327, 330-336, 359, 388, 445, 478-481, 505-507, 604-607
packages/react/src/patterns/F0Map/index.tsx 100% 100% 100% 100%
packages/react/src/patterns/F0Map/types.ts 100% 100% 100% 100%
packages/react/src/patterns/F0Map/components/F0MapMarkersLayer.tsx 65.34% 53.65% 55.55% 65.62% 47-72, 98-109, 141-148, 181, 266-292, 348
packages/react/src/patterns/F0Map/components/F0MapList/F0MapList.tsx 77.77% 75% 100% 75% 16-20, 24
packages/react/src/patterns/F0Map/components/F0MapMarker/F0MapMarker.tsx 88.88% 80.95% 85.71% 91.42% 68-69, 197-208, 215-218
packages/react/src/patterns/F0Map/components/F0MapMarker/index.ts 100% 100% 100% 100%
packages/react/src/patterns/F0Map/components/internal/BaseMapMarker/BaseMapMarker.tsx 98.46% 76.77% 96% 99.2% 68, 505-510
packages/react/src/patterns/F0Map/components/internal/BaseMapMarker/index.ts 100% 100% 100% 100%
packages/react/src/patterns/F0Map/components/internal/F0MapCluster/F0MapCluster.tsx 82.35% 64.1% 44.44% 82.35% 121-124, 159-180
Generated in workflow #17564 for commit 38195b9 by the Vitest Coverage Report Action

Implemented-with: factorial-f0

Implemented-with: factorial-pr
@zygisS22 zygisS22 changed the title feat(F0AnalyticsDashboard): add location items feat(F0AnalyticsDashboard): add reusable location item Aug 27, 2026
Implemented-with: factorial-f0

Implemented-with: factorial-pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes feat new-component Adds a new component (story file) to packages/react — must meet the full Definition of Done react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant