enhance(onboard): simplify Overview, extract shared OnboardingCard, use theme tokens#1069
Conversation
|
@xiao-xiao-mao double check |
|
Holding off on merge — the structural refactor is great (extracting
Two reasons this needs fixing before merge:
Could you replace the hex literals with the semantic palette tokens? The structural extraction itself is solid — once the colors are reanchored to the theme, this is good to merge. |
|
Thanks for the review. Will push the update soon |
anderdc
left a comment
There was a problem hiding this comment.
Structural extraction is solid, but four things block merge:
-
Delete
Scoring.tsx— don't rewrite it. This PR drops the Scoring tab fromOnboardPage.tsx, sosrc/components/onboard/Scoring.tsxhas no render site, yet the diff still rewrites it (+323/-118) as dead code. Remove the file.src/components/onboard/has noindex.ts, so there's no barrel entry to clean up. Also drop the now-dangling "See the Scoring tab for how rewards are calculated" line inGettingStarted.tsx— that tab no longer exists. -
Export the new component through the barrel.
src/components/onboarding-card.tsxsits undersrc/components/, which has anindex.tsexporting every sibling component. Addexport * from './onboarding-card';to that barrel and change the import inAboutContent.tsxfrom'../onboarding-card'to'..'. -
Update the PR description to match the diff. It describes the
GettingStarted.tsxchange as a color-constant swap that "removed unused ArrowBackIcon import" — the diff is a full copy/layout rewrite and adds theArrowBackIconimport. Rewrite it to describe the actual Overview/Setup/Rewards redesign. -
Drop the hardcoded emission percentages. The "two ways to earn" cards in
GettingStarted.tsxshow fixed shares ("30% emissions" / "10% emissions"). Emission share is now allocated per-repo per-competition, so a single global number isn't accurate — and baking an exact figure into the copy means the page has to be re-edited and re-reviewed every time the split changes. Describe the two tracks generically, without committing to a percentage.
…rel onboarding-card, remove hardcoded emission %
Resolve conflicts between the GitHub-aligned light mode work and recent upstream changes: keep theme-aware chart colors alongside the new ChartEmptyPanel empty-states (entrius#1122), reconcile the simplified onboarding (entrius#1069) by adopting the new AboutContent and dropping Scoring.tsx, and fold the RepositoryCodeBrowser GoToFileSearch (entrius#1144) into the breadcrumb layout with theme tokens.
Summary
Onboard page cleanup: reduces the Overview tab to a focused two-audience layout (miner / maintainer), extracts the OnboardingCard styling pattern into a shared component, and replaces local hex color constants with existing theme tokens.
Changes
Overview tab (
AboutContent.tsx)/onboard?tab=getting-started/repository-registrationShared
OnboardingCard(src/components/onboarding-card.tsx)surface.subtlebackground,border.mediumborderaccent={(theme) => ...}so callers can recolor without hardcoding hex.AboutContentto remove duplicated styling.Onboard page (
OnboardPage.tsx)Mui-selected→common.white).<Tabs>/<Tab>.Setup tab (
GettingStarted.tsx)const YELLOW = '#facc15'withSTATUS_COLORS.info(blue) from the theme.const GREEN = '#3fb950'withSTATUS_COLORS.merged.ArrowBackIconimport.Rewards source (
Scoring.tsx)const AMBER = '#facc15'with theme token reference.Why
STATUS_COLORS,theme.palette.*) rather than redeclaring hex constants inline.Test plan
/onboard— Overview tab shows two cards side-by-side (miner / maintainer)./onboard?tab=getting-startedand/repository-registrationrespectively.npm run type-checkpasses.Out of scope
OnboardingCardcomponent but does not yet refactorHomePage.tsxto use it. That refactor is left as a follow-up to keep this change focused on the onboard page.Screencast.from.2026-05-13.01-31-09.mp4