Skip to content

Improve state change tracking in Meditor #2485

@jjnesbitt

Description

@jjnesbitt

Currently, in order to track changes in the meditor, we use the key of the "transaction number":

<v-jsf
:key="`
basicModel-${editorInterface.transactionTracker.getTransactionPointer()}
`"

However, this usage sort of masks an underlying problem, which is that state change in EditorInterface and MeditorTransactionTracker isn't handled in a very reactive way. For example, updating the basic model is done here:

setBasicModel(newModel: DandiModel) {
Object.entries(newModel).forEach(([key, value]) => {
this.basicModel.value[key] = value;
});
}

Even though basicModel is a ref that could propagate reactive change. When attempting to simply make that change locally, other things break. I think EditorInterface and TransactionTracker need to be refactored altogether, potentially making use of pinia.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientPertains to the web clientclient/meditorIssues with the metadata editor (meditor)refactorCode refactoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions