Skip to content

Feat/UI cleanup#116

Merged
Vunovati merged 12 commits into
mainfrom
feat/ui-cleanup
Apr 14, 2026
Merged

Feat/UI cleanup#116
Vunovati merged 12 commits into
mainfrom
feat/ui-cleanup

Conversation

@Vunovati
Copy link
Copy Markdown
Collaborator

@Vunovati Vunovati commented Apr 10, 2026

Summary by CodeRabbit

  • New Features

    • Support for aggregated-metrics queries and explicit per-component accepted data-source methods; unified "No data source" fallback component.
  • Bug Fixes

    • Reduced unnecessary recomputations in timeline/trace rendering and stabilized memoization.
  • Refactor

    • Removed several legacy dashboard widgets and their Storybook demos; renderer API now delivers payloads as response and enforces accepted data-source methods.
  • Documentation

    • Clarified metrics workflow to require aggregated-metrics method for aggregated stats.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

Warning

Rate limit exceeded

@Vunovati has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 47 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 38 minutes and 47 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab1ebc76-40b2-426c-bde1-891a3ea18a46

📥 Commits

Reviewing files that changed from the base of the PR and between 25a3543 and cb1f4e6.

📒 Files selected for processing (2)
  • .changeset/witty-ties-cross.md
  • packages/ui/src/lib/component-catalog.ts
📝 Walkthrough

Walkthrough

This PR removes several dashboard UI components and the dashboard catalog, migrates remaining dashboard components to use the observability catalog, refactors renderer/data plumbing to use typed response + acceptsDataFrom, adds aggregated-metrics routing, and standardizes no-data rendering across observability renderers.

Changes

Cohort / File(s) Summary
Removed Dashboard Components & Stories
packages/ui/src/components/dashboard/Button/index.tsx, packages/ui/src/components/dashboard/Button/Button.stories.tsx, packages/ui/src/components/dashboard/Chart/index.tsx, packages/ui/src/components/dashboard/Chart/Chart.stories.tsx, packages/ui/src/components/dashboard/DatePicker/index.tsx, packages/ui/src/components/dashboard/DatePicker/DatePicker.stories.tsx, packages/ui/src/components/dashboard/List/index.tsx, packages/ui/src/components/dashboard/List/List.stories.tsx, packages/ui/src/components/dashboard/Metric/index.tsx, packages/ui/src/components/dashboard/Metric/Metric.stories.tsx, packages/ui/src/components/dashboard/Table/index.tsx, packages/ui/src/components/dashboard/Table/Table.stories.tsx
Deleted component implementations and their Storybook stories for Button, Chart, DatePicker, List, Metric, and Table; removed their exports.
Dashboard → Observability Typing Migration
packages/ui/src/components/dashboard/Badge/index.tsx, .../Card/index.tsx, .../Divider/index.tsx, .../Empty/index.tsx, .../Grid/index.tsx, .../Heading/index.tsx, .../Stack/index.tsx, .../Text/index.tsx
Switched generic prop typings and imports from dashboardCatalog.components.* to observabilityCatalog.components.* without runtime changes.
Barrel & Registry Cleanup
packages/ui/src/components/dashboard/index.ts, packages/ui/src/components/index.ts, packages/ui/src/index.ts
Removed re-exports for deleted components and removed the componentRegistry export; pruned top-level re-exports from package entry.
Dashboard Catalog Removal
packages/ui/src/lib/catalog.ts
Removed dashboardCatalog and componentList entirely.
Renderer: response / acceptsDataFrom
packages/ui/src/lib/renderer.tsx, packages/ui/src/lib/renderer.test.tsx
Changed data-bearing API from dataresponse, added type-level SDK-response inference, introduced runtime validation of dataSource.method vs acceptsDataFrom, and updated tests/catalog entries to match.
Component-catalog & Observability Catalog
packages/ui/src/lib/component-catalog.ts, packages/ui/src/lib/observability-catalog.ts
Added searchAggregatedMetrics dataSource variant and DataSourceMethod; added optional acceptsDataFrom to component definitions and populated observabilityCatalog components with acceptsDataFrom lists.
use-kopai-data: aggregated metrics routing
packages/ui/src/hooks/use-kopai-data.ts, packages/ui/src/hooks/use-kopai-data.test.ts
Removed in-case redirection from searchMetricsPagesearchAggregatedMetrics; added explicit searchAggregatedMetrics case and updated tests to assert aggregated-client call.
Observability renderers: unified NoDataSource & response usage
packages/ui/src/components/observability/renderers/NoDataSource.tsx, .../OtelMetric*.tsx, .../OtelLogTimeline.tsx, .../OtelTraceDetail.tsx, .../OtelMetricStat.tsx, .../OtelMetricTable.tsx, .../OtelMetricTimeSeries.tsx
Added NoDataSource component and refactored many renderers to early-return it when !hasData; switched renderers to use props.response and removed local type casts/aliases.
Utilities & Helpers Removed
packages/ui/src/components/observability/utils/flatten-tree.ts, packages/ui/src/components/observability/utils/lttb.ts
Removed getAllDescendantIds and downsampleTimeSeries helper exports.
Trace & Timeline tweaks
packages/ui/src/components/observability/TraceTimeline/FlamegraphView.tsx, .../SpanRow.tsx, .../index.tsx, packages/ui/src/components/observability/LogTimeline/LogRow.tsx
Memoized viewRoots with useMemo; removed isHovered prop from SpanRow and stopped passing it; removed useMemo around log message in LogRow.
Pages & Docs
packages/ui/src/pages/observability.tsx, skills/create-dashboard/rules/workflow.md
Switched certain METRICS_TREE cards to use searchAggregatedMetrics; removed exported serializeLogfmt; updated docs to instruct using searchAggregatedMetrics for aggregated MetricStat.
Renderer tests & examples updated
packages/ui/src/lib/renderer.test.tsx
Updated test components to render response instead of data and added acceptsDataFrom to test catalog entries.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Renderer
    participant ElementRenderer
    participant DataSourceElement
    participant useKopaiData
    participant KopaiClient

    User->>Renderer: render catalog elements (may pass acceptsDataFromByType)
    Renderer->>ElementRenderer: render element tree
    ElementRenderer->>DataSourceElement: encounter element with dataSource
    DataSourceElement->>Renderer: check dataSource.method ∈ acceptsDataFrom
    alt method accepted
        DataSourceElement->>useKopaiData: fetch(method, params, signal)
        useKopaiData->>KopaiClient: call API (searchMetricsPage / searchAggregatedMetrics / ...)
        KopaiClient-->>useKopaiData: response
        useKopaiData-->>DataSourceElement: { response, isLoading, error }
        DataSourceElement->>ElementRenderer: render child with response prop
    else method rejected
        DataSourceElement->>ElementRenderer: render "dataSource method not accepted" (no hasData)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hopped through catalog fields today,

swapped data for response along the way,
components now ask who may feed their streams,
metrics gather sums and traces chase their dreams,
a small rabbit cheers observability's new play.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Feat/UI cleanup' is vague and generic—it uses non-descriptive terms that don't convey specific information about what was changed, removed, or updated in the codebase. Provide a more specific title that clearly describes the main objective, such as 'Remove deprecated dashboard components and migrate to observability catalog' or 'Refactor dashboard UI and simplify component API'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ui-cleanup

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
packages/ui/src/hooks/use-kopai-data.test.ts (1)

156-184: Strengthen this test by asserting the exact aggregated call payload.

Current checks prove method selection, but not argument correctness (Line 182). A wrong params mapping could still pass.

Proposed test hardening
       expect(result.current.data).toEqual(mockData);
-      expect(mockClient.searchAggregatedMetrics).toHaveBeenCalled();
+      expect(mockClient.searchAggregatedMetrics).toHaveBeenCalledWith(
+        {
+          metricType: "Sum",
+          metricName: "kopai.ingestion.bytes",
+          aggregate: "sum",
+          groupBy: ["signal"],
+        },
+        expect.objectContaining({ signal: expect.any(AbortSignal) })
+      );
+      expect(mockClient.searchAggregatedMetrics).toHaveBeenCalledTimes(1);
       expect(mockClient.searchMetricsPage).not.toHaveBeenCalled();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ui/src/hooks/use-kopai-data.test.ts` around lines 156 - 184, The
test currently verifies that useKopaiData chooses searchAggregatedMetrics but
not that it passes the correct parameters; update the assertion to check
mockClient.searchAggregatedMetrics was called with the exact mapped payload
derived from the dataSource.params (e.g., metricType, metricName, aggregate,
groupBy and any expected defaults like cursor/page size), referencing the test's
dataSource object and the useKopaiData hook to construct the expected call, and
replace or augment the
expect(mockClient.searchAggregatedMetrics).toHaveBeenCalled() with an
expect(mockClient.searchAggregatedMetrics).toHaveBeenCalledWith(<expectedPayload>)
assertion to ensure correct argument mapping.
packages/ui/src/lib/observability-catalog.ts (1)

119-151: Consider encoding metric-type compatibility alongside the method.

searchMetricsPage is still broad here, so MetricTimeSeries, MetricHistogram, and MetricTable rely on descriptions to avoid invalid pairings. If this metadata is now part of the contract, adding something like acceptsMetricTypes would make those constraints enforceable instead of implicit.

Based on learnings: When using Metrics search, the --type flag is required and must be one of: Gauge, Sum, Histogram, ExponentialHistogram, Summary

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ui/src/lib/observability-catalog.ts` around lines 119 - 151, Add
explicit metric-type compatibility metadata alongside acceptsDataFrom for
components like MetricTimeSeries, MetricHistogram, MetricTable, and MetricStat
by introducing an acceptsMetricTypes property (an array of literal metric type
strings) and populate it with the allowed values from the metrics search --type
flag (e.g., "Gauge", "Sum", "Histogram", "ExponentialHistogram", "Summary");
update each component object (MetricTimeSeries, MetricHistogram, MetricTable,
MetricStat) to include the appropriate subset of these strings so the contract
enforces valid pairings rather than relying on descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ui/src/lib/component-catalog.ts`:
- Line 65: The acceptsDataFrom schema currently allows any string; change it to
validate only known data-source method names (e.g., use
z.array(z.enum([...knownNames])) or z.array(z.nativeEnum(DataSourceMethod)) or
z.array(z.string().refine(s => s in DataSourceMethodMap)) so typos fail
validation. Locate acceptsDataFrom in component-catalog.ts and replace
z.array(z.string()).readonly().optional() with a schema that sources its allowed
values from the canonical list/type of data-source methods used by InferData
(e.g., DataSourceMethod, DataSourceMethodNames, or the DataSourceMethodMap) so
the compiler and runtime validation keep InferData<CD> typed correctly.

In `@packages/ui/src/lib/generate-prompt-instructions.ts`:
- Around line 178-180: The current fallback string advertises dataSource support
by default by returning "Accepts dataSource: yes" when def.acceptsDataFrom is
missing; update the logic that builds this string (the expression using
def.acceptsDataFrom?.length) to only claim support when def.acceptsDataFrom
exists and has entries, and use a negative fallback such as "Accepts dataSource:
no" for the else path so leaf components without acceptsDataFrom are not
advertised as supporting data binding.
- Around line 62-66: The reqStr logic treats required-but-nullable props as
optional; update the classification for isNullable/isRequired so all four states
are expressed: compute isNullable = typeStr.endsWith("| null") and isRequired =
required.has(key) (do not negate with isNullable), then set reqStr to exactly
one of "(required)", "(required, may be null)", "(optional)", or "(optional, may
be null)" based on isRequired and isNullable (use the existing symbols
isNullable, isRequired, reqStr, typeStr, required.has(key) to locate and change
the logic).

In `@packages/ui/src/lib/renderer.tsx`:
- Around line 47-58: The renderer currently trusts runtime element.dataSource
and injects its response into components, bypassing the compile-time helpers
(SDKResponseFor, InferData and component acceptsDataFrom); add a runtime check
in the rendering path (where element is processed before creating response) that
compares element.dataSource.method against
catalog.components[element.type]?.acceptsDataFrom (or treats missing
acceptsDataFrom as empty) and throw or return a clear failure if the method is
not included; ensure this check runs before invoking KopaiClient methods and
before setting the response passed to the component so the runtime tree cannot
supply an incompatible dataSource.

---

Nitpick comments:
In `@packages/ui/src/hooks/use-kopai-data.test.ts`:
- Around line 156-184: The test currently verifies that useKopaiData chooses
searchAggregatedMetrics but not that it passes the correct parameters; update
the assertion to check mockClient.searchAggregatedMetrics was called with the
exact mapped payload derived from the dataSource.params (e.g., metricType,
metricName, aggregate, groupBy and any expected defaults like cursor/page size),
referencing the test's dataSource object and the useKopaiData hook to construct
the expected call, and replace or augment the
expect(mockClient.searchAggregatedMetrics).toHaveBeenCalled() with an
expect(mockClient.searchAggregatedMetrics).toHaveBeenCalledWith(<expectedPayload>)
assertion to ensure correct argument mapping.

In `@packages/ui/src/lib/observability-catalog.ts`:
- Around line 119-151: Add explicit metric-type compatibility metadata alongside
acceptsDataFrom for components like MetricTimeSeries, MetricHistogram,
MetricTable, and MetricStat by introducing an acceptsMetricTypes property (an
array of literal metric type strings) and populate it with the allowed values
from the metrics search --type flag (e.g., "Gauge", "Sum", "Histogram",
"ExponentialHistogram", "Summary"); update each component object
(MetricTimeSeries, MetricHistogram, MetricTable, MetricStat) to include the
appropriate subset of these strings so the contract enforces valid pairings
rather than relying on descriptions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0422c133-d3f1-40be-b520-2111318dbc23

📥 Commits

Reviewing files that changed from the base of the PR and between e9d36b2 and 025f989.

⛔ Files ignored due to path filters (1)
  • packages/ui/src/lib/__snapshots__/generate-prompt-instructions.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (47)
  • packages/ui/src/components/dashboard/Badge/index.tsx
  • packages/ui/src/components/dashboard/Button/Button.stories.tsx
  • packages/ui/src/components/dashboard/Button/index.tsx
  • packages/ui/src/components/dashboard/Card/index.tsx
  • packages/ui/src/components/dashboard/Chart/Chart.stories.tsx
  • packages/ui/src/components/dashboard/Chart/index.tsx
  • packages/ui/src/components/dashboard/DatePicker/DatePicker.stories.tsx
  • packages/ui/src/components/dashboard/DatePicker/index.tsx
  • packages/ui/src/components/dashboard/Divider/index.tsx
  • packages/ui/src/components/dashboard/Empty/index.tsx
  • packages/ui/src/components/dashboard/Grid/index.tsx
  • packages/ui/src/components/dashboard/Heading/index.tsx
  • packages/ui/src/components/dashboard/List/List.stories.tsx
  • packages/ui/src/components/dashboard/List/index.tsx
  • packages/ui/src/components/dashboard/Metric/Metric.stories.tsx
  • packages/ui/src/components/dashboard/Metric/index.tsx
  • packages/ui/src/components/dashboard/Stack/index.tsx
  • packages/ui/src/components/dashboard/Table/Table.stories.tsx
  • packages/ui/src/components/dashboard/Table/index.tsx
  • packages/ui/src/components/dashboard/Text/index.tsx
  • packages/ui/src/components/dashboard/index.ts
  • packages/ui/src/components/index.ts
  • packages/ui/src/components/observability/LogTimeline/LogRow.tsx
  • packages/ui/src/components/observability/TraceTimeline/FlamegraphView.tsx
  • packages/ui/src/components/observability/TraceTimeline/SpanRow.tsx
  • packages/ui/src/components/observability/TraceTimeline/index.tsx
  • packages/ui/src/components/observability/renderers/NoDataSource.tsx
  • packages/ui/src/components/observability/renderers/OtelLogTimeline.tsx
  • packages/ui/src/components/observability/renderers/OtelMetricDiscovery.tsx
  • packages/ui/src/components/observability/renderers/OtelMetricHistogram.tsx
  • packages/ui/src/components/observability/renderers/OtelMetricStat.tsx
  • packages/ui/src/components/observability/renderers/OtelMetricTable.tsx
  • packages/ui/src/components/observability/renderers/OtelMetricTimeSeries.tsx
  • packages/ui/src/components/observability/renderers/OtelTraceDetail.tsx
  • packages/ui/src/components/observability/utils/flatten-tree.ts
  • packages/ui/src/components/observability/utils/lttb.ts
  • packages/ui/src/hooks/use-kopai-data.test.ts
  • packages/ui/src/hooks/use-kopai-data.ts
  • packages/ui/src/index.ts
  • packages/ui/src/lib/catalog.ts
  • packages/ui/src/lib/component-catalog.ts
  • packages/ui/src/lib/generate-prompt-instructions.ts
  • packages/ui/src/lib/observability-catalog.ts
  • packages/ui/src/lib/renderer.test.tsx
  • packages/ui/src/lib/renderer.tsx
  • packages/ui/src/pages/observability.tsx
  • skills/create-dashboard/rules/workflow.md
💤 Files with no reviewable changes (20)
  • packages/ui/src/components/observability/TraceTimeline/SpanRow.tsx
  • packages/ui/src/components/observability/TraceTimeline/index.tsx
  • packages/ui/src/components/observability/utils/flatten-tree.ts
  • packages/ui/src/components/dashboard/List/index.tsx
  • packages/ui/src/components/dashboard/DatePicker/index.tsx
  • packages/ui/src/components/dashboard/Chart/index.tsx
  • packages/ui/src/components/dashboard/DatePicker/DatePicker.stories.tsx
  • packages/ui/src/lib/catalog.ts
  • packages/ui/src/components/dashboard/Button/Button.stories.tsx
  • packages/ui/src/components/dashboard/Metric/Metric.stories.tsx
  • packages/ui/src/components/dashboard/Table/Table.stories.tsx
  • packages/ui/src/components/dashboard/List/List.stories.tsx
  • packages/ui/src/components/dashboard/Button/index.tsx
  • packages/ui/src/components/dashboard/Metric/index.tsx
  • packages/ui/src/components/observability/utils/lttb.ts
  • packages/ui/src/components/dashboard/Table/index.tsx
  • packages/ui/src/components/dashboard/Chart/Chart.stories.tsx
  • packages/ui/src/components/dashboard/index.ts
  • packages/ui/src/components/index.ts
  • packages/ui/src/index.ts

Comment thread packages/ui/src/lib/component-catalog.ts Outdated
Comment thread packages/ui/src/lib/generate-prompt-instructions.ts Outdated
Comment thread packages/ui/src/lib/generate-prompt-instructions.ts Outdated
Comment thread packages/ui/src/lib/renderer.tsx
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ui/src/lib/generate-prompt-instructions.ts`:
- Around line 182-184: The generated instructions claim per-component
acceptsDataFrom methods (uses def.acceptsDataFrom) but buildExampleElements
still hardcodes searchTracesPage for every leaf, causing contradictions for
components like MetricStat and MetricDiscovery; update buildExampleElements to
consult each component's acceptsDataFrom (or def.acceptsDataFrom) and pick an
example dataSource method that actually appears in that list (fall back to a
generic/none option if empty) instead of always using searchTracesPage so
example trees match the accepted-method docs.

In `@packages/ui/src/lib/renderer.tsx`:
- Around line 324-329: The new default of acceptsDataFromByType = {} causes the
exported Renderer to reject every data-backed element; change the parameter to
be optional (default undefined) and update the guard that checks
acceptsDataFrom?.includes(...) to only run validation when acceptsDataFromByType
is provided, so omitting the map means "skip validation" and preserves existing
behavior for Renderer (leave createRendererFromCatalog consumers able to pass
explicit metadata if they want strict checks); reference acceptsDataFromByType,
Renderer, useKopaiData, and createRendererFromCatalog when making this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75c3a471-48e4-4c34-be53-5e1cda5d10bb

📥 Commits

Reviewing files that changed from the base of the PR and between 025f989 and ba4fc52.

⛔ Files ignored due to path filters (1)
  • packages/ui/src/lib/__snapshots__/generate-prompt-instructions.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • packages/ui/src/hooks/use-kopai-data.test.ts
  • packages/ui/src/lib/generate-prompt-instructions.ts
  • packages/ui/src/lib/renderer.test.tsx
  • packages/ui/src/lib/renderer.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/ui/src/hooks/use-kopai-data.test.ts
  • packages/ui/src/lib/renderer.test.tsx

Comment thread packages/ui/src/lib/generate-prompt-instructions.ts
Comment thread packages/ui/src/lib/renderer.tsx Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ui/src/lib/component-catalog.ts`:
- Around line 56-63: The current cast widens the mapped array to string, losing
literal types so DataSourceMethod collapses to string; fix by preserving literal
tuple when calling z.enum — e.g. call z.enum(dataSourceSchema.options.map(o =>
o.shape.method.value) as const) (or otherwise construct a readonly tuple of
those literal values) so z.infer<typeof dataSourceMethodSchema> yields the
literal union; update usages like DataSourceMethod and acceptsDataFrom to rely
on the restored literal union.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a6aec86-ba3f-424e-b0c7-7060b6c0631c

📥 Commits

Reviewing files that changed from the base of the PR and between 984bbb2 and 25a3543.

⛔ Files ignored due to path filters (1)
  • packages/ui/src/lib/__snapshots__/generate-prompt-instructions.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • packages/ui/src/lib/component-catalog.ts

Comment thread packages/ui/src/lib/component-catalog.ts
"Component description to be displayed by the prompt generator"
),
props: z.unknown(),
acceptsDataFrom: z.array(dataSourceMethodSchema).readonly().optional(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Enforce acceptsDataFrom in the generated element schemas.

Right now this is metadata only. createCatalog() still uses dataSource: dataSourceSchema.optional() on Lines 151-152 for every component, so a component that omits acceptsDataFrom can still validate with any dataSource, and a component that lists a subset is not narrowed to it. Invalid trees will pass uiTreeSchema and fail later in the renderer.

@Vunovati Vunovati merged commit eac75d0 into main Apr 14, 2026
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