Skip to content

Redesign inline player to match Mattermost mobile look - #68

Open
zainali89 wants to merge 1 commit into
streamer45:masterfrom
zainali89:feat/redesign-player-ui
Open

zainali89 wants to merge 1 commit into
streamer45:masterfrom
zainali89:feat/redesign-player-ui

Conversation

@zainali89

Copy link
Copy Markdown

Summary

Rewrites the PostType React component and its styles to match the voice-message visuals from Mattermost mobile — circular play button, draggable scrubber with floating thumb, formatted duration text, and a download icon.

Before / after

Mattermost mobile (reference) Web with this PR
mobile web

Same MP3 voice message in both screenshots. With this PR the web player visually matches the mobile native player.

Changes

  • webapp/src/components/post_type/post_type.jsx — rewrite:

    • React.createRef() for the <audio> element instead of document.getElementById after mount.
    • Custom div-based scrubber with track / fill / floating thumb, replacing the native <progress> element.
    • Mouse + touch drag-to-seek support (touch-action: none on the scrubber, passive: false on touchmove so we can preventDefault).
    • Time-display logic: shows total duration before first playback, current time afterwards.
    • ARIA attributes on the scrubber (role=slider, valuemin/max/now) and aria-label on the download link.
  • webapp/src/components/post_type/post_type.css — rewrite:

    • 44px circular play button with theme-accent tinted background.
    • Horizontal scrubber with a 4px track and 14px floating thumb.
    • Tabular-nums duration text.
    • Download icon styling.
    • All theming derived from the existing theme tokens (buttonBg / linkColor, centerChannelColor, centerChannelBg) so it adapts to user-selected themes.

No new dependencies. No backend changes.

Tested on

  • Mattermost server 10.11.0
  • Mattermost web on Chrome + Safari

Confirmed: play/pause, click-to-seek anywhere on the scrubber, drag-to-seek (mouse and touch), time display flipping between duration and current time, download link, theme adaptation when switching between light / dark / custom themes.

Related

A companion PR (#67) is the small bug-fix that makes voice messages renderable on Mattermost mobile (by setting file_ids on the post). This PR is independent and can be merged separately in either order — whichever lands second only needs a small post_type.css rebase since both touch that file.

Rewrites the PostType component and its styles to match the voice-
message visuals from Mattermost mobile.

Before / after screenshots in docs/voice-mobile.png and docs/voice-web.png.

Changes:

- webapp/src/components/post_type/post_type.jsx
  * Use React.createRef() for the <audio> element instead of
    document.getElementById after mount.
  * Custom div-based scrubber with track / fill / floating thumb,
    replacing the native <progress> element.
  * Mouse + touch drag-to-seek support (touch-action: none on the
    scrubber and passive: false on touchmove so we can preventDefault).
  * Time-display logic: shows total duration before first playback,
    current time afterwards.
  * Adds ARIA attributes to the scrubber (role=slider, valuemin/max/
    now) and aria-label to the download link.

- webapp/src/components/post_type/post_type.css
  * 44px circular play button with theme-accent tinted background.
  * Horizontal scrubber with 4px track and 14px floating thumb.
  * Tabular-nums duration text.
  * Download icon. Theme colors are derived from the existing theme
    tokens (buttonBg / linkColor, centerChannelColor, centerChannelBg).

No new dependencies. No backend changes.

Tested on Mattermost server 10.11.0 (web — Chrome + Safari). Confirmed:
play/pause, click-to-seek anywhere on the scrubber, drag-to-seek
(mouse and touch), time display flipping between duration and current
time, download link, theme adaptation when the user switches themes.
@zainali89
zainali89 force-pushed the feat/redesign-player-ui branch from 171f637 to b41b09f Compare May 21, 2026 13:55
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.

2 participants