Repository navigation
feat: Deck map ai tool - #654
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Deck map AI tools and schemas, refactors map-config and map-layer utilities, wires host-injected map tools into Mosaic AI (MAP_TOOL_KEY), propagates per-panel dataPolicy and runtime-issue plumbing into map rendering, updates CLI/store/UI to use the new utilities, expands exports and package deps, and adds tests and docs. ChangesDeck map dashboard AI tool and host tool injection
Estimated code review effort: 🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/mosaic/src/ai.ts (2)
172-172: 💤 Low valueImplicit naming contract on
create_dashboard_map.The prompt text hardcodes the expected tool name
create_dashboard_map, butextraToolslets hosts register tools under any key. If a host names its map tool differently, these instructions become misleading. Consider documenting the expected key in theextraToolsJSDoc, or exposing a small constant/registration helper so the prompt and the tool key stay in sync.Also applies to: 197-197
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/mosaic/src/ai.ts` at line 172, The prompt text hardcodes the tool name create_dashboard_map while hosts can register tools under any key via extraTools; update the code to avoid the implicit naming contract by introducing a single exported constant (e.g., MAP_TOOL_KEY) or a small registration helper (e.g., registerMapTool) and reference that symbol in the prompt text instead of the literal string, and add JSDoc on extraTools to document the expected key/registration helper so prompt and tool key stay in sync (also apply the same change for the other occurrence noted around line 197).
485-491: 💤 Low valueHost tools can silently override built-in tools.
...hostToolsis spread after the built-in entries, so a host returning a key likecreate_dashboard_artifactor any chart tool name will shadow the Mosaic-owned implementation without warning. If override is intentional, fine; otherwise consider spreading hostTools first (so built-ins win), or detecting collisions and warning. Worth a quick decision since this is a public extension point.Optional defensive variant
- const hostTools = extraTools?.(deps) ?? {}; + const hostTools = extraTools?.(deps) ?? {}; + if (process.env.NODE_ENV !== 'production') { + for (const key of Object.keys(hostTools)) { + if (key in builtInToolKeys) { + console.warn(`[mosaic] extraTools "${key}" overrides a built-in dashboard tool.`); + } + } + }Also applies to: 524-524
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/mosaic/src/ai.ts` around lines 485 - 491, Host-provided tools (hostTools from extraTools) are currently spread after built-in entries in CreateDashboardAiToolsOptions (in the function creating chartTools and hostTools), allowing silent overrides of built-in tools like create_dashboard_artifact or any chart tool; change the merge order or add collision detection: either spread hostTools before the built-ins so built-ins win, or, inside the function that builds the final tool map (where createChartTools, resolvedChartTypes, hostTools and chartTools are combined), iterate hostTools keys and check for existing keys in chartTools/built-ins and log/warn or throw if a collision is found (refer to hostTools, createChartTools, createDashboardToolDeps, createDefaultChartTypes, and the built-in key names such as create_dashboard_artifact) and choose the desired behavior (prevent override by default or allow with explicit warning).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/deck/src/mapConfigUtils.ts`:
- Around line 126-128: The code wraps options.sourceSqlQuery into baseSource
without removing trailing semicolons, which makes the resulting FROM (<query>)
invalid; before using options.sourceSqlQuery in baseSource (the expression
constructing baseSource), trim whitespace and strip any trailing semicolon
characters from options.sourceSqlQuery (e.g. remove one or more trailing ';' and
trailing whitespace) and then wrap the cleaned query in `(<cleanedQuery>) AS
"__sqlrooms_dashboard_map_source"`; keep the fallback to
quoteDeckMapSqlTableReference(options.tableReference) unchanged.
---
Nitpick comments:
In `@packages/mosaic/src/ai.ts`:
- Line 172: The prompt text hardcodes the tool name create_dashboard_map while
hosts can register tools under any key via extraTools; update the code to avoid
the implicit naming contract by introducing a single exported constant (e.g.,
MAP_TOOL_KEY) or a small registration helper (e.g., registerMapTool) and
reference that symbol in the prompt text instead of the literal string, and add
JSDoc on extraTools to document the expected key/registration helper so prompt
and tool key stay in sync (also apply the same change for the other occurrence
noted around line 197).
- Around line 485-491: Host-provided tools (hostTools from extraTools) are
currently spread after built-in entries in CreateDashboardAiToolsOptions (in the
function creating chartTools and hostTools), allowing silent overrides of
built-in tools like create_dashboard_artifact or any chart tool; change the
merge order or add collision detection: either spread hostTools before the
built-ins so built-ins win, or, inside the function that builds the final tool
map (where createChartTools, resolvedChartTypes, hostTools and chartTools are
combined), iterate hostTools keys and check for existing keys in
chartTools/built-ins and log/warn or throw if a collision is found (refer to
hostTools, createChartTools, createDashboardToolDeps, createDefaultChartTypes,
and the built-in key names such as create_dashboard_artifact) and choose the
desired behavior (prevent override by default or allow with explicit warning).
🪄 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: ea38ca43-1b82-4842-8c58-59a642cd2ad3
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
apps/sqlrooms-cli-ui/src/createDashboardToolDeps.tspackages/deck/__tests__/dashboard-ai-map.test.tspackages/deck/package.jsonpackages/deck/src/ai.tspackages/deck/src/dashboard.tsxpackages/deck/src/index.tspackages/deck/src/mapConfigUtils.tspackages/mosaic/src/ai.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/deck/src/ai.ts`:
- Around line 82-103: The sqlQuery path currently validates columns by calling
deps.resolveTable (so DeckMapDashboardToolParameters and downstream logic
validate against the base table schema), which breaks for queries that alias or
compute geo fields; change the validation so that when sqlQuery is provided you
either (A) accept an additional explicit queryColumns parameter (e.g., array of
column descriptors) in DeckMapDashboardToolParameters and validate/auto-detect
against that array instead of resolveTable, or (B) skip calling
deps.resolveTable and bypass table-column validation whenever the explicit map
columns (e.g., lon/lat/geometry) are supplied in the request; update the schema
and the code paths that call deps.resolveTable to branch on sqlQuery + presence
of explicit query columns and perform validation against the supplied columns
only.
🪄 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: 7569c328-78d0-4812-aae0-29fff6831f89
📒 Files selected for processing (3)
packages/deck/__tests__/dashboard-ai-map.test.tspackages/deck/src/ai.tspackages/deck/src/index.ts
| ( | ||
| context as | ||
| | (ChartToolExecutionContext & {getAiRunContext?: () => unknown}) | ||
| | (ChartToolExecutionContext & {getAztiRunContext?: () => unknown}) |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/deck/__tests__/dashboard-ai-map.test.ts (1)
140-157: ⚡ Quick winConsider strengthening the semicolon-stripping assertion.
The current assertion only checks the wrapped subquery still appears in the SQL but does not actually prove trailing semicolons were stripped — e.g.
FROM (SELECT * FROM earthquakes; ;) AS "..."would also passtoContain(...). Asserting the absence of;inside the parenthesized inner SQL (or matching the full normalized substring) would make the test meaningful for the stated behavior.♻️ Proposed tightening
- expect( - deps.panels[0].config.datasets.earthquakes.source.sqlQuery, - ).toContain( - 'FROM (SELECT * FROM earthquakes) AS "__sqlrooms_dashboard_map_source"', - ); + const wrappedSql: string = + deps.panels[0].config.datasets.earthquakes.source.sqlQuery; + expect(wrappedSql).toContain( + 'FROM (SELECT * FROM earthquakes) AS "__sqlrooms_dashboard_map_source"', + ); + expect(wrappedSql).not.toMatch(/;\s*\)\s*AS\s+"__sqlrooms_dashboard_map_source"/);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/deck/__tests__/dashboard-ai-map.test.ts` around lines 140 - 157, The test 'strips trailing semicolons from wrapped source SQL queries' currently only checks that the wrapped subquery string exists but not that trailing semicolons were removed; update the assertion on deps.panels[0].config.datasets.earthquakes.source.sqlQuery (after calling (tool as any).execute with createDeckMapDashboardTool(createDeps())) to either (a) assert the exact normalized wrapped substring equals FROM (SELECT * FROM earthquakes) AS "__sqlrooms_dashboard_map_source" or (b) assert that there is no ';' character inside the parenthesized inner SQL (i.e., within the parentheses following FROM), so the test proves trailing semicolons were stripped. Ensure you reference the same fields used now: deps.panels[0].config.datasets.earthquakes.source.sqlQuery and the execute call on tool.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/deck/src/mapConfigUtils.ts`:
- Around line 126-131: The ternary that builds baseSource currently checks
options.sourceSqlQuery but injects cleanedSourceSqlQuery, which allows
whitespace/semicolon-only inputs to produce an empty subquery; change the
predicate to test cleanedSourceSqlQuery (truthiness) instead of
options.sourceSqlQuery so you only build `(${cleanedSourceSqlQuery}) AS
"__sqlrooms_dashboard_map_source"` when the cleaned string is non-empty, and
otherwise fall back to quoteDeckMapSqlTableReference(options.tableReference);
update the expression that defines baseSource accordingly.
---
Nitpick comments:
In `@packages/deck/__tests__/dashboard-ai-map.test.ts`:
- Around line 140-157: The test 'strips trailing semicolons from wrapped source
SQL queries' currently only checks that the wrapped subquery string exists but
not that trailing semicolons were removed; update the assertion on
deps.panels[0].config.datasets.earthquakes.source.sqlQuery (after calling (tool
as any).execute with createDeckMapDashboardTool(createDeps())) to either (a)
assert the exact normalized wrapped substring equals FROM (SELECT * FROM
earthquakes) AS "__sqlrooms_dashboard_map_source" or (b) assert that there is no
';' character inside the parenthesized inner SQL (i.e., within the parentheses
following FROM), so the test proves trailing semicolons were stripped. Ensure
you reference the same fields used now:
deps.panels[0].config.datasets.earthquakes.source.sqlQuery and the execute call
on tool.
🪄 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: 20631480-e2a2-49a2-96f2-f168474004d1
📒 Files selected for processing (6)
packages/deck/__tests__/dashboard-ai-map.test.tspackages/deck/src/ai.tspackages/deck/src/mapConfigUtils.tspackages/mosaic/README.mdpackages/mosaic/__tests__/dashboard-ai.test.tspackages/mosaic/src/ai.ts
✅ Files skipped from review due to trivial changes (1)
- packages/mosaic/README.md
# Conflicts: # packages/deck/__tests__/dashboard-ai-map.test.ts # packages/deck/src/ai.ts # packages/mosaic/src/ai.ts
682a7d1 to
4dd6bea
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/deck/src/mapConfigUtils.ts (1)
126-131:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse the cleaned SQL value to decide subquery wrapping.
Line 129 checks the raw
options.sourceSqlQuery, but Line 130 injectscleanedSourceSqlQuery. Inputs like" ; "become empty after cleaning and produce invalid SQL (FROM () AS ...).Proposed fix
const cleanedSourceSqlQuery = options.sourceSqlQuery ?.trim() .replace(/(?:\s*;+\s*)+$/, ''); - const baseSource = options.sourceSqlQuery + const baseSource = cleanedSourceSqlQuery ? `(${cleanedSourceSqlQuery}) AS "__sqlrooms_dashboard_map_source"` : quoteDeckMapSqlTableReference(options.tableReference);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/deck/src/mapConfigUtils.ts` around lines 126 - 131, The code uses options.sourceSqlQuery to decide whether to wrap a subquery but inserts cleanedSourceSqlQuery into the final SQL, which can be empty (e.g., " ; ") and produce invalid SQL; change the decision to use the cleaned value: compute cleanedSourceSqlQuery first, then set baseSource to `(${cleanedSourceSqlQuery}) AS "__sqlrooms_dashboard_map_source"` only when cleanedSourceSqlQuery is non-empty (truthy), otherwise fall back to quoteDeckMapSqlTableReference(options.tableReference); reference cleanedSourceSqlQuery, options.sourceSqlQuery, baseSource, and quoteDeckMapSqlTableReference when making this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@packages/deck/src/mapConfigUtils.ts`:
- Around line 126-131: The code uses options.sourceSqlQuery to decide whether to
wrap a subquery but inserts cleanedSourceSqlQuery into the final SQL, which can
be empty (e.g., " ; ") and produce invalid SQL; change the decision to use the
cleaned value: compute cleanedSourceSqlQuery first, then set baseSource to
`(${cleanedSourceSqlQuery}) AS "__sqlrooms_dashboard_map_source"` only when
cleanedSourceSqlQuery is non-empty (truthy), otherwise fall back to
quoteDeckMapSqlTableReference(options.tableReference); reference
cleanedSourceSqlQuery, options.sourceSqlQuery, baseSource, and
quoteDeckMapSqlTableReference when making this change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f6e9844e-b967-4673-bf5a-7b28977c97ff
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
packages/deck/__tests__/createDeckJsonConfiguration.test.tspackages/deck/__tests__/dashboard-ai-map.test.tspackages/deck/__tests__/mapLayerConfigUtils.test.tspackages/deck/package.jsonpackages/deck/src/MapSettings.tsxpackages/deck/src/ai.tspackages/deck/src/dashboard.tsxpackages/deck/src/index.tspackages/deck/src/json/colorScaleFunction.tspackages/deck/src/mapConfigUtils.tspackages/deck/src/mapLayerConfigUtils.tspackages/mosaic/README.mdpackages/mosaic/__tests__/dashboard-ai.test.tspackages/mosaic/src/ai.ts
✅ Files skipped from review due to trivial changes (2)
- packages/mosaic/README.md
- packages/deck/package.json
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/deck/src/mapConfigUtils.ts (2)
221-260:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAllow SQL-projected geometry aliases here.
When
sourceSqlQueryprojects a new geometry alias and the caller passes it viageometryColumn, this unconditionalensureDeckMapColumnExists(...)check rejects a valid config becauseoptions.columnsonly describes the base table. That breaks SQL-backed geometry panels before they can be created.Suggested fix
if (detectedGeometryColumn) { - ensureDeckMapColumnExists( - options.columns, - detectedGeometryColumn.geometryColumn, - 'geometry', - ); + const shouldValidateAgainstTableColumns = + !options.sourceSqlQuery || !explicitGeometryColumn; + if (shouldValidateAgainstTableColumns) { + ensureDeckMapColumnExists( + options.columns, + detectedGeometryColumn.geometryColumn, + 'geometry', + ); + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/deck/src/mapConfigUtils.ts` around lines 221 - 260, The code unconditionally calls ensureDeckMapColumnExists when a detectedGeometryColumn is present, which wrongly rejects cases where the geometry alias comes from a projected sourceSqlQuery; update the guard so that ensureDeckMapColumnExists is only invoked for base-table column checks (i.e., when options.sourceSqlQuery is not provided). In practice, modify the block around detectedGeometryColumn and ensureDeckMapColumnExists so it skips the existence check if options.sourceSqlQuery is set (allowing SQL-projected geometry aliases passed via geometryColumn to succeed).
330-345:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDon't overwrite existing SQL-backed geometry panels during regeneration.
This new geometry fallback now rebuilds configs for geometry-only tables too, but the rebuild only uses
table.table/detected columns. If the existing panel was backed bysource.sqlQueryor an explicit geometry column/hint, regeneration replaces it with a raw-table dataset and can break an otherwise working map. Please carry the existing dataset source/geometry settings forward here, or bail out when the current panel is SQL-backed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/deck/src/mapConfigUtils.ts` around lines 330 - 345, The regeneration currently always calls createDeckMapDashboardConfigForTable and overwrites panel.config even for SQL-backed or explicitly-hinted geometry panels; change this to first inspect the existingConfig (panel.config) and if existingConfig.source?.sqlQuery exists or an explicit geometry column/hint is present, preserve the current config by returning existingConfig (i.e., bail out) instead of rebuilding, or alternatively merge the existing source/geometry settings into the payload passed to createDeckMapDashboardConfigForTable so source/sqlQuery and explicit geometryColumn/latitude/longitude hints are carried forward; check for source.sqlQuery and any explicit geometry hints before calling createDeckMapDashboardConfigForTable and act accordingly.
🧹 Nitpick comments (2)
packages/mosaic/src/chart-runtime.ts (1)
118-129: ⚡ Quick winMake
disabledoverride semantics explicit.At Line 118, only truthy
override.disabledis handled, sodisabled: falsecurrently behaves like “not provided” and inherits the base value. If this is intended as a true override object, it should either apply explicitfalseor narrow the type to a one-way flag (disabled?: true).Suggested adjustment (support explicit false override)
- if (override.disabled) { - return { - ...(basePolicy ?? {}), - disabled: true, - }; - } - return { ...(basePolicy ?? {}), + ...(override.disabled !== undefined ? {disabled: override.disabled} : {}), ...(override.maxRows !== undefined ? {maxRows: override.maxRows} : {}), ...(override.reason !== undefined ? {reason: override.reason} : {}), };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/mosaic/src/chart-runtime.ts` around lines 118 - 129, The current merge logic in chart-runtime.ts treats override.disabled truthily, so a consumer cannot explicitly set disabled: false; update the merge in the function that constructs the final policy (the block currently returning ...(basePolicy ?? {}), ...(override.maxRows...), etc.) to treat disabled as an explicit override by checking override.disabled !== undefined and, when present, setting disabled: override.disabled; alternatively (if you prefer one-way flag semantics) change the override type to only allow disabled?: true and keep the existing truthy check—apply the first option to preserve explicit false semantics on the returned policy.packages/deck/src/ai.ts (1)
101-129: 💤 Low valueDuplicate
reasoningfield in schema extension.
DeckMapDashboardToolParametersextendsDeckMapConfigToolParameterswhich already defines areasoningfield (lines 92-94). The extension redefinesreasoningagain at lines 126-128, which shadows the inherited field. While Zod will use the extended definition, this redundancy is confusing and may cause maintenance issues.♻️ Remove the duplicate reasoning field
export const DeckMapDashboardToolParameters = DeckMapConfigToolParameters.extend({ artifactId: z .string() .optional() .describe( 'Optional dashboard artifact ID. Defaults to current dashboard.', ), tableName: z .string() .optional() .describe( 'Optional table name used only to select/resolve the target dashboard table. Data sources still come from config.datasets.', ), createArtifactIfMissing: z .boolean() .optional() .default(true) .describe('If true, create dashboard artifact if missing.'), panelId: z .string() .optional() .describe( 'Optional panel ID. If provided, updates the existing map panel instead of creating a new one.', ), - reasoning: z - .string() - .describe('Brief rationale for creating the map panel.'), });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/deck/src/ai.ts` around lines 101 - 129, DeckMapDashboardToolParameters currently redefines the reasoning field that is already declared on DeckMapConfigToolParameters; remove the duplicate reasoning entry from the DeckMapDashboardToolParameters schema so the inherited reasoning from DeckMapConfigToolParameters is used (leave other fields like artifactId, tableName, createArtifactIfMissing, and panelId intact and unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/deck/src/mapConfigUtils.ts`:
- Around line 221-260: The code unconditionally calls ensureDeckMapColumnExists
when a detectedGeometryColumn is present, which wrongly rejects cases where the
geometry alias comes from a projected sourceSqlQuery; update the guard so that
ensureDeckMapColumnExists is only invoked for base-table column checks (i.e.,
when options.sourceSqlQuery is not provided). In practice, modify the block
around detectedGeometryColumn and ensureDeckMapColumnExists so it skips the
existence check if options.sourceSqlQuery is set (allowing SQL-projected
geometry aliases passed via geometryColumn to succeed).
- Around line 330-345: The regeneration currently always calls
createDeckMapDashboardConfigForTable and overwrites panel.config even for
SQL-backed or explicitly-hinted geometry panels; change this to first inspect
the existingConfig (panel.config) and if existingConfig.source?.sqlQuery exists
or an explicit geometry column/hint is present, preserve the current config by
returning existingConfig (i.e., bail out) instead of rebuilding, or
alternatively merge the existing source/geometry settings into the payload
passed to createDeckMapDashboardConfigForTable so source/sqlQuery and explicit
geometryColumn/latitude/longitude hints are carried forward; check for
source.sqlQuery and any explicit geometry hints before calling
createDeckMapDashboardConfigForTable and act accordingly.
---
Nitpick comments:
In `@packages/deck/src/ai.ts`:
- Around line 101-129: DeckMapDashboardToolParameters currently redefines the
reasoning field that is already declared on DeckMapConfigToolParameters; remove
the duplicate reasoning entry from the DeckMapDashboardToolParameters schema so
the inherited reasoning from DeckMapConfigToolParameters is used (leave other
fields like artifactId, tableName, createArtifactIfMissing, and panelId intact
and unchanged).
In `@packages/mosaic/src/chart-runtime.ts`:
- Around line 118-129: The current merge logic in chart-runtime.ts treats
override.disabled truthily, so a consumer cannot explicitly set disabled: false;
update the merge in the function that constructs the final policy (the block
currently returning ...(basePolicy ?? {}), ...(override.maxRows...), etc.) to
treat disabled as an explicit override by checking override.disabled !==
undefined and, when present, setting disabled: override.disabled; alternatively
(if you prefer one-way flag semantics) change the override type to only allow
disabled?: true and keep the existing truthy check—apply the first option to
preserve explicit false semantics on the returned policy.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 83b78f6c-d73b-49f3-a9bf-bcdfdee12c8d
📒 Files selected for processing (27)
apps/sqlrooms-cli-ui/src/createDashboardAgent.tsapps/sqlrooms-cli-ui/src/createDashboardAiTools.tsapps/sqlrooms-cli-ui/src/createDashboardToolDeps.tsapps/sqlrooms-cli-ui/src/store.tspackages/deck/__tests__/dashboard-ai-map.test.tspackages/deck/__tests__/mapLayerConfigUtils.test.tspackages/deck/src/MapSettings.tsxpackages/deck/src/ai.tspackages/deck/src/dashboard.tsxpackages/deck/src/dashboardConfig.tspackages/deck/src/mapConfigUtils.tspackages/deck/src/mapLayerConfigUtils.tspackages/mosaic/__tests__/dashboard-ai.test.tspackages/mosaic/src/ai.tspackages/mosaic/src/chart-runtime.tspackages/mosaic/src/chart-types/box-plot/schema.tspackages/mosaic/src/chart-types/bubble-chart/schema.tspackages/mosaic/src/chart-types/chart-config.tspackages/mosaic/src/chart-types/count-plot/schema.tspackages/mosaic/src/chart-types/custom-spec/schema.tspackages/mosaic/src/chart-types/data-policy-schema.tspackages/mosaic/src/chart-types/heatmap/schema.tspackages/mosaic/src/chart-types/histogram/schema.tspackages/mosaic/src/chart-types/index.tspackages/mosaic/src/chart-types/line-chart/schema.tspackages/mosaic/src/chart/MosaicDashboardChartContent.tsxpackages/mosaic/src/index.ts
✅ Files skipped from review due to trivial changes (2)
- packages/mosaic/src/chart-types/index.ts
- packages/mosaic/src/chart-types/data-policy-schema.ts
Summary by CodeRabbit
New Features
Refactor
Tests
Documentation