Skip to content

feat: add updateTooltipFields to dispatch tooltip action in KeplerSlice - #425

Merged
lixun910 merged 2 commits into
mainfrom
424-feat-add-updatetooltipfields-function-to-manage-tooltip-configuration-in-keplerslice
Mar 11, 2026
Merged

lixun910 merged 2 commits into
mainfrom
424-feat-add-updatetooltipfields-function-to-manage-tooltip-configuration-in-keplerslice

Conversation

@lixun910

@lixun910 lixun910 commented Mar 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added the ability to dynamically update which dataset fields appear in map tooltips, letting users customize tooltip content for improved data exploration and visualization workflows.
    • Update is applied safely—if the tooltip configuration or requested fields are unchanged, no action is taken to avoid unnecessary updates.

@coderabbitai

coderabbitai Bot commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dddd8768-7926-4fae-9793-175df7c953cc

📥 Commits

Reviewing files that changed from the base of the PR and between 1ec9fe7 and c213654.

📒 Files selected for processing (1)
  • packages/kepler/src/KeplerSlice.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/kepler/src/KeplerSlice.ts

📝 Walkthrough

Walkthrough

Added a public API method updateTooltipFields(mapId, datasetId, fieldNames) to KeplerSlice that computes and appends normalized tooltip field entries for a dataset and dispatches an interactionConfigChange action to extend the map's fieldsToShow configuration.

Changes

Cohort / File(s) Summary
Tooltip Fields Management
packages/kepler/src/KeplerSlice.ts
Imported interactionConfigChange. Added updateTooltipFields(mapId, datasetId, fieldNames) to public KeplerSlice API: reads existing fieldsToShow for the dataset, computes new field entries with normalized null formats, and dispatches interactionConfigChange to extend fieldsToShow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 I nibble code crumbs in the moonlight bright,
I tuck new tooltip fields in rows just right,
With a twitch and a hop, an action I send,
Fields bloom on the map — a rabbit's small mend. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new updateTooltipFields method to KeplerSlice that dispatches a tooltip action.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 424-feat-add-updatetooltipfields-function-to-manage-tooltip-configuration-in-keplerslice

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/kepler/src/KeplerSlice.ts`:
- Around line 476-491: The updateTooltipFields logic currently appends newFields
to existingFields, causing stale entries and duplicate names; change it to
derive the dataset's next fields array from the incoming fieldNames (preserving
order and removing duplicates) by mapping each name to {name, format} where
format is taken from existingFields by matching name (e.g., lookup by name) or
null if not present, then dispatch interactionConfigChange with
tooltipConfig.config.fieldsToShow[datasetId] set to that new array (or remove
the datasetId key if fieldNames is empty) instead of spreading
[...existingFields, ...newFields]; update references to existingFields,
newFields, fieldNames, fieldsToShow, tooltipConfig, interactionConfigChange,
mapId, and datasetId accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac87338b-82d4-401b-b074-695cb64d748c

📥 Commits

Reviewing files that changed from the base of the PR and between d4a1cbb and 1ec9fe7.

📒 Files selected for processing (1)
  • packages/kepler/src/KeplerSlice.ts

Comment thread packages/kepler/src/KeplerSlice.ts Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@lixun910
lixun910 requested a review from ilyabo March 11, 2026 02:43
@lixun910
lixun910 merged commit 8688abf into main Mar 11, 2026
4 checks passed
@lixun910
lixun910 deleted the 424-feat-add-updatetooltipfields-function-to-manage-tooltip-configuration-in-keplerslice branch March 11, 2026 22:23
mihajlo-stojkovic pushed a commit that referenced this pull request Mar 12, 2026
…ce (#425)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

feat: add updateTooltipFields function to manage tooltip configuration in KeplerSlice

2 participants