Skip to content

Wrap job description text in UI#103

Merged
coord-e merged 2 commits intocookpad:masterfrom
josh-jones-cookpad:josh-jones/wrap-job-descriptions
Dec 11, 2025
Merged

Wrap job description text in UI#103
coord-e merged 2 commits intocookpad:masterfrom
josh-jones-cookpad:josh-jones/wrap-job-descriptions

Conversation

@josh-jones-cookpad
Copy link
Contributor

@josh-jones-cookpad josh-jones-cookpad commented Dec 9, 2025

Description

When there are longer strings (like URLs) on the job definitions show and index views in the "description" cell, the text can overflow the cell, making it hard to read and get from the index page to the details page. This PR adds some CSS to help improve the UX in this case.

@cookpad/platform-task-force

Screenshots

The "show" view, before:
Screenshot 2025-12-09 at 10 23 06

The "show" view, after:
Screenshot 2025-12-09 at 10 23 28

The "index" view, before:
Screenshot 2025-12-09 at 10 22 55

The "index" view, after:
Screenshot 2025-12-09 at 10 23 41

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the UX of job definition views by adding CSS to properly wrap long text content (such as URLs) in description cells. Previously, long strings would overflow table cells, making content difficult to read and navigation challenging.

  • Adds word-wrapping styles to table cells (td and th) to handle long strings
  • Enables horizontal scrolling for the box-body container as a fallback
  • Applies changes to both index and show views of job definitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +55
.barbeque_job_definitions_controller .table.table-bordered td {
word-wrap: break-word;
word-break: break-word;
overflow-wrap: break-word;
white-space: normal;
min-width: 100px;
}

.barbeque_job_definitions_controller .table.table-bordered th {
word-wrap: break-word;
word-break: break-word;
overflow-wrap: break-word;
white-space: normal;
min-width: 100px;
}
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The td and th selectors have identical CSS rules. Consider combining them to reduce code duplication:

.barbeque_job_definitions_controller .table.table-bordered td,
.barbeque_job_definitions_controller .table.table-bordered th {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  min-width: 100px;
}

This maintains the same functionality while making the stylesheet more maintainable.

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +44
word-wrap: break-word;
word-break: break-word;
overflow-wrap: break-word;
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

Using both word-wrap, word-break, and overflow-wrap is redundant. overflow-wrap is the modern standard property, while word-wrap is its legacy alias. Consider using only:

overflow-wrap: break-word;
word-break: break-word;

The word-wrap property can be removed as overflow-wrap provides the same functionality with better modern browser support.

Copilot uses AI. Check for mistakes.

.barbeque_job_definitions_controller .table.table-bordered td {
word-wrap: break-word;
word-break: break-word;
Copy link
Member

Choose a reason for hiding this comment

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

word-break: break-word and overflow-wrap: break-word seems to be conflicting (maybe overflow-wrap is ignored?)

Has the same effect as overflow-wrap: anywhere combined with word-break: normal, regardless of the actual value of the overflow-wrap property.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/word-break

Also, since word-break: break-word seems to be deprecated, it should be replaced with a combination of other properties

@josh-jones-cookpad
Copy link
Contributor Author

josh-jones-cookpad commented Dec 10, 2025

Thanks for the feedback @coord-e and @copilot

I ran the app locally and stripped back the CSS as much as I could while making sure the UI fix looks the same. It turns out that word-break: break-word and overflow-wrap: break-word are not equivalent, especially in tables, and word-break: break-word actually behaves like overflow-wrap: anywhere, which is what I was looking for 💡 [TIL]

@coord-e
Copy link
Member

coord-e commented Dec 11, 2025

Thanks!

@coord-e coord-e merged commit 0bd975c into cookpad:master Dec 11, 2025
4 checks passed
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.

3 participants