fix: keep in-progress draft and class-fit settings while editing - #2
Open
usehoplite[bot] wants to merge 3 commits into
Open
fix: keep in-progress draft and class-fit settings while editing#2usehoplite[bot] wants to merge 3 commits into
usehoplite[bot] wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two papercuts found while auditing the main teacher flows in the workspace UI, plus the button that depended on the old behavior:
Editing profile fields discarded the in-progress draft.
updateProfile()resetworksheet,hasDraft,lastAgentMessage, andlastErroron 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."Remove source" wiped the whole workspace.
removeSource()delegated toinitialState(), 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 onlysource, 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."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-existingreset()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 installsgit-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 errorsnpm test— 7/7 passnpm run build— succeeds (dist produced)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.