Skip to content

Conversation

mmenanno
Copy link

First time contributor checklist:

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 adds click-to-deselect conversation functionality to the Signal Desktop LeftPane, providing users with an intuitive way to clear conversation selections by clicking empty areas. Semi-relevant issue here #1784

User Value

  • Improved UX: Users can now click empty areas in the conversation list to deselect conversations
  • Intuitive behavior: Matches user expectations from other desktop applications
  • Mouse alternative: Provides click-based alternative to the Cmd+Shift+C keyboard shortcut
  • Non-disruptive: Preserves all existing functionality for interactive elements

What Changed

  • Added handleLeftPaneClick event handler to LeftPane.tsx
  • Smart detection of empty areas vs interactive elements using event.target.closest()
  • Calls showConversation({ conversationId: undefined, messageId: undefined }) to deselect
  • Added comprehensive unit tests in LeftPane_test.ts

Technical Implementation

  • Uses event.target.closest() to detect clicks on buttons, inputs, conversation items, etc.
  • Only deselects when clicking truly empty areas (not on interactive elements)
  • Includes preventDefault() and stopPropagation() for clean event handling
  • Follows existing Signal Desktop patterns for event handling and component structure
  • Minimal code footprint (~20 lines) with no performance impact

Test Approach

Manual Testing:

  • ✅ Verified click-to-deselect works in empty areas of conversation list
  • ✅ Verified clicking buttons/conversation items preserves normal behavior
  • ✅ Verified Cmd+Shift+C keyboard shortcut still works as expected
  • ✅ Tested edge cases (no conversation selected, various click targets)
  • ✅ Tested in development environment following CONTRIBUTING.md setup instructions

Automated Testing:

  • ✅ Added comprehensive unit tests covering:
    • DOM element detection (empty vs interactive areas)
    • Deselection condition logic
    • API call format verification
    • Edge case coverage (no selection, interactive elements)
  • ✅ All existing tests continue to pass (1,236 tests total)

Operating Systems:

  • ✅ macOS 14.6.0 (darwin 24.6.0) - Primary testing platform

Additional Testing:

  • ✅ Code formatted with Prettier
  • ✅ TypeScript compilation successful
  • ✅ ESLint accessibility rules properly handled with appropriate comments

- Added click handler to LeftPane for deselecting conversations on empty area clicks
- Provides intuitive alternative to Cmd+Shift+C keyboard shortcut
- Preserves existing functionality for interactive elements
- Includes comprehensive unit tests for the feature
@ayumi-signal ayumi-signal self-assigned this Sep 3, 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.

2 participants