Skip to content

Clear stale SeqJSON output when switching workspace files#1889

Merged
dandelany merged 2 commits into
developfrom
fix/workspace-fixes-4-1-0
Mar 4, 2026
Merged

Clear stale SeqJSON output when switching workspace files#1889
dandelany merged 2 commits into
developfrom
fix/workspace-fixes-4-1-0

Conversation

@AaronPlave
Copy link
Copy Markdown
Contributor

@AaronPlave AaronPlave commented Feb 27, 2026

When switching between sequence files, the SeqJSON output panel would retain the previous file's content. This happened because the debounced output update was cancelled without scheduling a replacement, and when opening a new blank file the output was never recomputed. This PR also resolves an issue where sequence output format was not being computed and shown for untitled files on page load.

Fixes:

  • Clear the output editor and schedule a new computation on file switch
  • Reset selectedSequenceOutput when navigating so blank/new sequence files don't inherit stale output from the previous file

Closes #1888

@AaronPlave AaronPlave requested a review from a team as a code owner February 27, 2026 23:26
@AaronPlave AaronPlave changed the title clear stale SeqJSON output when switching workspace files Clear stale SeqJSON output when switching workspace files Feb 27, 2026
@AaronPlave AaronPlave requested review from dandelany and removed request for joswig and mattdailis February 27, 2026 23:29
@AaronPlave AaronPlave self-assigned this Feb 27, 2026
@duranb
Copy link
Copy Markdown
Collaborator

duranb commented Feb 27, 2026

Potentially related to this is if you load the workspace without having file selected, updating the Untitled sequence also doesn't update the output even if a valid sequence input is provided until the untitled file is saved. Is this a use case we want supported? I know the filename is used directly as the id field of seqJSON, so I'm not sure having Untitled as the id or having no id is a misrepresentation of "valid" seqJSON.

Copy link
Copy Markdown
Collaborator

@duranb duranb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of whether we address my comment regarding the "Untitled" file's output, I think the work done here at least fixes the issues stated. 👍🏻

On initial page load with no file selected, the SeqJSON output pane was empty because no output computation was triggered on mount. Also, typing in an untitled sequence cleared the output because Svelte 4 bypasses prop defaults on reactive updates (has bitten us before). Passing undefined from the parent set sequenceName to undefined instead of the default ''.
@AaronPlave
Copy link
Copy Markdown
Contributor Author

Potentially related to this is if you load the workspace without having file selected, updating the Untitled sequence also doesn't update the output even if a valid sequence input is provided until the untitled file is saved. Is this a use case we want supported? I know the filename is used directly as the id field of seqJSON, so I'm not sure having Untitled as the id or having no id is a misrepresentation of "valid" seqJSON.

Had it in my head that I had fixed this already, pushed a fix. Can you give it another spin when you get a chance?

@duranb
Copy link
Copy Markdown
Collaborator

duranb commented Feb 28, 2026

Potentially related to this is if you load the workspace without having file selected, updating the Untitled sequence also doesn't update the output even if a valid sequence input is provided until the untitled file is saved. Is this a use case we want supported? I know the filename is used directly as the id field of seqJSON, so I'm not sure having Untitled as the id or having no id is a misrepresentation of "valid" seqJSON.

Had it in my head that I had fixed this already, pushed a fix. Can you give it another spin when you get a chance?

Tested! Works great! 👍🏻

Copy link
Copy Markdown
Collaborator

@dandelany dandelany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks! merging.

@dandelany dandelany merged commit 3cbc6ed into develop Mar 4, 2026
7 checks passed
@dandelany dandelany deleted the fix/workspace-fixes-4-1-0 branch March 4, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SeqDev issues with SeqN -> SeqJSON conversion of new files

3 participants