Skip to content
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

feat(insights): Allow picking chart layouts in Insights > Session Health #88502

Merged
merged 11 commits into from
Apr 3, 2025

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented Apr 1, 2025

This PR implements a dropdown to replace the standard title within each chart on the Session Health page. Using the dropdown users can pick which charts appear in which spots inside the page.

Each page (Frontend, Mobile) has 5 slots (i removed some extra ones) where charts can go, therefore we need to have at least 6 options in the dropdown for there to be one 'unused' option that's a valid choice.

Currently the sort-order of the items in the dropdown is alphabetical by component name (not by the label that appears on the screen). So we need to revisit that and be intentional about what order we group/suggest things.

It's all similar but different to how charts were picked, rendered and saved within the framework of the 'old' insights charts. It should be extensible to support other types of insights pages and charts. But we should strive to async load more of the chart types instead of importing everything into settings.tsx

SCR-20250403-meod
SCR-20250403-mesp

@ryan953 ryan953 requested review from a team as code owners April 1, 2025 21:53
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 1, 2025
@ryan953 ryan953 requested a review from a team April 1, 2025 22:02
@ryan953 ryan953 requested a review from gggritso April 2, 2025 18:49
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

Makes sense! I left a bunch of questions/suggestions just to clarify what's going on before I mash approve, but LGTM overall

Copy link
Member

@michellewzhang michellewzhang Apr 3, 2025

Choose a reason for hiding this comment

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

could the contents of this file be moved into static/app/views/insights/sessions/utils/sessions.tsx ? or in static/app/views/insights/sessions/settings.ts if that makes more sense

Copy link
Member Author

Choose a reason for hiding this comment

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

i can go for views/insights/sessions/settings.ts

Copy link
Member Author

Choose a reason for hiding this comment

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

ow :(

so i had to move move of the stuff back out of the main insights/sessions/settings.ts file because it was creating a circular dependency that couldn't be resolved. What's left is CHART_TITLES. I also flipped the types to depend on that, so there's no more circular deps anymore.

Basically insights/sessions/settings.ts defines MODULE_TITLE which is needed by the charts, which are imported by settings.ts. So in the end it's best to keep settings.ts simple, with simple values, and the new file has heavy dependencies which eventually also depend on settings itself.

NewAndResolvedFeedbackChart: t('User Feedback'),
ReleaseNewIssuesChart: t('New Issues by Release'),
ReleaseSessionCountChart: t('Total Sessions by Release'),
ReleaseSessionPercentageChart: t('Release Adoption'),
Copy link
Member

Choose a reason for hiding this comment

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

should we just rename this chart to ReleaseAdoptionChart?

Copy link
Member Author

@ryan953 ryan953 Apr 3, 2025

Choose a reason for hiding this comment

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

i took all the component names for the keys in here, so everything is 1:1 except NewAndResolvedFeedbackChart which is going away.

Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

Cool 👍🏻

@ryan953 ryan953 force-pushed the ryan953/insights-session-change-charts branch from 87a5844 to a528cba Compare April 3, 2025 18:55
@ryan953 ryan953 merged commit d5c90ad into master Apr 3, 2025
42 checks passed
@ryan953 ryan953 deleted the ryan953/insights-session-change-charts branch April 3, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
3 participants