mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-11-30 16:44:32 -06:00
clearOptions()/addOption() only mark a tom-select drop-down's rendered content stale. Nothing repaints it: open() does not, and only the focus and input handlers call refreshOptions(). So a drop-down that is open, or that is reopened without first losing focus, keeps showing the previous option list. This had been discovered and solved twice already, in gccdump-view and then in diff (#9058), and missed in the other two panes that rebuild a picker straight off a compile result. Move it into a shared replaceOptions() helper and route all four through it. Fixes the two that had no repaint at all: - cfg-view's function selector, rebuilt in onCompileResult - opt-pipeline's group selector, rebuilt via updateResults Also drops the isOpen guard #9058 added. It was wrong: a drop-down can be closed but still focused, and reopening it that way does not repaint, so the stale list would survive. gccdump had it right by refreshing unconditionally. gccdump keeps its trailing refreshOptions() because the addItem() after the rebuild goes through refreshItems(), which re-marks the content stale, so the repaint done during replaceOptions() no longer covers it. cfg-view previously cleared its options before deciding whether it had a cfg at all, so the no-cfg path now explicitly empties the picker rather than leaving the previous functions listed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>