Skip to content

fix: adjust flex styles in NavigationHeader layout #3282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

lawvs
Copy link
Member

@lawvs lawvs commented Mar 25, 2025

Resolve FOL-1773

Screenshot 2025-03-26 at 21 22 19 Screenshot 2025-03-26 at 21 22 31

Refine the flex styles in the NavigationHeader component to improve layout consistency and responsiveness.

Copy link

vercel bot commented Mar 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
follow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 1:23pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
follow-external-ssr ⬜️ Ignored (Inspect) Visit Preview Mar 26, 2025 1:23pm

Copy link

linear bot commented Mar 25, 2025

@follow-reviewer-bot
Copy link

Suggested PR Title:

fix(header): improve layout responsiveness of NavigationHeader

Change Summary:
Updated NavigationHeader layout for improved responsiveness. Changed flex properties to ensure better alignment of child components in left, center, and right sections of the header.

Code Review:

Code Review

File: apps/mobile/src/components/layouts/header/NavigationHeader.tsx

  1. Line 258:
    The change from className="flex-1 flex-row items-center justify-start" to className="flex flex-row items-center justify-start" is problematic. The previous flex-1 class ensures the View occupies proportional space in its parent container. Removing flex-1 could lead to layout issues if this View is intended to scale based on its parent container. It is advisable to retain flex-1 unless there is a specific reason for its removal and sufficient testing has validated the new behavior.

  2. Line 268:
    The addition of flex-1 alongside truncate in the className of the Animated.View may cause unintended layout behavior. While truncate is meant to handle text overflow gracefully, combining it with flex-1 could interfere with layout constraints regarding text content. This change needs to be revisited, and it should be confirmed that the styles applied will not conflict with Animated.View intended behavior across different screen sizes.

  3. Line 279:
    The change from flex flex-1 shrink-0 flex-row items-center justify-end to flex shrink-0 flex-row items-center justify-end removes flex-1, which may affect the distribution of space within this layout component. Similar to Line 258, flex-1 ensures proportional space allocation, and its removal could lead to layout inconsistencies if this View is expected to take up proportional width. Retain flex-1 unless a clear requirement justifies its removal.


Summary

The removal of flex-1 in multiple instances requires further analysis and justification, as it may alter the proportional space distribution within the layout that could result in unintended UI issues.

Change Requests

  • Line 258: Revert flex to flex-1 unless layout testing has validated the new structure.
  • Line 268: Double-check the interaction between flex-1 and truncate to ensure no layout constraints are being violated.
  • Line 279: Revert flex to flex-1 unless removal is confirmed necessary and tested adequately.

Ensure these changes are resolved before merging.

@Innei
Copy link
Member

Innei commented Mar 25, 2025

CleanShot 2025-03-25 at 3  00 36@2x

title Not centered on the X axis of the entire screen

Copy link
Member

@Innei Innei left a comment

Choose a reason for hiding this comment

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

The title should be centered on the screen, if space permits.

@lawvs lawvs force-pushed the fix/feed-title-truncate branch from a7e829b to 9d99213 Compare March 25, 2025 07:23
@lawvs lawvs requested a review from Innei March 25, 2025 07:23
@lawvs lawvs marked this pull request as draft March 26, 2025 05:47
@lawvs lawvs force-pushed the fix/feed-title-truncate branch from 9d99213 to 7ca5c6e Compare March 26, 2025 13:21
@lawvs lawvs marked this pull request as ready for review March 26, 2025 13:21
@lawvs lawvs merged commit 92f76b9 into dev Mar 26, 2025
13 checks passed
@lawvs lawvs deleted the fix/feed-title-truncate branch March 26, 2025 14:02
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