Skip to content

UserItem: Fix recent regression where UnreadCount was misaligned#5297

Merged
gnprice merged 2 commits intozulip:mainfrom
chrisbobbe:pr-user-item-regression-fix
Mar 16, 2022
Merged

UserItem: Fix recent regression where UnreadCount was misaligned#5297
gnprice merged 2 commits intozulip:mainfrom
chrisbobbe:pr-user-item-regression-fix

Conversation

@chrisbobbe
Copy link
Copy Markdown
Contributor

See the code comments, and see screenshots of the bug at
#5277 (comment)

@gnprice
Copy link
Copy Markdown
Member

gnprice commented Mar 16, 2022

Thanks!

Let's do this by inserting a spacer View, rather than wrapping in a wrapper View. Like this:

@@ -31,6 +31,9 @@ const componentStyles = createStyleSheet({
     fontSize: 10,
     color: 'hsl(0, 0%, 60%)',
   },
+  spacer: {
+    flex: 1,
+  },
 });
 
 type Props<UserT> = $ReadOnly<{|
@@ -103,6 +106,7 @@ export function UserItemRaw<
             />
           </View>
         )}
+        <View style={componentStyles.spacer} />
         <UnreadCount count={unreadCount} inverse={isSelected} />
       </View>
     </Touchable>

I think that keeps the code simpler.

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Mar 16, 2022
See the code comments, and see screenshots of the bug at
  zulip#5277 (comment)

And Greg's suggestion to use this spacer View, to help keep the code
simpler:
  zulip#5297 (comment)
@chrisbobbe chrisbobbe force-pushed the pr-user-item-regression-fix branch from 77da5b2 to fa92d57 Compare March 16, 2022 01:36
@chrisbobbe
Copy link
Copy Markdown
Contributor Author

chrisbobbe commented Mar 16, 2022

Thanks for the review! Revision pushed, along with a fix for a bug on main that we discovered in the office.

See the code comments, and see screenshots of the bug at
  zulip#5277 (comment)

And Greg's suggestion to use this spacer View, to help keep the code
simpler:
  zulip#5297 (comment)
@gnprice gnprice force-pushed the pr-user-item-regression-fix branch from fa92d57 to 72f21d5 Compare March 16, 2022 16:53
@gnprice
Copy link
Copy Markdown
Member

gnprice commented Mar 16, 2022

Thanks! Looks good; merging.

@gnprice gnprice merged commit 72f21d5 into zulip:main Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants