Context
public/index.html has grown to 1150+ lines with inline <script> containing the full Admin UI: state management, API client, DOM manipulation, history panel, file upload, autosave, etc. This makes it harder to navigate, test, and maintain.
Proposal
Extract the inline JS into ES modules under public/js/ (or similar), e.g.:
api.js — fetch wrappers (api.list, api.snapshot, api.restore, etc.)
state.js — shared UI state object
ui.js — DOM manipulation, toast, badges, panel logic
history.js — history panel fetch/select/restore flows
Load via <script type="module" src="..."> to keep the HTML as a thin shell.
References