Update subtitle rendering in notebook Analysis Cards (#5112)#5112
Open
shrutipatel31 wants to merge 1 commit intofacebook:mainfrom
Open
Update subtitle rendering in notebook Analysis Cards (#5112)#5112shrutipatel31 wants to merge 1 commit intofacebook:mainfrom
shrutipatel31 wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@shrutipatel31 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98690381. |
shrutipatel31
added a commit
to shrutipatel31/Ax
that referenced
this pull request
Mar 30, 2026
Summary: Matches the web UI change from D97406631 for notebook (Jupyter/Bento) rendering of Ax analysis cards. **Before**: Subtitles were hidden behind a clickable <details>/<summary> element with an info icon - users had to click to reveal the subtitle text. **After**: Subtitles are now shown as visible, secondary-styled text directly beneath the title, line-clamped to a single line. A "See more"/"See less" toggle appears automatically when the subtitle text overflows, allowing users to expand and collapse the full text. Key changes to html_card_template in analysis_card.py: - Replaced <details>/<summary> with always-visible <p class="card-subtitle"> using CSS -webkit-line-clamp: 2 - Added a "See more"/"See less" <button> toggle that is shown only when the subtitle is actually clamped (detected via scrollHeight > clientHeight in a requestAnimationFrame callback) - The inline script uses `document.currentScript.previousElementSibling` to locate its sibling card element and querySelector to find the subtitle and toggle within it, avoiding the need for unique DOM IDs or any Python-side bookkeeping - Removed the info icon CSS (content: "ℹ️") and hover-to-reveal interaction Differential Revision: D98690381
8977b4c to
eedcc60
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5112 +/- ##
==========================================
- Coverage 96.40% 96.40% -0.01%
==========================================
Files 613 613
Lines 68142 68142
==========================================
- Hits 65694 65693 -1
- Misses 2448 2449 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary: Matches the web UI change from D97406631 for notebook (Jupyter/Bento) rendering of Ax analysis cards. **Before**: Subtitles were hidden behind a clickable <details>/<summary> element with an info icon - users had to click to reveal the subtitle text. **After**: Subtitles are now shown as visible, secondary-styled text directly beneath the title, line-clamped to a single line. A "See more"/"See less" toggle appears automatically when the subtitle text overflows, allowing users to expand and collapse the full text. Key changes to html_card_template in analysis_card.py: - Replaced <details>/<summary> with always-visible <p class="card-subtitle"> using CSS -webkit-line-clamp: 2 - Added a "See more"/"See less" <button> toggle that is shown only when the subtitle is actually clamped (detected via scrollHeight > clientHeight in a requestAnimationFrame callback) - The inline script uses `document.currentScript.previousElementSibling` to locate its sibling card element and querySelector to find the subtitle and toggle within it, avoiding the need for unique DOM IDs or any Python-side bookkeeping - Removed the info icon CSS (content: "ℹ️") and hover-to-reveal interaction Differential Revision: D98690381
eedcc60 to
590fc2e
Compare
shrutipatel31
added a commit
to shrutipatel31/Ax
that referenced
this pull request
Apr 2, 2026
Summary: Matches the web UI change from D97406631 for notebook (Jupyter/Bento) rendering of Ax analysis cards. **Before**: Subtitles were hidden behind a clickable <details>/<summary> element with an info icon - users had to click to reveal the subtitle text. **After**: Subtitles are now shown as visible, secondary-styled text directly beneath the title, line-clamped to a single line. A "See more"/"See less" toggle appears automatically when the subtitle text overflows, allowing users to expand and collapse the full text. Key changes to html_card_template in analysis_card.py: - Replaced <details>/<summary> with always-visible <p class="card-subtitle"> using CSS -webkit-line-clamp: 2 - Added a "See more"/"See less" <button> toggle that is shown only when the subtitle is actually clamped (detected via scrollHeight > clientHeight in a requestAnimationFrame callback) - The inline script uses `document.currentScript.previousElementSibling` to locate its sibling card element and querySelector to find the subtitle and toggle within it, avoiding the need for unique DOM IDs or any Python-side bookkeeping - Removed the info icon CSS (content: "ℹ️") and hover-to-reveal interaction Differential Revision: D98690381
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.
Summary:
Matches the web UI change from D97406631 for notebook (Jupyter/Bento) rendering of Ax analysis cards.
Before: Subtitles were hidden behind a clickable
element with an info icon - users had to click to reveal the subtitle text.- Replaced
/
- Added a "See more"/"See less" toggle that is shown only when the subtitle is actually clamped (detected via scrollHeight > clientHeight in a requestAnimationFrame callback)
- The inline script uses
- Removed the info icon CSS (content: "ℹ️") and hover-to-reveal interaction
After: Subtitles are now shown as visible, secondary-styled text directly beneath the title, line-clamped to a single line. A "See more"/"See less" toggle appears automatically when the subtitle text overflows, allowing users to expand and collapse the full text.
Key changes to html_card_template in analysis_card.py:
with always-visible
using CSS -webkit-line-clamp: 2
document.currentScript.previousElementSiblingto locate its sibling card element and querySelector to find the subtitle and toggle within it, avoiding the need for unique DOM IDs or any Python-side bookkeepingDifferential Revision: D98690381