Files
compiler-explorer/static
PartoufandClaude Opus 5 80722a9de4 Keep conformance view libraries when restoring from a link
Fixes #9101.

`LibsWidget` applies saved libraries only once the lazily-loaded library
list arrives. The compiler and executor panes await `stateLoaded` before
reading it back; the conformance view read `get()` immediately after
constructing the widget, so `currentLibs` was empty for the whole of the
pane's startup.

The first compile happens as soon as the editor hands over the source,
long before that list lands, so a restored link compiled with no
libraries at all, and every `saveState` until the user touched the libs
button wrote `libs: []` back into the pane state. That is the reported
behaviour: the link fails, toggling the library off and on fixes it, and
re-sharing produces a link that fails again. The button still read
"Libraries (1)" throughout, because the widget had the state; only the
pane's cached copy was empty.

- Seed `currentLibs` from the pane's own state in the constructor, so the
  first compile and any early `saveState` carry the libraries.
- `initLibraries` awaits `stateLoaded` and then adopts what the widget
  resolved, recompiling only if it disagrees with the state (a library no
  selected compiler supports gets dropped that way).
- `updateLibraries` waits for that same init before re-keying the widget.
  `setNewLangId` carries over the libraries in use, so a compiler change
  arriving early would otherwise have found none to carry.
- `onLibsChanged` compares libraries by value; it compared array identity,
  which was always true.
- The two saved shapes, `{name, ver}` and older links' `{id, version}`,
  move into `stateLibsToLibs`, used by both `loadState` and the pane.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUaGS1HUUWCefgiQGNeQDo
2026-09-09 01:22:56 +02:00
..
2025-10-28 09:45:26 +01:00
2026-06-02 12:19:29 -05:00
2026-07-02 18:26:35 +01:00
2026-06-02 12:19:29 -05:00
2025-07-28 10:34:46 -05:00
2025-04-24 12:10:37 -05:00