Commit graph

2187 commits

Author SHA1 Message Date
0ef6b69a79 Merge branch 'main' into wallet
# Conflicts:
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesFlowNode.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesNavigator.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesNode.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/MessageComposerPresenter.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/suggestions/SuggestionsPickerView.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/suggestions/SuggestionsProcessor.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/threads/ThreadedMessagesNode.kt
#	features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/topbars/MessagesViewTopBar.kt
#	libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/ResolvedSuggestion.kt
2026-04-16 22:05:16 -07:00
Jorge Martin Espinosa
c349f74ce8
Fix loading initial items of non-live timelines (#6598)
This was done automatically by the SDK in the past by returning a `Reset` timeline update, but this behaviour changed and now we have to do it.
2026-04-16 14:19:29 +00:00
Jorge Martin Espinosa
80470b3792
Feature: add room threads list (#6575)
Add threads list screen for rooms:

- Add `ThreadsListService` to subscribe to thread changes in the room.
- Create `ThreadsListView` and its associated node a presenters (the UI may change).
- Add a menu icon in the room screen to open it.

This is still pending info about unread threads, so several UI components related to it will be hidden.

* Add feature flag and use it to hide the access to this new screen

---------

Co-authored-by: ElementBot <android@element.io>
2026-04-15 12:14:22 +00:00
bmarty
23c1112dcf Sync Strings from Localazy 2026-04-13 00:48:40 +00:00
Benoit Marty
c3a999e45a
Merge pull request #6559 from element-hq/feature/bma/fixModuleDependencies
Fix module dependencies
2026-04-10 09:17:34 +02:00
Benoit Marty
5ad6ad0852 Depend on api not impl module. 2026-04-08 17:51:03 +02:00
Benoit Marty
5e3f3f31e8 Improve code. 2026-04-08 17:16:04 +02:00
Benoit Marty
d17992abe8 Ensure Mark as fully read is not invoked several times. 2026-04-08 17:15:04 +02:00
bxdxnn
22a51bae5c
Fix Threads not tappable in pinned messages list (#6535) 2026-04-08 11:25:59 +02:00
Benoit Marty
e63a50b512
Merge pull request #6517 from element-hq/feature/bma/compound10
Sync compound tokens https://github.com/element-hq/compound-design-tokens/releases/tag/v10.0.0
2026-04-08 09:40:14 +02:00
ElementBot
6ad85d4dfc
Sync Strings (#6537)
* Sync Strings from Localazy

* Sync strings.

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2026-04-07 16:02:12 +02:00
Benoit Marty
4ad495d36c
Add support for slash commands (under Feature Flag) (#6482)
* Add support for slash commands

* Update screenshots

* Rename module `slash` to `slashcommands`

* Rename `SlashCommand` to `SlashCommandService`

* Introduce MsgType in order to send text message with a different msgtype value.

* Format file and add parameter names, add default values and cleanup

* Add isSupported parameter to filter out unsupported yet commands.

* Slash commands: disable suggestions if the feature is disabled.

* Fix sending shrug command.

* Add missing test on SuggestionsProcessor

* Add tests on MessageComposerPresenter about slash command.

* Fix import ordering

* Add missing tests on CommandExecutor

* Add missing tests in MarkdownTextEditorStateTest

* Slash commands: Improve code when sending message with prefix.

* Slash commands: Add support for /unflip

---------

Co-authored-by: ElementBot <android@element.io>
2026-04-02 16:15:32 +02:00
Benoit Marty
e401619017 Changer border color of InReplyTo to separatorPrimary 2026-04-02 09:37:15 +02:00
Jorge Martin Espinosa
410a3d132b
Add floating/sticky date badge in the timeline (#6496)
* Add floating date indicator while scrolling the timeline (#6433)

* Add `FeatureFlags.FloatingDateBadge`. This enables displaying the floating date badge in the timeline as you scroll.

* Don't display the floating badge if the timeline isn't reversed. Otherwise, this will affect talkback users and break the existing navigation

* Use `TimelineItem.formattedDate()` to get the date to display. Always try finding the closest one (usually it will be just the 1st one we try).

* Align designs with iOS. Also fix shadows in fade animation by adding some paddings.

* Update screenshots

---------

Co-authored-by: Gianluca Iavicoli <gianluca.iavicoli04@gmail.com>
Co-authored-by: ElementBot <android@element.io>
2026-04-01 10:45:57 +00:00
699807e1bd feat(wallet): add recipient address to payment card UI
Enhanced the payment timeline card to display the recipient/sender address:
- Added truncatedToAddress and truncatedFromAddress to TimelineItemPaymentContent
- New truncateAddress() helper (first 8 + last 6 chars)
- Payment card now shows "To: addr_tes...ytjqp" for sent payments
- And "From: addr_tes...pd0hq" for received payments
- Updated wrapper to expose new properties

The card now displays:
- Amount in ADA (large, bold)
- Sent/Received indicator with Cardano icon
- Truncated recipient/sender address
- Status chip (Pending/Confirmed/Failed with icons)
- Truncated tx hash (tappable to CardanoScan)
- Testnet badge when applicable
- "View on CardanoScan →" link for confirmed transactions
2026-03-29 06:57:12 -07:00
faa6f768f6 fix(wallet): use proper isDm check for wallet button visibility
The wallet button should only appear in genuine DM rooms. The previous
logic (isDm || activeMembersCount == 2L) was overly broad as it would
show the wallet in any 2-person room, including private rooms that
are not direct messages.

Now uses only roomInfo.isDm which properly checks:
- isDirect flag is true (Matrix spec DM indicator)
- activeMembersCount <= 2 (at most 2 active members)

This ensures the wallet button only appears in real 1:1 DM rooms.
2026-03-29 06:57:02 -07:00
c1b927380f fix: show wallet button for 2-member rooms even without isDirect flag
The isDm check requires isDirect=true which is not set for rooms
created via API. Relax the check to also show the wallet button
in any room with exactly 2 active members.
2026-03-28 16:21:36 -07:00
1dbc4c92c4 feat(wallet): add wallet setup flow and payment event wiring
Phase 4: Final features for Element X ADA alpha

## Wallet Setup Flow
- New setup state machine: WELCOME -> GENERATING -> ADDRESS -> BACKUP_PROMPT -> COMPLETE
- WalletSetupState.kt: state data class and events
- WalletSetupPresenter.kt: generates wallet via CardanoKeyStorage, state transitions
- WalletSetupView.kt: Compose UI with FLAG_SECURE for mnemonic display
- WalletSetupNode.kt: Appyx node with setup callbacks
- Wired into MessagesFlowNode via NavTarget.WalletSetup
- SSSS backup skipped for alpha (local-only, TODO for Phase 5)

## Payment Event Wiring
- PaymentProgressPresenter now sends Matrix payment event on tx confirmation
- Added roomId to PaymentProgressNode.Inputs and NavTarget.Progress
- Calls paymentEventSender.sendPaymentEvent() when SubmissionState.Confirmed
- Non-fatal if event fails (tx already succeeded)

## Files Changed
- features/wallet/impl/setup/ (new directory, 4 files)
- MessagesFlowNode.kt: NavTarget.WalletSetup, navigation wiring
- PaymentFlowNode.kt: roomId passthrough to Progress
- PaymentProgressNode.kt: roomId in Inputs
- PaymentProgressPresenter.kt: event sending on confirmation
2026-03-28 10:13:06 -07:00
455f45ed59 feat(wallet): add no-wallet guard for /pay and fix payment event type
Phase 3b: Deferred features completion

Task 1: /pay No-Wallet Guard
- Add noWalletSetup and isCheckingWallet flags to PaymentEntryState
- Update PaymentEntryPresenter to check wallet state early via collectAsState
- Add full-screen "Wallet Required" prompt to PaymentEntryView when no wallet
- Add onOpenWalletSettings callback through the entire navigation chain
- Wire callback in MessagesFlowNode to navigate to WalletPanel

Task 2: Payment Timeline Card (already existed, just fixed event type)
- Fix isPaymentEventType() to check for correct event types:
  - co.sulkta.payment.request (was incorrectly com.sulkta.cardano.payment)
  - co.sulkta.payment.status (for status updates)

Build verified: assembleGplayDebug passes
2026-03-28 09:47:55 -07:00
e33c87c164 Phase 3: Wallet panel UI and full /pay flow wiring
- Add WalletPanelView with 4 tabs (Overview, Assets, History, Settings)
- Overview tab shows balance, QR code for receiving, and Send ADA button
- Assets tab shows native tokens held at address
- History tab shows recent transactions with explorer links
- Settings tab shows address, network, and backup/delete options

- Add NativeAsset and TxSummary models to wallet API
- Add getAddressAssets() and getAddressTransactions() to CardanoClient
- Implement new methods in KoiosCardanoClient and FakeCardanoClient

- Add wallet button to MessagesViewTopBar (DM rooms only)
- Add isDmRoom to MessagesState for conditional UI
- Wire navigateToWallet() callback through to MessagesFlowNode
- Add NavTarget.WalletPanel and WalletPanelNode integration

- Add string resources for wallet panel UI

Known limitations:
- Uses Chart icon as placeholder for wallet (Compound lacks wallet icon)
- Wallet setup flow not implemented (TODO)
- Transaction amounts in history need additional API calls to calculate
2026-03-28 09:23:58 -07:00
ad89eddfea fix(wallet): resolve DI scope mismatch, WalletState constructors, packaging conflict
- CardanoWalletManager moved CardanoClient dep out of AppScope — was causing
  Metro MissingBinding at compile time (CardanoClient is SessionScope)
- refreshBalance() now takes balanceLovelace param instead of fetching from client
- WalletState constructor calls fixed with all required fields
- app/build.gradle.kts: added META-INF/gradle/incremental.annotation.processors
  to pickFirsts to resolve moshi-kotlin-codegen/lombok resource conflict
- App builds and launches successfully on emulator (verified)
2026-03-27 21:56:01 -07:00
11ebaf5042 fix(wallet): resolve sealed interface inheritance issue
TimelineItemEventContent is a sealed interface in messages:impl, so external
modules cannot add implementers to its hierarchy.

Solution: Create TimelineItemPaymentContentWrapper in messages:impl that
implements the sealed interface and wraps the wallet API's payment content.

Changes:
- Remove inheritance from TimelineItemPaymentContent (wallet:api)
- Add TimelineItemPaymentContentWrapper (messages:impl)
- Update TimelineItemContentFactory to wrap payment content
- Update TimelineItemEventContentView to use wrapper
2026-03-27 12:29:12 -07:00
06a9c6b0d2 fix(wallet): resolve audit findings - DI typos, missing dependency, event type consistency
FIXES:
1. Fix Metro DI package typo: dev.zacsweeny.metro → dev.zacsweers.metro
   - KoiosCardanoClient.kt
   - DefaultTransactionBuilder.kt
   - PaymentStatusPoller.kt
   - WalletModule.kt

2. Add missing dependency: features:messages:impl now depends on features:wallet:impl

3. Standardize event type: Use 'co.sulkta.payment.request' consistently
   - Updated TimelineItemPaymentContent.EVENT_TYPE
   - Updated test assertion

4. Fix DI scope inconsistency: PaymentStatusPoller now uses SessionScope
   (was AppScope but depends on SessionScoped CardanoClient)

5. Fix mixed DI annotations in DefaultPaymentEventSender
   (was mixing Anvil + Metro, now uses Metro consistently)
2026-03-27 12:11:45 -07:00
f2b95d6b8a fix(wallet): replace text-marker hack with proper raw event API (room.sendRaw + MsgLikeKind.Other)
- Add Timeline.sendRaw() to send custom Matrix events
- Add CustomEventContent type for receiving custom events
- Update TimelineEventContentMapper to handle MsgLikeKind.Other
- Update TimelineItemContentFactory to intercept payment events
- Rewrite DefaultPaymentEventSender to use sendRaw instead of text markers
- Update TimelineItemContentPaymentFactory to parse raw JSON
- Remove text-marker detection from TimelineItemContentMessageFactory
- Update tests to use raw event API
- Mark raw event SDK blocker as RESOLVED in BLOCKERS.md

Event type: co.sulkta.payment.request (reverse-domain format)
Status updates: co.sulkta.payment.status

Benefits:
- Proper Matrix protocol compliance
- No JSON embedded in text messages
- Events won't be indexed by search
- Clean separation from regular messages
2026-03-27 11:45:12 -07:00
adee67cf0d feat(wallet): payment card timeline item and raw event handling (Tasks 7+8)
Task 7: Timeline Payment Card
- TimelineItemPaymentView integration with TimelineItemEventContentView
- Payment card rendering for both sender and recipient perspectives
- Unit tests for TimelineItemPaymentContent

Task 8: Raw Event Handling
- Modified TimelineItemContentMessageFactory to intercept payment events
- Added isSentByMe parameter propagation through content factories
- FakePaymentEventSender for testing
- Unit tests for TimelineItemContentPaymentFactory

SDK Limitation Workaround:
Since matrix-rust-sdk doesn't expose raw event sending or UnknownContent
raw JSON, payment events are encoded as text messages with a marker:
[cardano-payment:v1]{...json...}

This falls back gracefully for non-wallet clients while enabling
rich payment card rendering for wallet-enabled clients.
2026-03-27 11:08:03 -07:00
39561e1aeb feat(wallet): payment flow UI — entry, confirmation, progress screens (Task 6)
Implements the payment flow UI for the Element X ADA wallet:

## Screens
- PaymentEntryScreen: Amount/recipient input with pre-filling from /pay command
- PaymentConfirmationScreen: Transaction details with fee estimation (FLAG_SECURE)
- PaymentProgressScreen: Submission status with polling for confirmation

## Features
- Biometric authentication before payment confirmation
- Matrix user detection with 'hasn't linked wallet' inline message
- CardanoScan explorer link for transaction viewing
- Testnet warning banner
- Insufficient funds detection

## Wire-up
- MessageComposerPresenter intercepts /pay commands
- SlashCommandParser integration for command detection
- Navigation to PaymentFlowNode on valid /pay command
- Snackbar error on parse errors

## Technical
- Circuit presenter pattern with Molecule/Turbine tests
- @PreviewsDayNight for all Composables
- Metro DI integration
- Fake implementations for testing

Includes PaymentEntryPresenterTest, PaymentConfirmationPresenterTest,
PaymentProgressPresenterTest with comprehensive coverage.
2026-03-27 11:04:41 -07:00
db4c262b27 feat(wallet): /pay slash command parser and composer integration (Task 5)
Implements Task 5 of Phase 1:

New files:
- ParsedPayCommand.kt: Sealed interface for parse results
  - WithAddressRecipient: Pay to Cardano address
  - WithMatrixRecipient: Pay to Matrix user (requires lookup)
  - AmountOnly: Amount specified, prompt for recipient
  - Empty: Open payment flow with no prefilled data
  - ParseError: Parse error with human-readable reason

- SlashCommandParser.kt: Full /pay command parser
  - Handles: /pay, /pay 10, /pay 10 ADA, /pay 10 tADA
  - Matrix recipients: /pay 10 ADA @user:server
  - Cardano addresses: /pay 10 ADA addr1...
  - Validates amounts (decimal support, max supply check)
  - Validates addresses (prefix, length, network match)
  - Comprehensive error messages

- SlashCommandParserTest.kt: 40+ unit tests covering all patterns

Modified files:
- ResolvedSuggestion.kt: Added Command type for slash commands
- SuggestionsProcessor.kt: /pay shows as autocomplete suggestion
- MarkdownTextEditorState.kt: Command insertion in text editor
- MessageComposerPresenter.kt: Command handling in InsertSuggestion

Note: MessageComposerPresenter sendMessage interception deferred to
Task 6 (requires PaymentFlowPresenter for navigation).
2026-03-27 10:38:46 -07:00
Benoit Marty
7d28c52242 Cleanup 2026-03-25 16:51:41 +01:00
Benoit Marty
747f588fa7 Update UI of replies. 2026-03-25 15:27:36 +01:00
ganfra
92920b862b
Merge pull request #6342 from element-hq/feature/fga/live_location_sharing_setup
Setup live location sharing feature
2026-03-24 15:46:45 +01:00
Benoit Marty
75a6eb21ca
Merge pull request #6453 from element-hq/feature/bma/increaseIconSize
Increase icon size of audio and files in the timeline
2026-03-24 11:59:17 +01:00
renovate[bot]
2f99806603
fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha15 (#6306)
* fix(deps): update dependency androidx.compose.material3:material3 to v1.5.0-alpha15

* Fix deprecations

* Add bottom sheet workaround

* Fix new lint issues

* Fix and ignore broken tests

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <android@element.io>
2026-03-24 11:24:07 +01:00
Benoit Marty
67f059a429 Attachments: change icon size to 24 and container to 36 2026-03-24 11:01:10 +01:00
ganfra
9a984e1423 Merge branch 'develop' into feature/fga/live_location_sharing_setup 2026-03-24 10:17:24 +01:00
ElementBot
7179ca867c
Sync Strings (#6435)
* Sync Strings from Localazy

* Sync strings.

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2026-03-23 18:05:26 +00:00
Jorge Martin Espinosa
eb7d65263a
Fix long messages not being clickable (#6356)
* Fix long messages not being clickable

As @bmarty found out, `clip = true` causes the click event to be ignored in some cases. Since we have the shape we want to draw and we're using a custom `onDraw` modifier anyway to cut-out part of the path, we can just draw everything using the modifier and avoid using `clip = true`.

This seems to fix the issue.

* Fix clipping of images or other items that cover the bubble

* Fix borders being displayed for contents

* Extract the layer drawing logic into `drawInLayer` to simplify the inlined code. Remove redundant code, those changes are now in the `drawInLayer` block

* Workaround for lint issue: it seems like detekt can't properly detect usages in content receivers

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-03-23 18:11:55 +01:00
Benoit Marty
027da263c4
Merge pull request #6322 from element-hq/feature/bma/iterateDesignOnAttachment
Design iteration on file attachment in the timeline
2026-03-23 14:37:54 +01:00
Gianluca Iavicoli
800a9ab972
Fix keyboard not auto-opening when editing a message (#6412)
* fix: auto-open keyboard when editing a message

* fix: show keyboard on focused editor view instead of root view
2026-03-23 10:54:59 +01:00
bxdxnn
139d75d1ba
Fix room member not tappable in a Thread (#6416) 2026-03-19 14:23:10 +01:00
Benoit Marty
13578aa09b Sync string again. 2026-03-16 14:54:06 +01:00
bmarty
299d5a9394 Sync Strings from Localazy 2026-03-16 00:42:32 +00:00
ganfra
4a29fe4d94 Remove duplicate location content and reorder Live mode 2026-03-13 15:50:33 +01:00
ganfra
ccc5945e6f Fix quality! 2026-03-12 21:12:52 +01:00
ganfra
96147967ac Code cleanup 2026-03-12 12:35:46 +01:00
Benoit Marty
6a646550c8 Improve preview by adding a background color. 2026-03-11 15:43:15 +01:00
Benoit Marty
f97c61a386 Iterate on file attachment rendering in the timeline. Closes #6319 2026-03-11 15:30:15 +01:00
ganfra
0056a3f163 Fix compilation 2026-03-09 21:19:57 +01:00
ganfra
f2d4ffc5bd Introduce LiveLocationContent for the timeline (needs sdk) 2026-03-09 20:54:01 +01:00
ganfra
ffad69b7b9 Make sure we can display both Live and Static locations in ShowLocation 2026-03-09 20:54:01 +01:00
ganfra
8a12cba923 Rename send location to share location 2026-03-09 20:54:01 +01:00