Skip to content

Conversation

brianHarder
Copy link
Contributor

Contributor checklist:

  • My contribution is not related to translations.
  • My commits are in nice logical chunks with good commit messages
  • My changes are rebased on the latest main branch
  • A pnpm run ready run passes successfully (more about tests here)
  • My changes are ready to be shipped to users

Description

This PR ensures that highlighting in the chat list only occurs by mouse hover and keyboard navigation. Previously there was an issue where clicking and dragging on a chat would cause it to stay highlighted both throughout the drag and even after mouse release. To achieve this, the default mouse behavior has been prevented, and new CSS classes have been added to only highlight conversation lists via mouse hover or the tab key.

I manually tested this PR by performing mouse movements in my staging environment and ensuring that the highlighting was either applied or not applied as expected. I specifically simulated the click and drag several times to make sure the highlight was not lingering. I also added a test file - conversationListHighlight_test.ts - which simulates a hover movement to check for highlighting and a click-drag movement to check that the highlight does not stay. I did all my testing on my laptop, which runs macOS 10.15.7.

Screen.Recording.2025-08-15.at.3.59.53.PM.mov

Copy link
Contributor

@trevor-signal trevor-signal left a comment

Choose a reason for hiding this comment

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

@brianHarder thanks for this PR! It looks great; I have one clarifying question.

It's great that you added a mock-test, but I think it's unnecessary for this kind of small stylistic change -- mock tests are great but also have overhead so we don't add them for every change.

onClick={onClick}
onMouseDown={onMouseDown}
onMouseDown={event => {
event.preventDefault();
Copy link
Contributor

Choose a reason for hiding this comment

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

can you say more why this change is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trevor-signal thank you for the feedback! I included this line of code because the default Chromium behavior would maintain an 'active' state on a chat list item throughout the drag, which I believe could cause the highlight to linger. This change was specifically to address the highlight during dragging.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you say more? If I remove this line, things seem to continue to work well.

@@ -0,0 +1,99 @@
// Copyright 2024 Signal Messenger, LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

@brianHarder like I mentioned in the review, this is really cool that we could have a mock test here, but I think a mock test for this minor UI change is unnecessary (each mock test has an overhead). Do you mind (sadly) removing it?


@include mixins.keyboard-mode {
&:focus:not(:disabled, &--disabled, &--is-selected) {
@include mixins.light-theme {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we trying to set the colors to the opposite of the hover state above (I may just be not understanding).

Also, have you tested this in light mode? I'm not sure nested mixings work the way we always intend. We've been moving to the newer CSS syntax light-dark() which might work well here.

@brianHarder
Copy link
Contributor Author

@trevor-signal I believe I've addressed all outstanding feedback! Here are the changes:

  1. Removed mock test
  2. Removed change in BaseConversationListItem.tsx seeing that SCSS changes are sufficient
  3. I originally had the colors for keyboard highlighting opposite because I was getting the wrong gradient in dark mode, and switching them fixed that but then introduced the wrong shade in light mode. I updated the code to use the light-dark() syntax as you suggested.
SignalPr4fixes.mov

@trevor-signal
Copy link
Contributor

Thanks, @brianHarder! We've merged this internally and it will be released with our next beta release.

trevor-signal added a commit that referenced this pull request Sep 18, 2025
Co-authored-by: trevor-signal <[email protected]>
Co-authored-by: Brian Harder <[email protected]>
trevor-signal added a commit that referenced this pull request Sep 18, 2025
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.

9 participants