Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#82
Layout
Switches from a linear columnar layout to a side-by-side grid layout at the
lg
breakpoint.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
Failure
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.
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.