fix(spoolman): break long comments & support multiline comments #1781
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.
Description
Spoolman allows putting newline characters in the "Comment" field, allowing users to somewhat organize any notes relevant to certain spools (for example, I put the selling vendor name & what was the condition of the spool on arrival).
Currently, Mainsail does not preserve these newline characters, just renders the received comment "as-is" in a plain HTML fashion. This leads to everything being presented in one line, easily overflowing the table & dialog when a lot of notes are added. There's also no line break behavior defined, so even one-liner, long comments cause dialog overflow (see attached screenshot).
However,
\n
character is nothing special when proper CSS is applied, so this can be easily fixed, which is what this PR does. It should also takes care of long, unbreakable words, which are another case of potential unwanted horizontal overflow.Related Tickets & Documents
N/A
Mobile & Desktop Screenshots/Recordings
Before:
After: