Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Message Card design #120

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Implement Message Card design #120

merged 4 commits into from
Jul 26, 2024

Conversation

henrycatalinismith
Copy link
Collaborator

#82

Layout

Switches from a linear columnar layout to a side-by-side grid layout at the lg breakpoint.

2024-07-15 21 23 52

FixedSizeList and messageFormHeight

On narrower devices, the MessageForm component's layout is linearised in order to fit everything in despite the lack of horizontal space. An increase in height is necessary for this. Its parent component, MessageList, needs to be able to configure a fixed height value to enable the virtualisation. So MessageForm exports a messageFormHeight function for this purpose.

Buttons and the button group

As we have a little group of buttons underneath the text area, MUI's ButtonGroup component seemed like a natural fit. And since we have a save button with a loading status, it seemed equally natural to pull in LoadingButton from @mui/lab. In their default form these vary a teeny tiny bit in appearance as compared to the designs, but I don't think it's a big deal.

Success

2024-07-15 21 22 22

Failure

2024-07-15 21 21 30

Reset button

This doesn't actually feature in the design but I figured it was easier to preserve it for the sake of this pull request as it is quite a nice little extra feature.

2024-07-15 21 20 24

Message params

These are going to be challenging enough to display that I think we should postpone implementing them. It will probably require moving MessageList to VariableSizeList. I think it'll be interesting enough that it should be tackled in a pull request of its own once this foundation is in place.

Textarea rows

As the virtualisation imposes a fixed height on each MessageForm, it's helpful for elements to vary in size as little as possible, so I've set the translation input field textarea to be four rows high all the time.

Text size at 200% zoom

This is a pretty crowded layout, and the fixed height of the virtualisation imposes a rigidity that makes handling different zoom levels challenging. It's still operable at 200% zoom though, which is good enough for WCAG success criterion 1.4.4. Would ideally like to tweak it so that the layout linearises above a certain zoom level but am mindful of the risk of being self-indulgent in overprioritising accessibility minutiae since it's my fav stuff to work on.

2024-07-15 21 42 42

@richardolsson richardolsson requested a review from WULCAN July 16, 2024 11:31
@WULCAN WULCAN self-assigned this Jul 25, 2024
Copy link
Collaborator

@WULCAN WULCAN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I just want a tiny thing fixed, and I'm wondering we can simplify with a mui feature I didn't know about.

webapp/src/components/MessageForm.tsx Outdated Show resolved Hide resolved
webapp/src/components/MessageForm.tsx Show resolved Hide resolved
webapp/src/components/MessageList.tsx Outdated Show resolved Hide resolved
@WULCAN WULCAN merged commit d08fa80 into main Jul 26, 2024
1 check passed
@WULCAN WULCAN deleted the issue-82/message-card branch July 26, 2024 18:14
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