element-hq / element-hq/element-x-android

Custom Widget Support

Open
#7,099 1 comment 2 reactions 0 assignees View on GitHub
T-Enhancement
Dominant language
Kotlin
Stars
2.4k
Forks
624
Avg merge
1d 14h
Merged PRs (30d)
149

Description

### Your use case

#### What would you like to do?
I'd like custom widgets to be supported on mobile clients.

#### Why would you like to do it?
I'm working on an Immich (photo hosting app) bridge that will sync albums with rooms and room membership sync with album share permissions. Images added to the room get uploaded to the album and photos uploaded to the album post a thumbnail in the room (bidirectional). The widget on Element Desktop shows a photo-wall and I can chat with my family members about the images they upload, and I get push notifications when someone uploads to an album shared with me. Using Matrix chat makes it much more convenient to comment on photos which in turn, helps make photos more searchable in Immich.

#### How would you like to achieve it?
I would very much like to the ability to configure rooms with custom widgets on Element X. On a mobile client, it would make sense that widgets render full screen, replacing the chat window. It also makes sense that widgets enabled in a room would get an icon in the top bar (next to the camera or phone icon) that opens the widget. The initial feature to enable widget support should be incredibly simple:
```
open widget icon -> opens widget webview -> Close widget icon/back to chat icon.
```
And it can very easily be locked behind a feature flag.

I don't know about how the client decides what icon to use to open the view, whether each room can only manage one widget at a time and the icon is the same across all rooms, or perhaps an emoji, or maybe the widget registers some sort of icon with the homeserver - any would be acceptable if it unblocks the feature.

### Have you considered any alternatives?

The only alternative is to use another mobile client.

### Additional context

If this question has been asked and answered, I apologize. I didn't see any feature requests or discussions in GitHub regarding custom widgets. [Link to new discussion](https://github.com/element-hq/element-meta/discussions/3259). Happy to try and implement something and open a PR if you are open to the feature.

### Are you willing to provide a PR?

Yes

Contributor guide

Open the contributing guide

Research direction

Start by tracing the room top-bar widget icon, the mobile widget webview entry point, and the feature flag mentioned in the request. Determine how custom widgets are configured and whether one widget can be opened per room; done means a widget can be opened from a room, displayed full-screen, and closed back to chat on mobile.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.