你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/560626-lmarena-collapsible-code-blocks/versions,源站連結 點此以跳轉

LMArena | Collapsible Code Blocks

Adds collapsible code blocks with clickable headers, footer controls, and a global toolbar toggle

这些是此脚本变更过代码的版本。 显示所有版本。

  • v4.8 2026-01-12
    • Removed: width preservation on collapse (caused horizontal scrolling on narrow viewports)
    • Collapsed blocks now use natural width instead of forced minWidth
  • v4.7 2026-01-12

    // 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.2 2025-12-31

    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 button

    v4.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 2025-12-30

    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.9 2025-12-30

    v3.8
    - Fixed: conflict with other userscripts (Multi-Provider Chat Export, etc.)
    - Added 1000ms initialization delay to avoid React Hydration Error #418

    v3.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

  • v3.7 2025-12-29

    Script name changed from "LMArena | Code Block Collapse" to "LMArena | Collapsible Code Blocks"

  • v3.6 2025-12-29