New Case Contacts Table: expandable case contact rows#6823
Open
cliftonmcintosh wants to merge 6 commits intorubyforgood:mainfrom
Open
New Case Contacts Table: expandable case contact rows#6823cliftonmcintosh wants to merge 6 commits intorubyforgood:mainfrom
cliftonmcintosh wants to merge 6 commits intorubyforgood:mainfrom
Conversation
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What github issue is this PR for, if any?
Resolves #6498
What changed, and why?
Implements expand/collapse functionality for rows in the new case contacts table.
app/datatables/case_contact_datatable.rbcontact_topic_answersandnotesto the JSON response so the browser has the data it needs to render expanded contentcontact_topic_answers: :contact_topicto theincludesinraw_recordsto avoid N+1 queriesapp/javascript/src/dashboard.jsexpand-toggleCSS class and a pointer cursorrow.child()) to show/hide expanded content on chevron clickbuildExpandedContent()to build the expanded row HTML from the row's JSON data, matching the structure of the Figma design (topic heading followed by answer paragraph)app/assets/stylesheets/pages/case_contacts.scssexpand-togglestyles with a 0.3s CSS rotation animation for the chevron (matching the existing sidebar pattern)expanded-contentandexpanded-topicstyles to match the Figma layoutThe DataTables Child Rows API is used rather than Bootstrap collapse or manual DOM insertion because DataTables replaces the entire
<tbody>via AJAX on initialization. When this happens, any server-rendered or manually inserted rows are destroyed.row.child()inserts rows that DataTables manages itself, so they persist correctly.Topics column pill styling. While working on this issue I noticed the Topics column was rendering as a raw pipe-delimited string. I did not see an issue that covers the Topics column, so I updated the render for each topic to be a
badge-pillchip (matching the existing Draft badge style) with a+N Moreoverflow indicator when there are more than two topics. I am happy to pull this into a separate issue and PR if that is preferred.How is this tested?
Request specs — added to
spec/requests/case_contacts/case_contacts_new_design_spec.rb:contact_topic_answersis present and is an array in the datatable JSON responsenotesis included in the responsecontact_topicsis returned as an array of strings (not a pipe-delimited string)System specs — added
spec/system/case_contacts/case_contacts_new_design_spec.rb:Jest — updated
app/javascript/__tests__/dashboard.test.js:expand-toggleclassbadge-pillchip+N Morebadge for overflow topicsScreenshots
Screen recording of collapsible sections
new.contact.tables.expandable.rows.mov
AI Disclosure
This PR was implemented with the assistance of Claude Code (Anthropic, claude-sonnet-4-6). The AI was used to:
All generated code was reviewed and committed by the author.