Skip to content

fix: keep in-progress draft and class-fit settings while editing - #2

Open
usehoplite[bot] wants to merge 3 commits into
masterfrom
hoplite/himera-538f6b75
Open

fix: keep in-progress draft and class-fit settings while editing#2
usehoplite[bot] wants to merge 3 commits into
masterfrom
hoplite/himera-538f6b75

Conversation

@usehoplite

@usehoplite usehoplite Bot commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Two papercuts found while auditing the main teacher flows in the workspace UI, plus the button that depended on the old behavior:

  1. Editing profile fields discarded the in-progress draft. updateProfile() reset worksheet, hasDraft, lastAgentMessage, and lastError on every keystroke in Grade/Subject/Topic. Typing one character into the Subject field silently wiped all generated questions (and reset the reading-target constraint back to the default grade value). It now only syncs the reading-level constraint when the grade is explicitly changed, and leaves the draft and constraint state untouched otherwise.

  2. "Remove source" wiped the whole workspace. removeSource() delegated to initialState(), which cleared not only the source material but also the class-fit constraints (time limit, reading target, question mix, standards) and the entire activity history. It now clears only source, the worksheet draft, and draft/agent/error flags, and appends a "Removed source material · class fit kept" activity entry so the shared history stays intact.

  3. "Clear workspace" still fully resets. The activity panel's clear button previously called removeSource(); since that action is now scoped, the button routes to the store's pre-existing reset() action, so it still empties profile, constraints, activity, and drafts as before.

Also includes .hoplite/settings.json: records the verified dev-server setup/run commands and preview port for sandboxes that provision this repo, and installs git-lfs (required by the first-party PR publishing path).

No changes to WebMCP tool registration, source handling, browser support, or deployment configuration.

Verification

  • npm run lint — 0 warnings, 0 errors
  • npm test — 7/7 pass
  • npm run build — succeeds (dist produced)
  • Live browser confirmation (dev server, seeded Maths/Fractions source):
    • Generated a draft, typed a character into Subject → all 6 question cards, live constraint checks, and the raised reading target remained present (previously the draft vanished).
    • Removed the source → subject/topic, reading target (Grade 4.5), time limit, and 3 prior activity entries survived; only the source preview and cards cleared.
    • Clicked "Clear workspace" → profile, reading target, activity, and cards all reset to defaults.

Screenshots are not included: the active model route cannot inspect image pixels, so I can't vouch that a capture shows the intended state; the behavioral evidence above is from live DOM/text inspection of the running app.

Open in Hoplite

usehoplite Bot and others added 3 commits September 2, 2026 07:52
updateProfile() no longer resets the worksheet draft, hasDraft flag, or agent/error messages on every keystroke in Grade/Subject/Topic; the reading-level constraint re-syncs only when the grade is explicitly changed.

removeSource() now clears just the source, worksheet, and draft state (logging the removal in the activity feed) instead of calling initialState(), which silently wiped class-fit constraints and activity history.

Co-authored-by: Tim Apple <richerbran@gmail.com>
Persist the verified setup (npm install) and run (npm run dev:full) scripts plus the preview port in .hoplite/settings.json so future sandboxes provision and launch the preview correctly.

Co-authored-by: Tim Apple <richerbran@gmail.com>
The first-party source-control publishing path invokes 'git lfs ls-files' on every push; install git-lfs in the setup script so future sandboxes can open pull requests without a manual install.

Co-authored-by: Tim Apple <richerbran@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants