Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/components/sequencing/SequenceEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@
inputEditorExtension = sequenceAdaptation.input.getEditorExtension(phoenixContext, phoenixResources);
}

$: if (sequenceAdaptation.outputs.length > 0) {
selectedOutputFormat = sequenceAdaptation.outputs[0];
}

$: if (phoenixContext && selectedOutputFormat?.getEditorExtension) {
outputEditorExtension = selectedOutputFormat.getEditorExtension(phoenixContext, phoenixResources);
} else {
outputEditorExtension = [];
}

// insert sequence - use sequenceFilePath as dependency to ensure editor updates when switching files
Expand Down Expand Up @@ -154,10 +160,6 @@
editorHeights = '1fr 3px';
}

$: if (sequenceAdaptation.outputs.length > 0) {
selectedOutputFormat = sequenceAdaptation.outputs[0];
}

$: if (showOutputs && previousShowOutputs !== showOutputs && editorOutputDiv) {
if (editorOutputView) {
editorOutputView.destroy();
Expand Down Expand Up @@ -194,6 +196,15 @@
debouncedOutputUpdate(editorSequenceView?.state.doc.toString() ?? '');
}
}
$: {
// Reconfigure output editor when adaptation extensions change
if (editorOutputView) {
editorOutputView.dispatch({
effects: [compartmentOutputAdaptation.reconfigure(outputEditorExtension)],
});
debouncedOutputUpdate(editorSequenceView?.state.doc.toString() ?? '');
}
}

function sequenceUpdateListener(viewUpdate: ViewUpdate): void {
const sequence = viewUpdate.state.doc.toString();
Expand Down
Loading