Skip to content

Commit de832d8

Browse files
duranbdandelany
authored andcommitted
Fixes sequence output editor not applying appropriate linting (#1898)
* fix(sequencing): refresh editor output when extension changes This ensures the editor output view correctly refreshes when its configuration changes. * refactor(sequencing): simplify output editor extension handling and reconfiguration - Remove previousOutputEditorExtension tracking and safeStringify comparison - Add explicit empty array fallback when no output extension is available - Move output format initialization before extension computation for proper dependency order - Replace complex conditional logic with simpler reactive statement for output editor updates - Add dedicated reactive block to reconfigure output editor when adaptation extensions change --------- Co-authored-by: Dan Delany <dan.delany@gmail.com>
1 parent 7e4bb86 commit de832d8

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

src/components/sequencing/SequenceEditor.svelte

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,14 @@
9797
inputEditorExtension = sequenceAdaptation.input.getEditorExtension(phoenixContext, phoenixResources);
9898
}
9999
100+
$: if (sequenceAdaptation.outputs.length > 0) {
101+
selectedOutputFormat = sequenceAdaptation.outputs[0];
102+
}
103+
100104
$: if (phoenixContext && selectedOutputFormat?.getEditorExtension) {
101105
outputEditorExtension = selectedOutputFormat.getEditorExtension(phoenixContext, phoenixResources);
106+
} else {
107+
outputEditorExtension = [];
102108
}
103109
104110
// insert sequence - use sequenceFilePath as dependency to ensure editor updates when switching files
@@ -154,10 +160,6 @@
154160
editorHeights = '1fr 3px';
155161
}
156162
157-
$: if (sequenceAdaptation.outputs.length > 0) {
158-
selectedOutputFormat = sequenceAdaptation.outputs[0];
159-
}
160-
161163
$: if (showOutputs && previousShowOutputs !== showOutputs && editorOutputDiv) {
162164
if (editorOutputView) {
163165
editorOutputView.destroy();
@@ -194,6 +196,15 @@
194196
debouncedOutputUpdate(editorSequenceView?.state.doc.toString() ?? '');
195197
}
196198
}
199+
$: {
200+
// Reconfigure output editor when adaptation extensions change
201+
if (editorOutputView) {
202+
editorOutputView.dispatch({
203+
effects: [compartmentOutputAdaptation.reconfigure(outputEditorExtension)],
204+
});
205+
debouncedOutputUpdate(editorSequenceView?.state.doc.toString() ?? '');
206+
}
207+
}
197208
198209
function sequenceUpdateListener(viewUpdate: ViewUpdate): void {
199210
const sequence = viewUpdate.state.doc.toString();

0 commit comments

Comments
 (0)