Commit 6c06e04
authored
fix: assorted UI/UX fixes (Giphy, polls, dialogs, composer, headers) (#3081)
### π― Goal
Bundle of UI/UX fixes across multiple components.
### π Implementation details
**fix(Attachment): use pixel-based sizing constraints for Giphy images**
Giphy images used percentage-based CSS constraints which don't resolve
to pixel values. Replaced with pixel-based constraints via
`var(--str-chat__attachment-max-width)` and the
`clamped-height-from-original-image-dimensions` mixin.
**fix(Message): prevent editing Giphy messages**
Giphy messages (`command === 'giphy'`) are no longer editable since
their content is generated by the /giphy command.
**fix(Form): remove redundant onClick on SwitchField label**
`SwitchFieldLabel` had both `htmlFor` and a programmatic `onClick`,
causing the checkbox to toggle twice when clicking label text. Removed
the redundant `onClick`.
**fix(Poll): fall back to user ID instead of "Anonymous" for voters
without a display name**
`PollVoteAuthor` fell back to "Anonymous" when `vote.user.name` was
falsy, making public polls appear anonymous. Now falls back to
`vote.user.id`.
**fix(Dialog): prevent dialog overlay from blocking pointer events**
The dialog overlay expanded to the nearest positioned ancestor, blocking
the channel list. Set `pointer-events: none` on the overlay with
`pointer-events: auto` on dialog contents.
**fix(MessageComposer): hide textarea scrollbar inside rounded compose
area**
Hidden with `scrollbar-width: none`, matching the pattern used in polls,
reactions, and search.
**fix(MessageComposer): restore pre-edit composer state when cancelling
edit**
When exiting edit mode, the composer restores to its pre-edit state
using a WeakMap-based snapshot mechanism. The snapshot is discarded
after a successful edit save.
**fix(ChannelHeader, ThreadHeader): truly center title text**
The title wasn't centered because flanking elements had different
widths. Wrapped the toggle button and avatar/close button in
always-rendered start/end container divs with `flex: 1`, so the center
element is truly centered regardless of flanking content.
**style(AudioPlayback): bump PlaybackRateButton min-width**
Increased from 40px to 48px to prevent text clipping.
**fix(ChannelList): scope dialog overlay with `position: relative`**
The ChannelList lacked `position: relative`, so its dialog overlay
(`position: absolute; inset: 0`) escaped to the nearest positioned
ancestor higher in the tree β covering the entire sidebar when consumers
override `transform: none` on the channel list.
**fix(Modal): restore pointer events on GlobalModal**
`GlobalModal` portals into `.str-chat__dialog-overlay` (which has
`pointer-events: none`) without using `DialogAnchor`, so its content
never received the `.str-chat__dialog-contents` class that restores
`pointer-events: auto`. The modal was visible but completely
click-through.
### π¨ UI Changes
- Giphy images properly size-constrained with CDN resizing
- Giphy messages no longer show "Edit Message" in actions menu
- Poll creation toggles respond correctly when clicking label text
- Poll vote results show user ID instead of "Anonymous" for nameless
users
- Dialog overlay no longer blocks interaction with the channel list
- Composer textarea no longer shows a scrollbar inside the rounded input
area
- Cancelling edit mode restores the composer to its pre-edit state
- Channel and thread header titles are truly centered
- ChannelList dialog overlay scoped to the channel list area
- GlobalModal is interactive again (no longer click-through)1 parent 887a326 commit 6c06e04
File tree
23 files changed
+312
-67
lines changed- src
- components
- Attachment/styling
- AudioPlayback/styling
- ChannelHeader
- styling
- ChannelList/styling
- Dialog
- service
- styling
- Form
- MessageActions
- __tests__
- MessageComposer
- __tests__
- hooks
- styling
- Message/hooks
- Modal/styling
- Poll
- Thread
- styling
- context
- styling
23 files changed
+312
-67
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 61 | | |
77 | 62 | | |
78 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 58 | + | |
64 | 59 | | |
65 | 60 | | |
66 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| 179 | + | |
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| |||
0 commit comments