Skip to content

Conversation

@divyanshu-patil
Copy link

@divyanshu-patil divyanshu-patil commented Nov 16, 2025

Proposed changes

changes made

  • RoomHeader is now using the custom shared headerTitle
  • Deprecated touchableOpacity is now replaced with the Pressable
  • some styles in headerTitle have been modified to avoid clipping of text
  • in android the headerTitle is aligned left while centered in IOS
  • one help i needed is using PlatformPressable causing some tests to fail, so i used the Pressable which works fine with the header. help me in review for should i strictly use PlatformPressable instead of Pressable

Issue(s)

added feature suggested in: #6255

How to test or reproduce

Screenshots

RoomHeader on Android and IOS with headerTitle from app/containers/Header/components/HeaderTitle/index.tsx

header.title.demo.2.mp4

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

  • I need review for using Pressable instead of Platform Pressable
  • is need review for style changes i did in header title
  • also there is mentioned in issue that we have to implement the onPress() but by looking at the code i think its already implemented, if that mean something else functionality should be implemented as the onPress then add review over this

Summary by CodeRabbit

  • Improvements

    • Adjusted header height on Android for consistent visual sizing.
    • Added a new header title positioning option (left/center/right) for finer alignment control.
  • Style

    • Tightened header title typography and vertical layout for a more compact appearance.
    • Updated header interaction wrapper and component composition to simplify rendering and maintain existing behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Walkthrough

Adds Android-specific minHeight to the HeaderContainer; introduces a new optional position prop on HeaderTitle and updates its styles and props to accept TextProps; refactors RoomHeader to use an imported HeaderTitle and replaces TouchableOpacity with Pressable.

Changes

Cohort / File(s) Summary
Header container change
app/containers/Header/components/HeaderContainer/index.tsx
Import Platform and apply Android check; set root View minHeight to 56 on Android, 44 otherwise.
HeaderTitle API & styles
app/containers/Header/components/HeaderTitle/index.tsx, app/containers/Header/components/HeaderTitle/styles.ts
Add `position?: 'left'
RoomHeader refactor
app/containers/RoomHeader/RoomHeader.tsx
Replace TouchableOpacity with Pressable (react-native-gesture-handler); remove local HeaderTitle and TRoomHeaderHeaderTitle type; import external HeaderTitle and use headerTitle={title ?? ''} with position='left'; remove TITLE_SIZE and related local title styles.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant RoomHeader
    participant Pressable
    participant HeaderTitle
    participant IconAndSubtitle as Icon/Subtitle

    Note over RoomHeader,Pressable: User interaction / render flow
    RoomHeader->>Pressable: render wrapper (testID, hitSlop)
    Pressable->>HeaderTitle: render headerTitle={title ?? ''}, position='left'
    Pressable->>IconAndSubtitle: render icon and subtitle elements
    Note over HeaderTitle: uses Platform.OS to apply Android alignment via position prop
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Verify RoomHeader replacement (TouchableOpacity → Pressable) preserves accessibility/hitSlop/behavior.
  • Confirm HeaderTitle prop migration (position + TextProps) doesn't break callers.
  • Check Android minHeight visual impact across devices and ensure style reductions (fontSize/padding removal) meet design.

Suggested reviewers

  • OtavioStasiak
  • diegolmello

Poem

🐰 Hopped in code with nimble feet,

Aligned the title, snug and neat,
Android heights found their place,
Pressable kept the header's grace,
A rabbit's cheer for tidy space.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: importing and using the shared HeaderTitle component from Header/components in RoomHeader, which aligns with the primary refactoring objective.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

Copy link
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

🧹 Nitpick comments (1)
app/containers/Header/components/HeaderTitle/index.tsx (1)

10-10: Make the default position explicit.

The position prop is optional but has no explicit default value. When undefined, the code implicitly treats it as 'center' (since position === 'left' evaluates to false). For clarity and maintainability, consider providing an explicit default.

Apply this diff:

 interface IHeaderTitle {
 	headerTitle?: string | ((props: { children: string; tintColor?: string }) => ReactNode);
-	position?: 'left' | 'center' | 'right';
+	position?: 'left' | 'center' | 'right';
 }
 
 type HeaderTitleProps = IHeaderTitle & TextProps;
-const HeaderTitle = memo(({ headerTitle, position, ...props }: HeaderTitleProps) => {
+const HeaderTitle = memo(({ headerTitle, position = 'center', ...props }: HeaderTitleProps) => {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3532447 and 62e0172.

⛔ Files ignored due to path filters (1)
  • app/containers/RoomHeader/__snapshots__/RoomHeader.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • app/containers/Header/components/HeaderContainer/index.tsx (3 hunks)
  • app/containers/Header/components/HeaderTitle/index.tsx (3 hunks)
  • app/containers/Header/components/HeaderTitle/styles.ts (1 hunks)
  • app/containers/RoomHeader/RoomHeader.tsx (3 hunks)
🔇 Additional comments (4)
app/containers/Header/components/HeaderTitle/styles.ts (1)

17-21: LGTM: Android title style cleanup.

The removal of lineHeight and paddingVertical while retaining flex: 1 is appropriate for the Android title style, allowing the Text to fill available space in its container.

app/containers/Header/components/HeaderContainer/index.tsx (1)

20-20: LGTM: Platform-appropriate header heights.

The conditional minHeight (56 for Android, 44 for iOS) aligns with Material Design and iOS Human Interface Guidelines for header/app bar heights.

Also applies to: 31-31

app/containers/Header/components/HeaderTitle/index.tsx (1)

13-14: LGTM: Props spreading enhances flexibility.

Combining IHeaderTitle with TextProps and spreading additional props to the underlying Text components is a good enhancement. This allows consumers to pass through standard Text properties like testID, accessibilityLabel, etc.

Also applies to: 32-32, 46-46

app/containers/RoomHeader/RoomHeader.tsx (1)

3-3: Remove reference to non-existent PlatformPressable component.

PlatformPressable does not exist in the codebase. Your current usage of Pressable from react-native-gesture-handler (line 172) is straightforward—it only uses basic props (onPress, disabled, hitSlop) without complex gesture handling. Throughout the codebase, the standard Pressable from react-native is used for simple interactions (e.g., UserItem.tsx, EmojiSearchbar.tsx, Chip/index.tsx), while react-native-gesture-handler's components are reserved for gesture-heavy interactions (BorderlessButton, RectButton). Consider switching to standard react-native Pressable for consistency with the existing pattern.

Likely an incorrect or invalid review comment.

color: colors.fontTitlesLabels
}}>
color: colors.fontTitlesLabels,
alignSelf: position === 'left' ? 'flex-start' : 'center'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Handle all position values explicitly.

The current implementation only distinguishes between 'left' and everything else (defaulting to 'center'). The 'right' position value is accepted by the type but would incorrectly render as centered. Consider implementing all three position values explicitly.

Apply this diff to handle all position values:

 					...styles.androidTitle,
 					color: colors.fontTitlesLabels,
-					alignSelf: position === 'left' ? 'flex-start' : 'center'
+					alignSelf: position === 'left' ? 'flex-start' : position === 'right' ? 'flex-end' : 'center'
 				}}

And similarly for the non-Android branch:

 					...styles.title,
 					color: colors.fontTitlesLabels,
-					alignSelf: position === 'left' ? 'flex-start' : 'center'
+					alignSelf: position === 'left' ? 'flex-start' : position === 'right' ? 'flex-end' : 'center'
 				}}

Also applies to: 44-44

🤖 Prompt for AI Agents
In app/containers/Header/components/HeaderTitle/index.tsx around lines 30 and
44, the style sets alignSelf using a binary check (position === 'left' ?
'flex-start' : 'center') which misrenders position='right'; update both the
Android and non-Android branches to handle all three explicit values ('left' ->
'flex-start', 'center' -> 'center', 'right' -> 'flex-end') (use a switch or
explicit conditional chain) so each position maps to the correct alignSelf.

Comment on lines +14 to +15
justifyContent: 'center',
alignItems: 'center'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove ineffective style properties.

justifyContent and alignItems are flex container properties and have no effect on Text components. Text elements are not flex containers unless you explicitly set display: 'flex', which is uncommon in React Native.

Apply this diff to remove the ineffective properties:

 	title: {
 		...sharedStyles.textBold,
 		fontSize: 16,
-		justifyContent: 'center',
-		alignItems: 'center'
 	},
🤖 Prompt for AI Agents
In app/containers/Header/components/HeaderTitle/styles.ts around lines 14 to 15,
the style object for the Text component includes flex container properties
justifyContent and alignItems which have no effect on Text; remove those two
properties from the styles so the Text style only contains relevant text/layout
properties (e.g., keep textAlign or padding if needed) to clean up dead code.

@divyanshu-patil divyanshu-patil changed the title Fix/header title improvement: use the headerTitle in the Header/components folder RoomHeader Nov 16, 2025
@divyanshu-patil divyanshu-patil changed the title improvement: use the headerTitle in the Header/components folder RoomHeader improvement: use the headerTitle in the Header/components folder for RoomHeader Nov 16, 2025
@divyanshu-patil divyanshu-patil changed the title improvement: use the headerTitle in the Header/components folder for RoomHeader feat: use the headerTitle in the Header/components folder for RoomHeader Nov 19, 2025
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.

1 participant