Repository navigation
Conversation
- Show an info icon with a popover for features that have metadata.info - Parse [label](url) links in info; only http, https and mailto become links - Fix crash when a feature cell value is a number or boolean - Move feature row building into a pure helper with tests
- Make max-width and scrolling win over Apsara's popover styles - Keep row ordering identical to the previous inline sort - Describe the popover with its text for screen readers - Underline links, keep line breaks, cap height, ignore blank link labels - Simplify the info parser and test what it shows
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Coverage Report for CI Build 43807150373Coverage remained the same at 56.053%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Plans page can now show an info (i) icon next to a feature label. Hovering, clicking or pressing Enter on it opens a popover with an explanation, which can include links.
The text comes from the feature's
metadata.info, whichListFeaturesalready returns. No API or proto change is needed. Features withoutmetadata.inforender exactly as before: the table markup is identical tomain.This also fixes a crash: a number or boolean in a plan's feature metadata made the whole Plans page throw, because the cell value was lowercased without checking its type.
Writing
metadata.infois handled by #2045 and #2046 (theBillingFeaturereconcile kind).Screenshots
metadata.info)Cell values that used to crash the page:
Changes
metadata.infoand show an (i) icon with a popoverfeature-table.tsx, newfeature-info.tsx[label](url)links in the info texthelpers/feature-rows.tsFeatureValueCellPlansViewinto a pure helperplans-view.tsx,helpers/feature-rows.tsmin(60vh, 400px), keeps line breaks, wraps long tokensfeature-table.module.csshelpers/feature-rows.test.tsTechnical Details
metadata.infois a string. It shows only if it's non-blank after trimming. Non-string values are ignored.[label](url)with a non-blank label and anhttp:,https:ormailto:URL becomes a link. Everything else, includingjavascript:, relative URLs, HTML and malformed markdown, is shown as plain text exactly as written. There's nodangerouslySetInnerHTMLand no new dependency.rel="noopener noreferrer");mailto:links don't. Links are underlined, so they don't rely on colour alone.mainexactly, including the rare case of integer-like titles with equal weightage. A differential check against the old logic over 100,000 random inputs found no differences.!importantin.infoContent.popoverwins equal-specificity ties. Without!importantthe popover is capped at 288px and itsoverflow: hiddenstops long text from scrolling. This follows the existing pattern indelete-user-dialog.module.css.<button>named "More information about {title}", witharia-haspopup="dialog"andaria-expanded. The popover is a dialog named "About {title}". It's described by its own text througharia-describedby, so a screen reader reads the explanation and not only the first link that gets focus. Enter moves focus to the first link, Escape closes and returns focus to the icon, andprefers-reduced-motionturns off the animation.Test Plan
tsc --noEmitreports the same 20 errors asmain, with an identical list and none in these files.pnpm buildpasses.mainwhen no feature has infofalse,0, empty and missing values show-metadata.infoset. Needs feat(reconcile): add BillingFeature kind #2046 or a manualUpdateFeature.Known issues (not changed here)
flex: 1; min-width: 0, and the plan columns are a fixed 272px each, so the labels collapse to 0px when the table is narrower than about 816px plus padding. In the demo app, with its sidebar, that's a window below roughly 1,130–1,150px. Labels already disappear onmain; now the icons disappear with them. To be fixed in a follow-up.)[x](https://…/Foo_(bar))links to…Foo_(bar. Docs and support URLs don't use parentheses.[object Object]or1,2instead of crashing. Only strings, numbers and booleans are expected.