Commit Graph

339 Commits

Author SHA1 Message Date
ganfra c27bbaa1f6 Fix mention pill overflowing the end of the line when too wide 2026-10-15 12:54:25 +02:00
bmarty 8100fa6555 Sync Strings from Localazy 2026-10-12 00:37:35 +00:00
Benoit Marty 5f317aa2a0 Fix MarkdownTextInputTest with Compose 1.13
The Compose 1.13 test libraries start the test window in touch mode, where the editor is
not focusable in Robolectric, so `requestFocus()` was not giving it the focus anymore.
Use `requestFocusFromTouch()`, which leaves the touch mode first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 20:54:27 +02:00
bxdxnn 5cac4767f1 Add smooth animation to voice messages play progress (#7698)
* Add linear animation to voice message playback progress

Instead of animating the small `progress` value changes, calculate an animation for the range `maxProgress - progress`, with a linear interpolator so it's completely smooth. Previously, the progress was updated in 'steps' that were quite noticeable.
2026-09-18 09:39:15 +02:00
jmartinesp dfccde93c6 Sync Strings from Localazy 2026-09-02 10:07:17 +00:00
hayaksi1 23005317cf Merge develop into the PreviewParam rename
The 174 commits develop gained since this branch was cut touch preview data
in three ways, and each is resolved so the flipped konsist rule still holds
across the merged tree.

Two screens the branch had renamed were deleted upstream by "Remove the
account provider search screen and homeserver resolver": the
changeaccountprovider and searchaccountprovider packages. Their deletion
wins, so ChangeAccountProviderStatePreviewParam, SearchAccountProviderStatePreviewParam
and the two views that used them go with them rather than coming back
under the new name.

Two preview classes develop added still carried the old suffix and are
renamed here, along with the `@PreviewParameter` reference in each view:
GlobalSearchStateProvider -> GlobalSearchStatePreviewParam and
SendFailureDialogStateProvider -> SendFailureDialogStatePreviewParam.

Everything else merged textually. No production class extending
PreviewParameterProvider is left with a `Provider` name, and no reference
to any of the 194 renamed names survives outside the CHANGES.md entry that
records a past pull request title.
2026-08-24 10:55:40 +03:00
hayyaksi c362bca527 Keep the send button when the composer is emptied while editing a message (#7456)
* Keep the send button when the composer is emptied while editing

rememberEndButtonParams checked whether the composer had sendable text
before it checked whether the user was editing a message, so clearing
the text of a message being edited replaced the send button with the
voice recorder button. Starting a recording from there abandons the
edit.

Check the editing branch first, as the formatting composer already does,
and let it render a disabled send button when there is nothing to send.

* Update screenshots
2026-08-20 08:55:50 +02:00
hayaksi1 03c330ee07 Rename PreviewParameterProvider subclasses to the PreviewParam suffix
The `Provider` suffix reads as a dependency provider rather than as preview
data, and it collides with the real providers in the codebase — `StringProvider`,
`PickerProvider`, the login feature's `AccountProvider` — so the name says
nothing about which of the two a class is. `PreviewParam` says it.

195 classes are renamed, along with the 185 files named after them, the konsist
rule that enforces the convention, the presentation-class file templates and the
onboarding documentation.

This cannot be split. `Konsist.scopeFromProduction()` scans the whole project, so
flipping the assertion before every class has moved leaves the rule red, and a
rule that accepted either suffix during a transition would be exactly the kind of
compatibility layer this convention change is meant to remove.

Two judgement calls in the rule itself. The `name.endsWith("PreviewProvider")`
exclusion is dropped: its only job was to reject a redundant `Preview` before
`Provider`, and the new suffix already contains it; no class currently ends with
`PreviewProvider`, so removing it changes nothing today. And
`EditableAvatarViewUriProvider` is renamed rather than deleted from the exclusion
list even though no such class exists in this repository, since it presumably
comes from the modules overlaid for the enterprise build.

Nothing keyed off the old suffix: no snapshot filename contains a provider class
name, so no Paparazzi image changes, and the Kover variants match on `*Presenter`,
`*State` and `*ViewKt`, so coverage bounds are unaffected.
2026-08-17 17:40:33 +03:00
Benoit Marty a740423343 Sync strings. 2026-08-17 11:34:52 +02:00
Jorge Martín 07e90ff704 Fix MarkdownTextInputTest using the previous onSendMessage signature 2026-08-13 12:10:19 +02:00
Benoit Marty d017a84b2b Remove useless let statement. 2026-08-13 11:47:22 +02:00
Benoit Marty 8c8d232eac Make onSendMessage parameter not nullable 2026-08-13 09:21:31 +02:00
Benoit Marty fb82291f0a Merge pull request #7353 from hayaksi1/fix/860-enter-sends-message
Send a message with Enter on a physical keyboard, Shift+Enter for a new line
2026-08-13 09:19:07 +02:00
Benoit Marty ae5c4161c7 Remove redundant parenthesis 2026-08-12 18:14:36 +02:00
Benoit Marty 00e9a8ab71 Fix wrong TextComposer placeholder displayed when in a thread.
We cannot only use MessageComposerMode since use can edit a message in a thread, so this is becoming handly.
2026-08-12 17:05:08 +02:00
hayaksi1 4b5429395d Drop the comments from the Enter key handling
Review feedback: the callback name and the device-id check read on their
own, and the test names carry the soft versus physical keyboard rule.
2026-08-09 15:37:18 +03:00
hayaksi1 1024323661 Send a message with Enter on a physical keyboard, Shift+Enter for a new line
With a hardware keyboard attached, Enter inserted a newline and the only
way to send was to reach for the send button, which is the opposite of
what every desktop chat client does.

MarkdownEditText gains an optional Enter listener and consumes Enter when
it comes from a physical keyboard without Shift. Shift+Enter keeps
inserting a newline, and a key event from the on-screen keyboard is
identified by its VIRTUAL_KEYBOARD device id and left alone, so nothing
changes for touch users. The key release is consumed as well, so no
newline leaks out on key repeat.

TextComposer passes its existing send lambda through, guarded by the same
canSendTextMessage check the send button already uses, so Enter cannot
send an empty message.

Relates to https://github.com/element-hq/element-x-android/issues/860
2026-08-09 04:09:30 +03:00
Benoit Marty d1cf1aa09f Fix deprecation warning on androidx.compose.material3.ListItem 2026-08-06 18:35:17 +02:00
Jorge Martin Espinosa 0cd163a680 Import Compound tokens from v10.2.3 (#7272)
* Import Compound tokens from `v10.2.3`

* Remove manually added `bgSubtleTertiary` semantic color: it's in Compound now

* Bump enterprise module to a compatible commit
2026-07-28 09:07:24 +00:00
ganfra 9c3fe5ad23 Drop mutating setter for MentionSpan trailingText 2026-07-22 17:28:30 +02:00
ganfra 2a86c69b9d Sync user status strings with Localazy and tidy formatting
# Conflicts:
#	libraries/ui-strings/src/main/res/values/temporary.xml
2026-07-22 17:28:29 +02:00
ganfra 06a903718b Display user status next to display names across rooms and profiles 2026-07-22 17:27:21 +02:00
Benoit Marty 2ceff75e65 Merge pull request #7227 from unclejay80/a11y/formatting-option-state-description
Expose formatting toggle state to TalkBack
2026-07-17 10:00:31 +02:00
Jorge Martin Espinosa 0d03472c60 Content scanner (Element Pro): scan timeline events for unsafe content (#7159)
* Simplify how event content with captions are displayed

The caption component will now be added in `TimelineItemEventContentView` instead of separately in each `TimelineItem__View` component

* Make sure `CoilMediaFetcher` methods to fetch media throw errors

We need to catch them later to check if the content scanner marked some thumbnails or medias as invalid/unsafe in `AsyncImage` instances

* Add a `ContentScannerService` that allows us to manually scan a list of medias in an event and then update and store the results

The results take the form of `ContentValidationValue`, stored in a `ContentValidationState` instance tied to the event

* Create `EventContentValidationCache` to keep the `ContentValidationStates` for events in a room

* Expose `EventContentValidationCache` to Compose using `LocalEventContentValidationState`

Also add a couple of helper functions to avoid having to manually remember the states

* Use the new components to display invalid content in the timeline items

* Add `blurhash` to most media items so we can use it while validating the thumbnails/medias

* Fix custom layout issues with screenshot and UI tests

* Also check the validation state for replied-to events in the composer

* Fix and add tests

* Handle unrecoverable content validation errors too: display a 'not found' UI

* Improve the performance of `EqualWidthColumn` for the single item case

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-07-16 07:59:51 +00:00
Jürgen Wischer a6aa29f375 Expose formatting toggle state to accessibility services
FormattingOption used clearAndSetSemantics with only a contentDescription,
so the Bold/Italic/Underline toggle buttons never exposed whether they
were currently active to TalkBack. Add a stateDescription reflecting the
selected/unselected state alongside the existing contentDescription.

New a11y_active / a11y_inactive strings added to temporary.xml for
Localazy import.
2026-07-15 22:05:04 +02:00
Benoit Marty 1ddb32645c Merge pull request #7007 from element-hq/renovate/androidx.compose.material3-material3-1.x
Update dependency androidx.compose.material3:material3 to v1.5.0-alpha21
2026-07-06 18:31:45 +02:00
Benoit Marty 79f1423a30 Fix accessibility: message composer label and 'Seen by' button (#6390, #6393)
- MarkdownTextInput: set contentDescription on MarkdownEditText so TalkBack
  announces a persistent label even when the field has content (fixes #6390)
- TimelineItemReadReceiptView: remove hideFromAccessibility() so the 'Seen by'
  button is exposed to TalkBack; use semantics (not clearAndSetSemantics) to
  preserve click action, and add Role.Button (fixes #6393)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 17:49:32 +02:00
Benoit Marty 123037a612 Fix broken preview of BottomSheet in Android Studio. 2026-06-19 14:04:46 +02:00
Benoit Marty c430877d87 Ensure Robolectric test are run using API 36 until the library support API 37. 2026-06-18 12:18:32 +02:00
ElementBot d39b208099 Sync Strings from Localazy (#7021)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-06-16 12:59:45 +02:00
Jorge Martín 97de57fd79 More fixes 2026-05-28 09:54:01 +02:00
ElementBot 0aaa80cbdc Sync Strings from Localazy (#6856)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-05-26 08:05:07 +00:00
Benoit Marty 26fe5b6492 Merge pull request #6650 from element-hq/feature/bma/a11yFixes
[a11y] Fix a set of issues
2026-05-04 11:50:15 +02:00
bmarty 0d2f71643a Sync Strings from Localazy 2026-05-04 00:54:27 +00:00
Benoit Marty 11b9efa2c9 Migrate to v2 testing APIs 2026-04-30 16:04:07 +02:00
Benoit Marty f5737e9d2b a11y: add alternative text to the info icon.
Closes #6379
2026-04-30 12:07:05 +02:00
Benoit Marty 09ff3294d5 Ensure that all the ModalBottomSheet can scroll. 2026-04-27 10:23:56 +02:00
ElementBot 9a2ad3928a Merge pull request #6658 from element-hq/sync-localazy
Sync Strings
2026-04-27 09:17:54 +02:00
Kurban Sagitov 3379c61ad1 PR:Fix mention pill cut off (#6622)
* Fix mention pill cut off

* trigger CI after screenshots

* trigger CI after screenshots
2026-04-24 14:20:24 +02:00
Jorge Martin Espinosa 92ee479e91 Set max lines for 'in reply to' view conditionally (#6612)
* Set max lines for 'in reply to' view conditionally. When there is enough screen space, use 2 lines as before. If the screen space is limited, use a single one.

* Reduce vertical padding for reply-to view in compose

* Add screenshot test with single line in reply to view

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-04-23 15:15:52 +02:00
ElementBot e1b7171839 Sync Strings (#6626)
* Sync Strings from Localazy

* Use the previous plurals as plain strings

* Add extra case for 1 vs multiple users

* Update screenshots

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
2026-04-20 17:09:10 +00:00
Benoit Marty 269d367130 Merge pull request #6464 from kalix127/feat/reply-with-voice-message
Support replying to messages with voice recordings
2026-04-17 14:49:04 +02:00
bmarty 23c1112dcf Sync Strings from Localazy 2026-04-13 00:48:40 +00: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
Gianluca Iavicoli 4586ee31ea fix: re-focus text input after voice recording ends 2026-04-02 22:20:13 +02:00
Gianluca Iavicoli 9a81ec5569 refactor: remove keyboard dismissal logic during voice recording 2026-04-02 22:14:04 +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
Benoit Marty cbb220f08d Merge pull request #6472 from element-hq/feature/bma/inReplyUi
Update replied message UI
2026-03-27 10:17:01 +01:00
Benoit Marty 1de3729792 Merge pull request #6446 from bxdxnn/misc/bullet-margin
Add margin after bullet points
2026-03-25 17:05:48 +01:00