Skip to content

WIP/POC: Adds conversation descriptions#21584

Open
cristianoliveira wants to merge 22 commits into
devfrom
hackathon26/group-description
Open

WIP/POC: Adds conversation descriptions#21584
cristianoliveira wants to merge 22 commits into
devfrom
hackathon26/group-description

Conversation

@cristianoliveira

Copy link
Copy Markdown
Contributor

No description provided.

- New ConversationDetailsDescription component with heading and body text
- Renders between group header and add-participants button
- Hidden for 1:1 conversations, shown for groups/channels
- Uses mocked description text (API integration to follow)
- Styled to match design: same-size bold heading, muted gray body, 1:2 spacing ratio
- 6 new tests covering render, empty state, and integration
- 4-state flow: filled, hover (edit icon), editing (textarea), empty (placeholder)
- Click description or placeholder to enter edit mode
- Save on blur or Enter key, skip callback when value unchanged
- 200 character max limit enforced via maxLength
- Edit icon appears on hover, hidden during editing
- Styled textarea with focus ring, italic placeholder for empty state
- Label updated to 'Description (optional)' per design
- 10 unit tests covering all states and transitions
- Add description field to API Conversation interface
- Add description observable to Conversation entity
- Map description in ConversationMapper from API payload
- Add get/update methods in ConversationService (localStorage mock)
- Add updateConversationDescription/loadConversationDescription in ConversationRepository
- Wire ConversationDetails to use real observable + update callback
- TODO comments mark all mock points for API migration
- All 16 tests pass, ConversationMapper tests unaffected
- Escape discards draft changes and exits edit mode
- Original description text is restored without calling onDescriptionChange
…spec

Align with https://wearezeta.atlassian.net/wiki/spaces/PAD/pages/2996273429

- Remove description from Conversation API interface (separate endpoint)
- Remove description from ConversationMapper (not in conversation payload)
- Add ConversationDescriptionResponse/UpdateData types matching spec
- Restructure ConversationService with version-aware get/update
- Store {version, description} in localStorage mock (mirrors API shape)
- Add optimistic concurrency tracking in ConversationRepository
- TODO comments mark all points for MLS encryption + real API swap:
  - encrypt/decrypt with exportSecretKey
  - GET/PUT /conversations/:domain/:id/description
  - Handle 409 stale-description-version
  - Inject conversation.description-update event
- Add description locators and helpers to ConversationDetailsPage
  (descriptionSection, descriptionContent, descriptionTextarea, descriptionEditIcon)
- Add setDescription, clearDescription, cancelDescriptionEdit helpers
- 7 E2E specs covering:
  - Empty state shows placeholder
  - Set description and verify display
  - Edit existing description
  - Cancel editing with Escape preserves original
  - Description persists after closing/reopening panel
  - Edit icon appears on hover
  - Edit icon click enters edit mode
Prepares encryption layer matching iOS wire format (zmEncryptPrefixingIV):
- descriptionCrypto.ts: encryptDescription/decryptDescription using
  AES-GCM with 12-byte IV prepended to ciphertext, base64-encoded
- 6 tests: round-trip, random IV, wrong key, empty string, unicode, wire format
- ConversationRepository: useEncryptedDescriptions flag (false) for switching
- ConversationService: step-by-step comments for encrypted API path

Existing primitives reused:
- MLSService.exportSecretKey(groupId, 32) for MLS epoch secret
- Web Crypto API (crypto.subtle) for AES-GCM
- Pattern matches EncryptedStorage from OIDCService

To activate encrypted path: set useEncryptedDescriptions = true and
replace localStorage calls with API + crypto pipeline
Render conversation descriptions with the shared message renderer so newlines,
links, and HTML escaping match chat message behavior in both the details panel
and group creation message.
- place group description label above rendered content in chat
- apply markdown heading styles to chat and sidebar descriptions
- use normal text color for rendered descriptions
- replace group description chat icon with pin icon
- align the pin icon to the top of multiline descriptions
Add a new ConversationDescriptionInput component for setting group conversation descriptions using a Lexical rich text editor.
@sonarqubecloud

Copy link
Copy Markdown

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