Adds collapsible code blocks with clickable headers, footer controls, and a global toolbar toggle
These are versions of this script where the code was updated. Show all versions.
// v4.3 // - Changed: single-block expand no longer uses scroll anchoring // - Expanding a block now keeps the header in place; code appears below (no viewport shift) // - Lets user read expanded code from the beginning instead of being scrolled to the bottom
// v4.4 // - Fixed: single-block expand now actively scrolls header to top of viewport // - Ensures user always sees expanded code from the beginning (overrides browser scroll anchoring) // v4.5 // - Refined: single-block expand only scrolls if header is in bottom 1/3 of viewport or off-screen // - If header is already visible in upper 2/3, no scroll adjustment occurs // // v4.6 // - Fixed: single-block collapse no longer "snaps" the header down to the old footer position in some scroll states // - Changed: when collapsing a block while its header is visible, the header is used as the scroll anchor (keeps it stable) // - Fixed: auto-collapse on newly added blocks no longer triggers single-block scroll behavior // // v4.6 // - Fixed: single-block expand now first stabilizes the header position (cancels browser/scroll-area anchoring) // - Refined: only scrolls header to top if it ends up off-screen or in the bottom ~15% of the viewport // // v4.7 // - Cleanup: removed unused `data` parameter from internal log function // - Cleanup: removed unused boolean return values from createToolbarButton() // - Cleanup: consolidated duplicate CSS rules and keyframe definitions
v4.1- Cleanup: removed overridden CSS declaration (border-radius: 0 0 0 0)- Cleanup: removed unused 'warn' log style- Cleanup: removed redundant typeof guard for activeFixedState- Cleanup: consolidated duplicate mouseleave handlers on collapse buttonv4.2- Changed: replaced localStorage with GM_setValue/GM_getValue for settings persistence- Settings now stored via userscript manager (more reliable, syncs across browsers if supported)
v4.0- Fixed: fixed footer now repositions when textarea grows during user input- Added ResizeObserver on input area to detect height changes- Footer no longer conflicts with/covers the textarea when it expands
v3.8- Fixed: conflict with other userscripts (Multi-Provider Chat Export, etc.)- Added 1000ms initialization delay to avoid React Hydration Error #418v3.9- Replaced hardcoded delay with dynamic Stabilization Observer- Detects React hydration completion by watching for the chat input bar- Uses requestIdleCallback for optimal performance/compatibility
Script name changed from "LMArena | Code Block Collapse" to "LMArena | Collapsible Code Blocks"