Skip to content

Polish header icons#318

Merged
Bartavius merged 11 commits intomainfrom
polish-header-icons
Apr 16, 2026
Merged

Polish header icons#318
Bartavius merged 11 commits intomainfrom
polish-header-icons

Conversation

@Bartavius
Copy link
Copy Markdown
Member

@Bartavius Bartavius commented Apr 16, 2026

Description

  • fixed header back button padding and maps padding in the itinerary details page
  • matched the recommended page's header to match the new padding
  • minor tweak in the trip id header and logic
2026-04-16.11-31-54.mov

How has this been tested?

Checklist

  • I have self-reviewed my code for readability, maintainability, performance, and added comments/documentation where necessary.
  • New and existing tests pass locally with my changes.
  • I have followed the project's coding standards and best practices.

User-visible changes

  • Back button styling updated: changed default color from black to gray500 with padding-based sizing (replacing fixed dimensions)
  • Header height standardized across itinerary and recommended pages (54px unified height)
  • Map button padding adjusted in trip details header for improved spacing
  • Bottom sheet in location reminder now uses default sizing behavior instead of fixed "xs" size

Changes by category

Fixes

  • Fixed header back button padding and color inconsistencies across pages
  • Corrected bottom sheet sizing in trip reminder location sheet

Improvements

  • Standardized header heights (recommended page: 48 → 54px)
  • Refined trip details header typography (bodyMedium → headingMd) and spacing
  • Optimized header fade animation duration (200 → 100ms) and sheet overlap value (24 → 36px)
  • Simplified tab validation logic by consolidating into DEFAULT_TABS array

Contribution summary

File Added Removed Net
frontend/design-system/components/navigation/arrow.tsx 4 4 0
frontend/app/(app)/trips/[id]/index.tsx 23 28 -5
frontend/app/(app)/recommended/[id].tsx 1 1 0
frontend/app/(app)/components/trip-reminder-location-sheet.tsx 1 1 0
Total 29 34 -5

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

The changes adjust UI layout constants, component sizing, and styling across multiple app pages. Modifications include updated header heights, sheet overlap values, animation durations, button color defaults, and padding values. Header opacity animations were simplified by removing interpolated values.

Changes

Cohort / File(s) Summary
Bottom Sheet Layout
frontend/app/(app)/components/trip-reminder-location-sheet.tsx
Removed explicit size="xs" prop to use BottomSheet's default sizing behavior.
Header & Layout Constants
frontend/app/(app)/recommended/[id].tsx, frontend/app/(app)/trips/[id]/index.tsx
Updated FIXED_HEADER_HEIGHT (48→54), SHEET_OVERLAP (24→36), HEADER_FADE_DURATION (200→100). Removed interpolated header opacity animations and simplified header visibility logic. Changed scroll threshold from insets.top to fixed value of 12.
Navigation Button Styling
frontend/design-system/components/navigation/arrow.tsx
Extended BackButtonProps.color type to include "gray500". Changed default color from "black" to "gray500". Replaced fixed width/height dimensions with padding-based sizing.
Typography & Spacing Adjustments
frontend/app/(app)/trips/[id]/index.tsx
Updated header title text variant from bodyMedium to headingMd. Adjusted mapButton padding from token-based spacing to numeric values.
Condition Logic Simplification
frontend/app/(app)/trips/[id]/index.tsx
Added DEFAULT_TABS array constant and changed empty-state condition from explicit per-tab comparisons to array inclusion check.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • aahiltn
  • anish-sahoo

Poem

Constants shift and colors blend,
Headers grow and curves suspend,
Buttons soften to a gray,
Layout tweaks smooth the way,
Simpler flows now hold their sway.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Polish header icons' directly aligns with the primary objective of the pull request to refine header UI elements, including back button padding, sizing, and color adjustments across multiple pages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch polish-header-icons

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Bartavius Bartavius marked this pull request as ready for review April 16, 2026 15:33
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/app/`(app)/recommended/[id].tsx:
- Line 43: Replace the hard-coded numeric FIXED_HEADER_HEIGHT (currently 54)
with a design-system spacing token: import and use the centralized token (e.g.,
HEADER_HEIGHT, spacing.header or tokens.spacing.header) instead; if that token
does not exist yet, add a descriptive token (HEADER_HEIGHT or spacing.header) to
the design system tokens and then consume it in the component where
FIXED_HEADER_HEIGHT is defined so layout spacing is consistent and no magic
number remains.

In `@frontend/app/`(app)/trips/[id]/index.tsx:
- Around line 69-76: DEFAULT_TABS includes "settings" and "housing" which have
no content renderer so when activeTab is set to them the content area goes
blank; update the DEFAULT_TABS array (the DEFAULT_TABS constant / TabKey[] in
frontend/app/(app)/trips/[id]/index.tsx) to only include tabs that have
renderers (or alternatively implement a fallback renderer for tabs without
content), and ensure any logic that reads activeTab falls back to a valid tab
when the route param points to a non-rendered key.
- Around line 625-626: Replace the magic number paddingHorizontal: 12 with the
design-system spacing token from Layout.spacing (e.g., paddingHorizontal:
Layout.spacing.sm) in the style object inside
frontend/app/(app)/trips/[id]/index.tsx; locate the style that currently sets
paddingHorizontal and swap the literal 12 for the appropriate Layout.spacing
token (or explicit left/right composition using Layout.spacing.* if needed) so
the component uses the centralized spacing system.
- Line 304: Replace the magic number 12 in titleScrollThreshold with a
safe-area-aware value: obtain the top inset via useSafeAreaInsets() (or your
app's centralized safe-area helper) and combine it with the design-system
spacing token (e.g. SPACING.small or tokens.spacing.sm) instead of hard-coding
12; then compute titleScrollThreshold = CONTENT_CARD_TOP - (insetTop +
designSpacing) so header/title transition respects device top insets and
centralized spacing.

In `@frontend/design-system/components/navigation/arrow.tsx`:
- Line 16: The default color for the BackButton was changed to "gray500" in
navigation/arrow.tsx (symbol: BackButton), causing an app-wide visual
regression; revert the default prop/value in the BackButton component back to
"black" (restore the original default assignment where color = "black") and then
update only the specific screens that need the gray appearance by adding
color="gray500" to those BackButton usages rather than changing the component
default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a8091aa4-759b-45d1-8d00-bff5a806da0c

📥 Commits

Reviewing files that changed from the base of the PR and between 6f1ed67 and 7e353fc.

📒 Files selected for processing (4)
  • frontend/app/(app)/components/trip-reminder-location-sheet.tsx
  • frontend/app/(app)/recommended/[id].tsx
  • frontend/app/(app)/trips/[id]/index.tsx
  • frontend/design-system/components/navigation/arrow.tsx

const MAP_HEIGHT = 220;
const CONTENT_CARD_TOP = HERO_IMAGE_HEIGHT - 24;
const FIXED_HEADER_HEIGHT = 48;
const FIXED_HEADER_HEIGHT = 54;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use a design token instead of a hard-coded header height.

Line 43 sets FIXED_HEADER_HEIGHT to a raw numeric value (54). This should come from the centralized design-system tokens (or be added there first) to keep layout spacing consistent and maintainable.

As per coding guidelines **/*.{tsx,ts,jsx,js}: React/Expo UI must use a centralized design system; avoid hard-coded color values, magic spacing numbers, and duplicated style definitions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/app/`(app)/recommended/[id].tsx at line 43, Replace the hard-coded
numeric FIXED_HEADER_HEIGHT (currently 54) with a design-system spacing token:
import and use the centralized token (e.g., HEADER_HEIGHT, spacing.header or
tokens.spacing.header) instead; if that token does not exist yet, add a
descriptive token (HEADER_HEIGHT or spacing.header) to the design system tokens
and then consume it in the component where FIXED_HEADER_HEIGHT is defined so
layout spacing is consistent and no magic number remains.

Comment on lines +69 to +76
const DEFAULT_TABS = [
"new",
"itinerary",
"polls",
"activities",
"settings",
"housing",
] as TabKey[];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

DEFAULT_TABS currently suppresses fallback for tabs with no content renderer.

DEFAULT_TABS includes "settings" and "housing", but this screen does not render content for those tabs. If activeTab is set from route params to one of them, the content area can become blank because the empty state is bypassed.

Proposed fix
-const DEFAULT_TABS = [
-  "new",
-  "itinerary",
-  "polls",
-  "activities",
-  "settings",
-  "housing",
-] as TabKey[];
+const CONTENT_TABS: ReadonlySet<TabKey> = new Set([
+  "new",
+  "itinerary",
+  "polls",
+  "activities",
+]);

...
-            {!DEFAULT_TABS.includes(activeTab) && (
+            {!CONTENT_TABS.has(activeTab) && (
               <EmptyState
                 title="Nothing here yet"
                 description="Post notes, photos, videos, and links."
               />
             )}

Also applies to: 458-463

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/app/`(app)/trips/[id]/index.tsx around lines 69 - 76, DEFAULT_TABS
includes "settings" and "housing" which have no content renderer so when
activeTab is set to them the content area goes blank; update the DEFAULT_TABS
array (the DEFAULT_TABS constant / TabKey[] in
frontend/app/(app)/trips/[id]/index.tsx) to only include tabs that have
renderers (or alternatively implement a fallback renderer for tabs without
content), and ensure any logic that reads activeTab falls back to a valid tab
when the route param points to a non-rendered key.

}

const titleScrollThreshold = CONTENT_CARD_TOP - insets.top;
const titleScrollThreshold = CONTENT_CARD_TOP - 12;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use safe-area-based threshold for header transition.

Line 304 uses a fixed 12 offset. This can shift the header/title transition on devices with larger top insets and produce inconsistent behavior.

Proposed fix
-  const titleScrollThreshold = CONTENT_CARD_TOP - 12;
+  const titleScrollThreshold = CONTENT_CARD_TOP - insets.top;

As per coding guidelines "React/Expo UI must use a centralized design system; avoid hard-coded color values, magic spacing numbers, and duplicated style definitions."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const titleScrollThreshold = CONTENT_CARD_TOP - 12;
const titleScrollThreshold = CONTENT_CARD_TOP - insets.top;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/app/`(app)/trips/[id]/index.tsx at line 304, Replace the magic
number 12 in titleScrollThreshold with a safe-area-aware value: obtain the top
inset via useSafeAreaInsets() (or your app's centralized safe-area helper) and
combine it with the design-system spacing token (e.g. SPACING.small or
tokens.spacing.sm) instead of hard-coding 12; then compute titleScrollThreshold
= CONTENT_CARD_TOP - (insetTop + designSpacing) so header/title transition
respects device top insets and centralized spacing.

Comment on lines +625 to +626
paddingHorizontal: 12,
paddingVertical: Layout.spacing.xs,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Replace raw horizontal padding with design-system spacing composition.

Line 625 hard-codes 12, which is outside the declared spacing token set.

Proposed fix
-    paddingHorizontal: 12,
+    paddingHorizontal: Layout.spacing.xs + Layout.spacing.xxs,

Based on learnings: "React/Expo UI must use a centralized design system; avoid hard-coded color values, magic spacing numbers, and duplicated style definitions."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
paddingHorizontal: 12,
paddingVertical: Layout.spacing.xs,
paddingHorizontal: Layout.spacing.xs + Layout.spacing.xxs,
paddingVertical: Layout.spacing.xs,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/app/`(app)/trips/[id]/index.tsx around lines 625 - 626, Replace the
magic number paddingHorizontal: 12 with the design-system spacing token from
Layout.spacing (e.g., paddingHorizontal: Layout.spacing.sm) in the style object
inside frontend/app/(app)/trips/[id]/index.tsx; locate the style that currently
sets paddingHorizontal and swap the literal 12 for the appropriate
Layout.spacing token (or explicit left/right composition using Layout.spacing.*
if needed) so the component uses the centralized spacing system.

onPress,
hasBackground = false,
color = "black",
color = "gray500",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all BackButton usages that rely on default color (no explicit color prop).
python - <<'PY'
import re
from pathlib import Path

pattern = re.compile(r'<BackButton\b([\s\S]*?)\/>')
for path in Path('.').rglob('*.tsx'):
    text = path.read_text(encoding='utf-8', errors='ignore')
    for m in pattern.finditer(text):
        attrs = m.group(1)
        if 'color=' not in attrs:
            line = text.count('\n', 0, m.start()) + 1
            snippet = re.sub(r'\s+', ' ', m.group(0)).strip()
            print(f"{path}:{line}: {snippet}")
PY

Repository: GenerateNU/toggo

Length of output: 2131


🏁 Script executed:

cat -n frontend/design-system/components/navigation/arrow.tsx | head -30

Repository: GenerateNU/toggo

Length of output: 1104


🏁 Script executed:

git log --oneline -n 20 frontend/design-system/components/navigation/arrow.tsx

Repository: GenerateNU/toggo

Length of output: 118


🏁 Script executed:

git show 7e353fc:frontend/design-system/components/navigation/arrow.tsx | head -30

Repository: GenerateNU/toggo

Length of output: 894


🏁 Script executed:

git show 7e353fc^:frontend/design-system/components/navigation/arrow.tsx | head -30

Repository: GenerateNU/toggo

Length of output: 98


🏁 Script executed:

git log --all --oneline -- frontend/design-system/components/navigation/arrow.tsx

Repository: GenerateNU/toggo

Length of output: 388


🏁 Script executed:

git show 6f1ed67:frontend/design-system/components/navigation/arrow.tsx | head -30

Repository: GenerateNU/toggo

Length of output: 859


Revert default BackButton color to avoid unintended visual changes across the app.

The default color changed from "black" to "gray500" in the latest commit. This affects 30+ BackButton usages across the app that don't explicitly specify a color prop, causing an unscoped visual regression. Change the default back to "black" and explicitly set color="gray500" only at screens that require it.

Suggested fix
 export const BackButton: React.FC<BackButtonProps> = ({
   onPress,
   hasBackground = false,
-  color = "gray500",
+  color = "black",
 }) => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
color = "gray500",
export const BackButton: React.FC<BackButtonProps> = ({
onPress,
hasBackground = false,
color = "black",
}) => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/design-system/components/navigation/arrow.tsx` at line 16, The
default color for the BackButton was changed to "gray500" in
navigation/arrow.tsx (symbol: BackButton), causing an app-wide visual
regression; revert the default prop/value in the BackButton component back to
"black" (restore the original default assignment where color = "black") and then
update only the specific screens that need the gray appearance by adding
color="gray500" to those BackButton usages rather than changing the component
default.

@Bartavius Bartavius merged commit 2bb1d8c into main Apr 16, 2026
15 checks passed
@Bartavius Bartavius deleted the polish-header-icons branch April 16, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants