-
Notifications
You must be signed in to change notification settings - Fork 16.5k
feat: add tooltip integration with glossary docs #36349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Updated styling for glossary entries
-implemented an example use case
…tead of other classes. Update docs to use 1 table for each topic.
-fixed id in glossary table
Added More Tooltips Cleaned the Glossary
11687e3 to
d1eb412
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a centralized glossary system that serves as a single source of truth for terminology definitions used across both Superset's application tooltips and documentation site. The implementation uses an encoding pattern to transform existing tooltip descriptions into interactive elements that link to glossary documentation.
Key Changes:
- Adds glossary infrastructure with type-safe term definitions organized by topics (Query, Advanced Analytics)
- Wraps the Tooltip component to detect glossary-encoded strings and enhance them with "Click to Learn More" links
- Integrates glossary terms into chart controls (Dimensions, Metrics, Series, Row Limit, Sort, Time Shift) across multiple plugins
- Creates a dynamic glossary documentation page that renders from the same source definitions
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
superset-frontend/packages/superset-ui-core/src/glossary/index.ts |
Exports glossary models and utilities for public consumption |
superset-frontend/packages/superset-ui-core/src/glossary/glossaryUtils.ts |
Implements glossary encoding/decoding logic and URL building with hardcoded localhost base URL |
superset-frontend/packages/superset-ui-core/src/glossary/glossaryModels.ts |
Defines GlossaryTerm, GlossaryTopic, and GlossaryMap classes with circular dependency on glossaryUtils |
superset-frontend/packages/superset-ui-core/src/glossary/glossary.ts |
Contains centralized term definitions with local translation function that shadows imported one |
superset-frontend/packages/superset-ui-core/src/components/Tooltip/index.tsx |
Enhances Tooltip component to detect glossary strings and wrap with links |
superset-frontend/packages/superset-ui-core/src/index.ts |
Adds glossary exports to core package public API |
superset-frontend/src/explore/controlPanels/sections.tsx |
Replaces hardcoded Time Shift description with glossary-encoded string |
superset-frontend/src/explore/components/ControlHeader.tsx |
Removes unused tooltipOnClick prop and simplifies Tooltip usage |
superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx |
Replaces Time Shift description with glossary reference |
superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx |
Replaces Time Shift description with glossary reference |
superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx |
Replaces Time Shift description with glossary reference |
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx |
Replaces Series and Row Limit descriptions with glossary references |
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx |
Replaces Dimension, Metric, and Sort descriptions with glossary references |
superset-frontend/packages/superset-ui-chart-controls/src/sections/timeComparison.tsx |
Replaces Time Shift description with glossary reference |
superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx |
Replaces Time Shift description with glossary reference |
docs/docs/glossary.mdx |
Creates interactive glossary documentation page with scroll-to-term functionality |
docs/sidebars.js |
Adds Glossary entry to documentation sidebar |
docs/webpack.extend.ts |
Removes commented-out alias configuration |
docs/package.json |
Downgrades antd and caniuse-lite dependencies |
docs/yarn.lock |
Updates lock file with dependency version changes |
superset-frontend/packages/superset-ui-core/src/components/Tooltip/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/glossary/glossaryModels.ts
Outdated
Show resolved
Hide resolved
| function t(message: string): string { | ||
| return message; | ||
| } |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local t() function shadows the imported t function from @superset-ui/core (used in glossaryUtils.ts line 22). This can cause confusion and translation issues. The local identity function should be renamed (e.g., to identity or noTranslate) to avoid shadowing the actual translation function, or the real translation function should be used consistently throughout.
superset-frontend/packages/superset-ui-core/src/components/Tooltip/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/components/Tooltip/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/glossary/glossaryModels.ts
Outdated
Show resolved
Hide resolved
| useEffect(() => { | ||
| const hash = decodeURIComponent(window.location.hash.slice(1)); | ||
| if (!hash) return; | ||
|
|
||
| const [topic, term] = hash.split('__'); | ||
| if (topic && term) scrollToRow(topic, hash); | ||
| }, []); |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The useEffect hook is missing scrollToRow in its dependency array, which violates React's rules of hooks. This could lead to stale closures or unexpected behavior. Add scrollToRow to the dependency array or use useCallback to memoize the scrollToRow function.
superset-frontend/packages/superset-ui-core/src/components/Tooltip/index.tsx
Outdated
Show resolved
Hide resolved
|
Thanks for your patience here... we want to give this a thorough review, we're just trying to catch up with the backlog 😅 Meanwhile, re-running CI 🤞 |
This comment was marked as outdated.
This comment was marked as outdated.
superset-frontend/packages/superset-ui-core/src/glossary/glossaryUtils.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/glossary/glossaryUtils.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/glossary/glossaryUtils.ts
Outdated
Show resolved
Hide resolved
|
CodeAnt AI finished reviewing your PR. |
extract functionallity from glossaryUtils into tooltipUtils
|
CodeAnt AI is running Incremental review |
fix: remove stale entries in the DOM if they become null
|
CodeAnt AI is running Incremental review |
|
I promise I'll follow up here! |
SUMMARY
This PR introduces an integrated glossary system that establishes a single source of truth for term definitions used across both Superset's documentation site and the application itself. Previously, terminology explanations were fragmented across scattered tooltip descriptions, documentation pages, and various help text throughout the codebase, leading to inconsistencies and maintenance challenges when definitions needed updates.
Key Features:
Implementation:
glossary.Query.Row_Limit.encode()) with type safety and IDE autocompletionCurrent Scope & Future Plans:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
1129.1.mp4
TESTING INSTRUCTIONS
Prerequisites
http://localhost:8088Steps
Note: Set the docs version dropdown to "next" in the top navigation bar to see the glossary page. The glossary feature is only available in the next version documentation.
Navigate to a chart in Explore view
http://localhost:9000in your browserTest glossary-integrated tooltips
Currently, only a small subset of controls have been integrated with the glossary. Test the following:
Query Section:
Advanced Analytics Section (if visible):
Verify glossary tooltip interaction
For any glossary-integrated tooltip:
a. Hover behavior:
b. Click behavior:
http://localhost:3000/docs/glossaryin a new tab#Query__Row_Limit)Additional controls will be integrated in future iterations.
ADDITIONAL INFORMATION
CodeAnt-AI Description
Add centralized glossary with clickable tooltips and a documentation Glossary page
What Changed
Impact
✅ Consistent tooltip text across controls✅ Click-to-learn-more links from control tooltips✅ Glossary index page in docs for quick term lookup💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.