Unify header sizing across all pages with global Theme constants#89
Unify header sizing across all pages with global Theme constants#89
Conversation
…ont sizes Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses inconsistent header/title sizing across screens by introducing a shared theme constants module and migrating page-title styles (and some icon button sizing) to use those constants, eliminating visible layout shifts when switching tabs.
Changes:
- Added
frontend/constants/Theme.tswith rem-basedFontSize,LineHeight,Spacing, andIconButtonsizing constants. - Updated
MyHeaderand multiple screens to useFontSize.pageTitle/LineHeight.pageTitle(and shared icon button sizes) instead of hardcoded values. - Updated
package-lock.json(lockfile metadata changes).
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/constants/Theme.ts | Introduces global sizing constants (font, line height, spacing, icon button). |
| frontend/components/header.tsx | Aligns header layout and sizing with the shared theme constants. |
| frontend/app/(tabs)/profile.tsx | Replaces page title + settings button sizing with theme constants. |
| frontend/app/(tabs)/explore.tsx | Replaces page title sizing with theme constants. |
| frontend/app/streams.tsx | Replaces page title sizing with theme constants. |
| frontend/app/saved-streams.tsx | Replaces page title sizing with theme constants. |
| frontend/app/saved-library.tsx | Replaces page title sizing with theme constants. |
| frontend/app/manage-streams.tsx | Replaces page title sizing with theme constants. |
| frontend/app/archive-bytes.tsx | Replaces page title sizing with theme constants. |
| frontend/app/user/[username].tsx | Replaces profile title sizing with theme constants. |
| frontend/app/bytes.tsx | Updates page title sizing with theme constants (but currently introduces a missing-style bug). |
| frontend/package-lock.json | Lockfile regenerated/metadata updated (adds/removes peer: true flags). |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
frontend/package-lock.json:118
package-lock.jsonincludes widespread changes that appear to be lockfile metadata churn (adding/removing "peer": true flags) without any correspondingpackage.jsonchanges in this PR. If no dependency update is intended, consider reverting the lockfile changes; otherwise, please confirm the dependency/tooling change that required regenerating the lockfile (and ideally keep it generated by a consistent npm version to avoid future churn).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| justifyContent: "space-between", | ||
| alignItems: "flex-start", | ||
| gap: 12, | ||
| }, |
There was a problem hiding this comment.
styles.filterRow is still used in the ListHeaderComponent (see around line ~283), but the filterRow style definition was removed from StyleSheet.create. This will cause undefined styles at runtime and a TypeScript error if StyleSheet.NamedStyles typing is enforced. Either restore the filterRow style in the stylesheet or remove/replace the styles.filterRow usage in the render tree.
| }, | |
| }, | |
| filterRow: { | |
| flexDirection: "row", | |
| gap: 8, | |
| paddingTop: 8, | |
| flexWrap: "wrap", | |
| }, |
Switching between Home and Profile tabs caused visible header shift due to inconsistent padding, font sizes, and alignment. The
MyHeadercomponent hadpaddingTop: 4+alignItems: center+fontSize: 24while all other pages usedfontSize: 26,alignItems: flex-start, and no extra top padding.Changes
constants/Theme.ts— rem-based scale system (1rem = 16px) with named constants forFontSize,LineHeight,Spacing, andIconButton. Provides a single source of truth going forward.components/header.tsx— removedpaddingTop: 4, changedalignItemstoflex-start, bumped logo from 24→26px. UsesFontSize.pageTitle,LineHeight.pageTitle, andIconButtonconstants.All page title styles (
profile,explore,streams,bytes,archive-bytes,saved-library,manage-streams,saved-streams,user/[username]) — replaced hardcodedfontSize: 26 / lineHeight: 30withFontSize.pageTitle/LineHeight.pageTitle.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdp.expo.dev/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/DevBits/DevBits/frontend/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/clients/flushFetchDetached.js /tmp/1d184f42872a6621e30fb566b7d65fa3/expo-telemetry.json(dns block)/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/DevBits/DevBits/frontend/node_modules/expo/node_modules/@expo/cli/build/src/utils/telemetry/clients/flushFetchDetached.js /tmp/e688d24fdc887b719e848472c9b8d6ec/expo-telemetry.json(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.