fix(console): keep graph editor in sync with route identity - #45
Merged
Conversation
…clarable `loadDocument` reset `error`, `conflict`, `warnings` and `migration` on an identity change but never `text`, and `loading` drops to false in the `finally` whichever way the load ended. So a failed GET left the editor showing B's title, B's Cancel link, an error card — and A's JSON in an enabled textarea. That is not a display bug. `as_graph` sets `doc.graph` from the path segment, so the server does not refuse the mismatch: one Declare click replaces B's nodes, paths and budgets with A's. Reached by moving back and forward between two `/edit` URLs while the second load fails, which is the same route record and therefore the reuse this change exists to handle. - clear `text` with the rest of the load state - hold Declare disabled while a load error stands, tracked separately from `error` so a refused SAVE still leaves the button available to retry Claude-Session: https://claude.ai/code/session_012K8u7BEJyd6nDNMCQAgH3z
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.
Perché
Vue Router riusa l’istanza di
GraphEditquando cambia soltanto:appo:name. Il componente caricava il documento esclusivamente inonMounted, quindi una navigazione tra due URL di edit poteva lasciare nel textarea il JSON del grafo precedente. Salvare a quel punto inviava quel documento all’identità mostrata nel nuovo URL. Inoltre una risposta lenta del primo grafo poteva arrivare dopo quella del secondo e sovrascriverla.Fix
(app, name)con esecuzione immediata, invece di affidarsi al solo mount;/graphs/new.Verifica
npm run build(Vite, 52 moduli);git diff --check.Il repository attuale non definisce uno script
npm test; la PR #19 ne introduce uno per l’infrastruttura di polling, ma non contiene un harness per componenti Vue.Nota per Alice
Il comportamento normale del primo caricamento non cambia. Il punto da valutare è la protezione dell’identità: una risposta viene applicata solo se appartiene ancora alla stessa coppia app/grafo richiesta dalla route.