Skip to content

🎨 Palette: Enhanced Telemetry Tooltip#19

Draft
igor-holt wants to merge 1 commit intomainfrom
palette-telemetry-tooltip-17041817421925112803
Draft

🎨 Palette: Enhanced Telemetry Tooltip#19
igor-holt wants to merge 1 commit intomainfrom
palette-telemetry-tooltip-17041817421925112803

Conversation

@igor-holt
Copy link
Owner

💡 What: Added a custom, detailed tooltip to the telemetry chart.
🎯 Why: Users needed more context on hover (Event type, Prediction Mode, Outcome) and the "subjective" description adds a nice touch of delight.
📸 Before/After: The default tooltip showed only probability; now it shows full event details.
♿ Accessibility: The tooltip uses clear typography and labels.


PR created automatically by Jules for task 17041817421925112803 started by @igor-holt

- Update `data/telemetry.ts` to expose event details (mode, outcome, subjective).
- Update `components/TelemetryTimeline.tsx` to use a custom tooltip component.
- Display event name, probability, prediction mode, outcome, and subjective description.
- Use existing `.card` class for consistent styling.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 18, 2026 01:17
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link

Summary of Changes

Hello @igor-holt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user experience of the telemetry chart by replacing the default tooltip with a custom, information-rich version. Users can now gain a deeper understanding of each data point by viewing comprehensive event details directly on hover, moving beyond a simple probability display to include critical contextual information like event type, prediction mode, and outcome, along with a unique subjective description.

Highlights

  • Enhanced Telemetry Tooltip: A custom, detailed tooltip has been added to the telemetry chart, providing users with more context on hover, including Event type, Prediction Mode, Outcome, and a 'subjective' description.
  • Improved Data Context: The tooltip now displays full event details instead of just probability, significantly enhancing the user's understanding of the data points.
  • Accessibility Considerations: The new tooltip utilizes clear typography and labels to ensure better accessibility.
Changelog
  • components/TelemetryTimeline.tsx
    • Created a new CustomTooltip functional component to render detailed information for chart data points.
    • Integrated the CustomTooltip component into the Tooltip component of the LineChart, replacing the default tooltip behavior.
  • data/telemetry.ts
    • Modified the getProbabilityData function to include additional fields (event, mode, outcome, subjective, utc) from the raw telemetry data in the mapped output, making this data available for the custom tooltip.
Activity
  • PR created automatically by Jules for task 17041817421925112803, initiated by @igor-holt.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a custom tooltip for the telemetry chart, enhancing the user experience by providing more detailed information on hover. The changes involve creating a CustomTooltip component in TelemetryTimeline.tsx and updating getProbabilityData in data/telemetry.ts to include additional data points for the tooltip. The implementation looks good and addresses the stated objective.

TooltipProps,
} from 'recharts';

const CustomTooltip = ({ active, payload, label }: any) => {

Choose a reason for hiding this comment

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

medium

The CustomTooltip component uses any for its props. It's best practice in TypeScript to define a proper interface for the props to ensure type safety and better code maintainability. This will help catch potential errors during development and improve code readability.

Suggested change
const CustomTooltip = ({ active, payload, label }: any) => {
const CustomTooltip: React.FC<TooltipProps<any, any>> = ({ active, payload, label }) => {

maxWidth: '300px'
}}>
<p style={{ margin: '0 0 8px', fontWeight: 'bold', fontSize: '14px', color: '#333' }}>
{label ? new Date(label).toUTCString() : ''}

Choose a reason for hiding this comment

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

medium

The label is conditionally converted to a UTC string. If label is null or undefined, an empty string is rendered. It might be more robust to provide a default or fallback text, or handle the case where label is not present more explicitly, especially if label is expected to always be a date.

Suggested change
{label ? new Date(label).toUTCString() : ''}
{label ? new Date(label).toUTCString() : 'N/A'}

Comment on lines +22 to +45
<div className="card" style={{
padding: '12px',
fontFamily: 'sans-serif',
maxWidth: '300px'
}}>
<p style={{ margin: '0 0 8px', fontWeight: 'bold', fontSize: '14px', color: '#333' }}>
{label ? new Date(label).toUTCString() : ''}
</p>
<p style={{ margin: '0 0 4px', fontSize: '13px', color: '#0066cc', fontWeight: 600 }}>
{data.event}
</p>
<p style={{ margin: '0 0 8px', fontSize: '12px', color: '#666' }}>
Mode: {data.mode} | Outcome: {data.outcome}
</p>
<p style={{ margin: '0 0 8px', fontSize: '13px', fontWeight: 'bold', color: '#333' }}>
Probability: {data.probability}
</p>
<div style={{ borderTop: '1px solid #eee', paddingTop: '8px', marginTop: '8px' }}>
<p style={{ margin: 0, fontSize: '12px', fontStyle: 'italic', color: '#555' }}>
"{data.subjective}"
</p>
</div>
</div>
);

Choose a reason for hiding this comment

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

medium

Inline styles are used extensively within the CustomTooltip component. While this works, it can make the component harder to maintain and reuse. Consider extracting these styles into a CSS module or a styled-components approach for better organization and separation of concerns. This also improves readability and makes it easier to manage responsive design or theme changes.

Comment on lines +59 to +63
event: entry.event,
mode: entry.prediction.mode,
outcome: entry.outcome,
subjective: entry.subjective,
utc: entry.utc,

Choose a reason for hiding this comment

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

medium

The getProbabilityData function is now returning more fields. It would be beneficial to update the TelemetryEntry interface in data/types.ts to reflect these new fields. This ensures type consistency across the application and leverages TypeScript's benefits fully.

Copy link

Copilot AI left a 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 enhances the telemetry chart tooltip to display comprehensive event details on hover. The custom tooltip replaces the default recharts tooltip and shows event type, prediction mode, outcome, probability, and a subjective description for a richer user experience.

Changes:

  • Extended getProbabilityData() to include event, mode, outcome, subjective, and utc fields in addition to probability
  • Implemented CustomTooltip component with detailed formatting and styling for enhanced hover information
  • Added error.png binary file (appears unrelated to the PR's stated purpose)

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.

File Description
error.png Binary PNG file added to repository root (purpose unclear, not referenced in code)
data/telemetry.ts Extended data mapping to include additional telemetry fields (event, mode, outcome, subjective, utc)
components/TelemetryTimeline.tsx Implemented CustomTooltip component with rich formatting, replaced default tooltip with custom implementation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Mode: {data.mode} | Outcome: {data.outcome}
</p>
<p style={{ margin: '0 0 8px', fontSize: '13px', fontWeight: 'bold', color: '#333' }}>
Probability: {data.probability}
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The probability value is displayed without formatting. Consider formatting it as a percentage or with a fixed number of decimal places for consistency and better readability. For example: {(data.probability * 100).toFixed(1)}% or {data.probability.toFixed(2)}.

Suggested change
Probability: {data.probability}
Probability: {(data.probability * 100).toFixed(1)}%

Copilot uses AI. Check for mistakes.
TooltipProps,
} from 'recharts';

const CustomTooltip = ({ active, payload, label }: any) => {
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The TooltipProps type is imported from 'recharts' but never used. The CustomTooltip function uses any type instead. Remove this unused import or apply the proper typing to the CustomTooltip function.

Suggested change
const CustomTooltip = ({ active, payload, label }: any) => {
const CustomTooltip: React.FC<TooltipProps<number, string>> = ({ active, payload, label }) => {

Copilot uses AI. Check for mistakes.
TooltipProps,
} from 'recharts';

const CustomTooltip = ({ active, payload, label }: any) => {
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The CustomTooltip function uses any type for its parameters, which bypasses TypeScript's type safety. Consider using proper typing with the imported TooltipProps type from recharts, or define a specific type based on the expected payload structure.

Suggested change
const CustomTooltip = ({ active, payload, label }: any) => {
const CustomTooltip: React.FC<TooltipProps<number, string>> = ({ active, payload, label }) => {

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +26
<div className="card" style={{
padding: '12px',
fontFamily: 'sans-serif',
maxWidth: '300px'
}}>
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The tooltip lacks proper accessibility features. While the PR description mentions "clear typography and labels," the tooltip div should include ARIA attributes for screen reader support. Consider adding role="tooltip" and aria-live="polite" to ensure assistive technologies can properly announce the tooltip content.

Suggested change
<div className="card" style={{
padding: '12px',
fontFamily: 'sans-serif',
maxWidth: '300px'
}}>
<div
className="card"
role="tooltip"
aria-live="polite"
style={{
padding: '12px',
fontFamily: 'sans-serif',
maxWidth: '300px'
}}>

Copilot uses AI. Check for mistakes.
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.

2 participants