daef7ea190
Helper functions (matrix-mas capability group): - mas_client_register_bash_infra: register/sync OAuth clients via mas-cli - mas_syn2mas_migration_bash_infra: dry-run + apply user migration to MAS - synapse_msc3861_enable_go_infra: edit homeserver.yaml MSC3861 block (with diff) - wellknown_oidc_patch_go_infra: patch well-known JSON with msc2965.authentication - synapse_login_flows_check_go_infra: health-check post-migration login flows Flows + issues for custom Matrix clients (PC + Android): - 0010 matrix-client-pc: Wails + React+Mantine (issues 0147-0153) - 0011 matrix-client-android: Kotlin + Compose (issues 0154-0161) - 0162 enable MAS as auth provider (Synapse delegate) — EXECUTED on VPS - 0163 custom admin panel propio (sustituye synapse-admin) Production state (organic-machine.com): - Synapse migrated SQLite -> Postgres - MSC3861 active, password_config disabled - 21 users + 41 access_tokens migrated via syn2mas - 4 MAS clients registered (element, matrix_pc, matrix_android, admin_panel) - synapse-admin container removed + Coolify route deleted - well-known patched with org.matrix.msc2965.authentication Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
65 lines
2.9 KiB
Markdown
65 lines
2.9 KiB
Markdown
---
|
|
id: "0156"
|
|
title: "matrix-client-android composer: markdown, replies, edits, reactions, media"
|
|
status: pending
|
|
priority: high
|
|
created: 2026-05-24
|
|
related_flows: ["0011"]
|
|
related_issues: ["0155", "0157"]
|
|
dependencies: ["0155"]
|
|
tags: [matrix, android, compose, composer, markdown, media, voice]
|
|
---
|
|
|
|
## Objetivo
|
|
|
|
Composer Compose con markdown shortcuts, replies, edits, reactions emoji, threads, upload media (camara nativa, galeria, voice msg con `MediaRecorder` opus). Drag&drop archivos compartidos via share sheet Android.
|
|
|
|
## Tareas
|
|
|
|
1. ViewModel:
|
|
- `ComposerViewModel(matrixClient, roomId)` — methods `sendText`, `sendReply`, `editMessage`, `sendReaction`, `uploadMedia`, `recordVoice`.
|
|
2. Compose:
|
|
- `Composer` con `OutlinedTextField` + toolbar (markdown shortcuts B/I/code).
|
|
- Hotkeys soft keyboard: Send action en IME.
|
|
- `AttachmentMenu`: botones camara, galeria, file, voice.
|
|
- `EmojiPicker` overlay (reusar libreria existente o componente propio).
|
|
- `ReactionBar` debajo de `EventBubble` con aggregates.
|
|
- `ThreadScreen` — nueva pantalla full para thread (no panel lateral como en PC, por screen real estate movil).
|
|
- Voice recording UI: hold-to-record con waveform preview + cancelar al deslizar.
|
|
3. Backend:
|
|
- Upload media: comprimir imagenes si >2MB antes de upload (`androidx.exifinterface` para preservar orientacion).
|
|
- Voice: `MediaRecorder` con OPUS, 32kbps, ogg container.
|
|
- Markdown -> HTML local con `markwon` library (lightweight, no Goldmark equivalente).
|
|
4. Share intent:
|
|
- `IntentFilter` para `android.intent.action.SEND` + tipos image/video/text/file -> abre composer del room seleccionado.
|
|
5. Tests:
|
|
- Instrumented `SendMarkdownTest` — `**bold**` formateado en Element Web.
|
|
- Instrumented `EditMessageTest` — edicion in-place propagada.
|
|
- Instrumented `VoiceMsgTest` — graba 5s + upload + play en Element Web.
|
|
|
|
## Funciones del registry a crear
|
|
|
|
- `markdown_to_matrix_html_kotlin_core` — wrapper markwon con sanitizer.
|
|
- `image_compress_kotlin_core` — resize + recompress JPEG.
|
|
- `voice_record_kotlin_infra` — MediaRecorder opus wrapper.
|
|
- `Composer_kotlin_ui` — Compose composer + toolbar + attachment menu.
|
|
- `ReactionBar_kotlin_ui` — composable reactions.
|
|
- `ThreadScreen_kotlin_ui` — pantalla thread.
|
|
|
|
## Acceptance
|
|
|
|
- [ ] Mensaje markdown se ve formateado en Element Web.
|
|
- [ ] Reply con quote del msg padre.
|
|
- [ ] Edit in-place propagado en ambos clientes.
|
|
- [ ] Reaccion emoji bidireccional.
|
|
- [ ] Upload imagen 5MB -> compresion a ~1MB -> envio + thumbnail OK.
|
|
- [ ] Voice msg 5s reproducible en Element Web.
|
|
- [ ] Share intent desde galeria abre composer con imagen pre-cargada.
|
|
|
|
## Notas
|
|
|
|
- Sanitizer HTML server-side delegado a matrix-rust-sdk (mismo allowlist que cliente PC).
|
|
- Voice msg: encode opus 32kbps, max 5min.
|
|
- Markwon vs goldmark: ambos cumplen el rol equivalente en su stack. Salida HTML compatible Matrix.
|
|
- Drag&drop: en Android = share sheet o picker, no drag&drop nativo como en PC.
|