Add Output Language Handling to Sequence Editor#1931
Conversation
AaronPlave
left a comment
There was a problem hiding this comment.
Just a few small comments but otherwise tested and didn't see any issues.
|
Can we add some more context to the description of this? Specifically, there is not a very clear distinction between what parts are refactoring vs. what user-facing behavior actually changed. For the parts where behavior changed I want to know - was this a bug? If so, what was the specific buggy behavior that we saw and the expected behavior in that case? A lot of what is described in parts 2 and 3 above sound like what I expected the behavior to be all along, so what was it doing if not that? Behavior changes should be the "headline" rather than mingled with the implementation details |
You mean instead of:
You just want
|
|
Thanks, the additional context helps.
For PRs with issues, we link to the issue at the top. It's fine to have ad-hoc PRs with no issue, but if they're making actual functional changes, we should think of what the issue(s) would contain and start with a short version of that. Think: how would a smart user report this problem[s] and propose this behavioral change (with knowledge of their own adaptation & our UI, but not our code). That's the perspective I'm generally reviewing from first. All of the implementation & architecture details you have are good to include, but lower. Readers shouldn't need a dev-level understanding of our internals to understand what the problems are, under what conditions, & how the changes affect/fix it |
I think I understand. So you mean that PRs should be for users first and devs second? |
They're mainly for us - for reviewers, and recording our work for future devs to understand what we did. Reviews are just a lot harder, and records are less useful, without a description of the existing vs. expected behavior. My suggestion above is just a way to take your writing out of the perspective of someone who already knows all the subtleties and details & into the shoes of someone without context who is reading the description fresh. |
- Extract output format dropdown and action buttons from EditorToolbar into new OutputToolbar component - Remove output format props and dropdown menu from EditorToolbar (outputFormats, outputDisabled, onCopyOutput, onDownloadOutput) - Add OutputToolbar component with output format selection, copy, download, and preview toggle buttons - Update SequenceEditor to use OutputToolbar in the output panel header - Simplify downloadOutput
- Add `isInputFile` prop to SequenceEditor to determine if the current file matches the adaptation's input extension - Apply input editor extensions only when editing an input file; otherwise, find and use the matching output format's extensions - Show output panel only when editing an input file with available output formats - Compute `activeFileIsInputSequence` in workspace page to distinguish input files from output files - Update right
… extensions to .seqN.txt
…wrap activeFileIsInputSequence in reactive block
11de790 to
4c6f04c
Compare
|
@dandelany Took another stab at updating the PR description. Let me know if it needs more tweaks! |

Summary
This PR improves the sequence editor's handling of input vs. output files and adds missing TypeScript type declarations for reactive variables in Svelte components.
Changes
1. Refactor Output Format Controls (816c2ec)
This refactor was spurned from the discovery of the bug that the output copy/download dropdown button currently ignores the language selected in terms of the content. What is happening is, rather than running the input sequence through the adaptation's converter function, we're actually using the content of the output preview editor. This means that the content being copied/downloaded is not controlled by the dropdown button, but rather it is indirectly controlled by the dropdown of the output preview panel. This was never noticed until now because, so far, all the use cases for adaptations involve a single output language. This refactor is to both improve UX for copying/downloading output sequences and to fix the aforementioned bug.
2. Conditional Output Panel Display (91e6a5d)
3. Initial Differentiation between Input and Output Files (2115e8c)
Testing
seqJsonLinter()in the testsequence-adaption.jsfile)