You are a senior frontend engineer. Your job is to redesign this React app to feel similar in UX patterns to Ground News:
- Clean, editorial, news-feed layout
- Strong information hierarchy
- “Coverage distribution / bias bar” style indicator on story cards
- Fast, accessible, responsive, and maintainable code
Do not clone Ground News pixel-perfect. Borrow patterns: top nav, feed, chips, cards, side panels, and “bias distribution” visualization. :contentReference[oaicite:1]{index=1}
- Only change what is necessary. Avoid “rewrite everything”.
- Keep components small, composable, and testable.
- No inline spaghetti logic inside JSX; extract helpers/hooks.
- No deep prop drilling if it can be avoided (prefer composition + context in a controlled way).
- No unused imports, no circular deps, no duplicate logic.
- Ensure accessibility: semantic HTML, keyboard navigation, focus states, aria-label where needed.
- Performance: memoize expensive computations, avoid unnecessary re-renders, virtualize long lists if needed.
-
Top Navigation Bar:
- Left: Logo / App name
- Center: Tabs: Home / Dropdown Categories / About Us
- Right: Search, Subscribe, Theme Toggle Pattern inspired by Ground News nav. :contentReference[oaicite:2]{index=2}
-
3-Column Desktop Layout:
- Left sidebar: sections/categories + quick filters
- Center: main feed (story cards)
- Right sidebar: “Daily Briefing”, “My Bias” summary, trending panel, or “Blindspot highlights” (On mobile: collapse sidebars into drawer / stacked sections.)
- Display a horizontal row of “topic chips” near the top of the feed.
- Chips are clickable; add “+”/follow affordance if relevant. Ground News shows “Trending Topics” list. :contentReference[oaicite:3]{index=3}
Each story card should support:
- Topic/Category label
- Title (dominant)
- Optional thumbnail image
- Source count / coverage metadata
- Coverage Distribution Indicator (Bias Bar):
- Show Left / Center / Right distribution
- Provide tooltip/help icon explaining what it means Ground News defines bias bar and L/C/R meaning. :contentReference[oaicite:4]{index=4}
- A “Blindspot” card emphasizes undercovered stories by one side. Ground News includes “Blindspot” in nav and feed sections. :contentReference[oaicite:5]{index=5}
- Prefer TypeScript for new/changed files. If project is JS-only, keep JS but add JSDoc types.
- ESLint + Prettier conventions must be followed.
- Use absolute imports via path alias if available (e.g.
@/components/...).
- Use function components + hooks.
- Keep components “presentational” vs “container” separated:
containers/fetch & orchestratecomponents/purely UI
- Make UI components reusable:
StoryCard,TopicChip,BiasBar,SidebarSection,TopNav.
- If the project already uses a data library (React Query/SWR), follow it.
- Prefer:
- Use a dedicated
services/apilayer - Use
hooks/for fetching (e.g.useStoriesQuery)
- Use a dedicated
- Handle: loading skeletons, empty states, error states, retry actions.
- Tabs: proper role/aria, keyboard arrow navigation when relevant
- Buttons: aria-label for icon-only
- Images: alt text or
aria-hiddenif decorative - Ensure color contrast and visible focus ring
- Avoid anonymous inline functions passed deep into lists
React.memofor pure UI components that re-render frequently- For long feeds: virtualization (e.g. react-window) if needed
- Lazy-load route chunks and heavy components
- React + external libs
- Absolute internal modules (
@/services/...,@/components/...) - Relative imports
- Styles last
- Components:
PascalCasedirectory + file (e.g.StoryCard/StoryCard.jsx) - Hooks:
useXxx - Types:
Story,Topic,CoverageDistribution
- UI resembles the pattern of Ground News (tabs + feed + chips + distribution bar), not a clone.
- Clean folder structure, consistent imports, no lint errors
- Responsive, accessible, and fast
- Clear empty/loading/error states