Fix collapse functionality bugs: CSS selectors, height parsing, and toggle bar creation#300
Fix collapse functionality bugs: CSS selectors, height parsing, and toggle bar creation#300
Conversation
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Remove hardcoded height: 22.4rem from collapse CSS to allow JavaScript dynamic height control based on tag_collapse-## class names. Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
collapse-## styling in quantecon-book-theme|
@copilot will this restrict the height of the code-cell block showing in |
I understand you want a different UX approach. Currently my change removes the hardcoded height and uses the existing "Show more/Show less" toggle links. Are you asking for:
Is this the behavior you're looking for? If so, I can implement this change to the CSS and JavaScript. |
|
thanks @copilot - correct I am looking to change the current behaviour so the initial height specified but the code-cell expands to show the full contents (or collapses back to the original restricted height). I don't want scrollbars as they aren't that useful for looking at the code. |
Replace separate "Show more/Show less" toggle links with integrated clickable bar at bottom of code cells. Maintains dynamic height control while providing more intuitive expand/collapse interaction. Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
I've implemented the new UX approach you requested. The changes include: What changed:
Technical implementation:
The code now expands/collapses with a more intuitive bottom bar that's integrated into the code cell UI, addressing your feedback about wanting a single clickable element rather than separate toggle links. Commit: 5aaa9cb |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #300 +/- ##
=======================================
Coverage ? 15.09%
=======================================
Files ? 2
Lines ? 265
Branches ? 0
=======================================
Hits ? 40
Misses ? 225
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot can we please relax the |
…matrix Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
I've updated the Python version requirement from
The tox environments now correctly show both Commit: af6d9a2 |
|
@copilot do we need to comment the update to |
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
I've implemented both requested changes in commit c8ad6ff: 1. Simplified button text:
2. Added scroll behavior:
The implementation uses |
No, the
This is standard npm behavior and the changes are already documented in the commit that updated |
Sorry I meant do we need to commit the changes to package-lock.json? |
Yes, Why we should commit it:
The current state shows |
|
@copilot when you hit |
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Yes, the current implementation already scrolls to the bottom of the code block when collapsing using Improvements:
The scroll behavior now:
This keeps readers at the "same point from a reader perspective" as requested, allowing them to continue reading the content that follows without losing their place. |
|
@copilot can you please update the |
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
I've updated the "Expand" and "Collapse" button text to bold font in commit 6f1adc7. Change made:
The button text now appears in bold, making it more prominent and easier to see when users interact with collapsible code blocks. |
Result:
The collapse functionality now works correctly:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.