[Bug]: "Create Table form" data lost on page refresh / tab discard
Describe the bug
When a user is filling out the Create Table form with multiple columns (names, types, default values, constraints) and the page refreshes — either accidentally or due to browser tab discard from memory pressure — all entered column data is lost. The user has to start from scratch.
Steps to Reproduce
- Open the Create Table form
- Add several columns with custom names, types, and default values
- Refresh the page (or let the browser discard the tab due to low memory)
- Click Create Table again
- All column data is gone
Expected Behavior
Column draft data should be preserved so that when the user reopens the Create Table form, their work is restored.
Actual Behavior
All column definitions are lost on refresh or tab discard. The form resets to the default system columns only.
Proposed Solution
Persist column draft state to localStorage on every change, restore it when the form opens in create mode, and clear it on successful submit or cancel.
Additional Context
This is particularly painful for users defining complex tables with many columns — a common workflow in a database management tool. Tab discard due to memory pressure is a realistic scenario when users have many tabs open simultaneously.
Happy to submit a PR for this if the approach looks good.
Source: InsForge/InsForge