feat: read a second document beside the one being translated - #102
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first slice of M2.6: the document a translator reads from is opened beside the one being written, and the grid draws it as one more column, aligned row for row.
SubtitleStatenow holds two sessions rather than one, and they are two slots and not one with a flag on purpose: no edit can reach the source by taking a wrong branch, because every mutating command asks forslot()and nothing anywhere asks forsource_slot()and then writes. The source is never edited, never saved and never backed up, so it has no dirty state to guard.The two items that need it, Open source subtitle and Close source subtitle, are drawn on File whether or not they can run, and greyed by the same rule everything else greys by. A source is read beside a target, so the open greys until a target is open; the close greys until a source is.
A defect in the E2E suite is filed here rather than fixed, because fixing it means guessing. One check in
video-aspect.spec.jsfails on the CI runner and never on this machine, and it has done so since before this branch: the evidence it already collects rules out a logged refusal and a video error event, and what is left has not been proven. It is BACKLOG N40, and the first change is the one in this PR: the check now records which line of the status bar spoke, so the next failure names its cause instead of leaving it to be worked out from the sentence.Changes
SubtitleStateholds a second session, withsubtitle_open_sourceandsubtitle_close_sourceover the sameopen_sessionandclose_sessionthe target uses.How to verify it by using the app
fixtures/subtitles/srt/clean/basic-lf.srt. The grid shows three lines and no Source column.fixtures/subtitles/srt/clean/starts-at-zero-short.srt. A Source column appears at the right of the grid: row 1 says "Bring the nets in.", row 2 says the gulls line, and row 3 is blank, because that file has only two lines.Source: SRT · 2 cues · LFbeside what it says about the target.fixtures/subtitles/srt/malformed/missing-arrow.srt. The status bar says why it could not be read, and no column is left behind half filled.Verified on Linux: full gate green step by step, and the battery green at 34 spec files of 34 with 283 checks. Two mutations each reddened its own check first, the column reading the target instead of the source, and a close that leaves the rows behind.