Version the editor-open key so the old collapsed preference does not stick
1 changed file+5−3
src/App.tsxmodified+5−3View file
@@ -33,17 +33,19 @@ export default function App() {
3333 const [dirty, setDirty] = useState(false)
3434 const [tab, setTab] = useState<TabId>('interpolant')
3535 // The editor is the point of the app, so it starts open; anyone who would
36- // rather have the plots alone can hide it, and that choice persists.
36+ // rather have the plots alone can hide it, and that choice persists. The key
37+ // is versioned because an earlier build defaulted to collapsed and wrote a '0'
38+ // that would otherwise keep overriding this default for returning visitors.
3739 const [editorOpen, setEditorOpen] = useState(() => {
3840 try {
39- return localStorage.getItem('br-editor-open') !== '0'
41+ return localStorage.getItem('br-editor-open-2') !== '0'
4042 } catch {
4143 return true
4244 }
4345 })
4446 useEffect(() => {
4547 try {
46- localStorage.setItem('br-editor-open', editorOpen ? '1' : '0')
48+ localStorage.setItem('br-editor-open-2', editorOpen ? '1' : '0')
4749 } catch {
4850 /* private mode */
4951 }