Repository navigation
Conversation
#131) Select text and press Ctrl+Shift+H, or use the Highlight button in the toolbar, to highlight it; do it again to take the highlight off. A note to self made while reviewing against the recording -- it never changes the text. - Anchored to whole words (SRTCaption.highlighted_words), kept apart from the "my edits" marks. carry_highlights() moves them with the words through typing, split, merge, delete across captions, word moves and Find & Replace; a word typed between two highlighted words joins the highlight, any other new word does not earn one. - Saved with the transcription ("highlighted" next to "edited"). Transcriptions only for now: a set of subtitles is plain SRT and has nowhere to keep them. - Drawn yellow with a line above and below so colour is not the only cue (1.4.1, 1.4.11), role="mark", distinguishable from flagged words, my edits and the word being played, in both themes. - RTF export can carry highlights and changed words; the options are unchecked by default and only shown when there is something to carry (a clean export is unchanged). - Shortcuts dialog gets a "Highlighting" group for transcriptions. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
The plain Material Icons "highlight" is a torch. The marker pen is in Material Symbols Outlined, which ships with NiceGUI (checked: the ligature is in the bundled font). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…mments in RTF (#131) A comment is a note on a stretch of words with a text of its own. It never changes the text, follows its words through every edit by the same rules as a highlight, and is saved with the transcription as "comments" per segment. - One comment per word and one caption per comment; a selection across paragraphs is refused, and asking to comment on commented words opens the existing comment. - Ctrl+Shift+K or the toolbar's Comment button opens a small box beside the words; a click on commented words shows it without taking focus. Save, Cancel, Remove, Ctrl/Cmd+Enter, Escape; what is typed is kept when the reader moves on. Keys typed in the box stay in it. - Drawn with a dotted underline that takes no room, in both themes. - RTF export can carry them as Word comments (off by default, hidden when there are none). - Transcriptions only, like highlights. Builds on the highlights branch. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…ords (#131) The popover is gone. A comment is now written, read and changed in a card in the right column, built like the validation panel: one comment at a time, shut until needed, with Previous/Next and Close, and in the colour of the underline on the commented words (magenta, because blue is the progress tint). The card follows the caret: put the caret in commented words, or click them, and it shows that comment. An open card follows; a shut one opens only for a click. What is typed is kept when the reader moves on, and abandoned only by Escape or Cancel. The underline is now a dotted 3px line 4px below the text, because a thinner one closer in was lost against the highlight's frame lines on words that are both highlighted and commented. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…131) A transcription does not show a caption's number, so "Paragraph N" on the card was something nobody could use. The card now says who is speaking and when the caption starts, as the editor shows them beside the text. And the text shows which comment the card is on, so Previous and Next can be followed: the caption gets a rule and an outline in the comment colour, as the validation panel marks its caption, and the words of the comment get a tint laid over whatever else they are, so a highlight still shows through. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…G 1.3.1, 4.1.2) Two things the card showed wrong, found testing comments in the test environment: - A comment's card says who is speaking and when. A renamed speaker did not change it, because sync() left a card that was "still right" untouched. It is now drawn again (without scrolling or touching the text box, so what is being typed is kept). - Deleting the words a comment hangs on, while its card was open, left the card there until the caret moved. set_text() does not render the block being typed into, so no refresh() and no sync() followed. It now calls sync(), and find_again() finds a comment whose words moved with an edit (a word typed into the middle of them, a word deleted before them) by its text and the words it still shares, since an edit builds new WordComment objects. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
Moving the first word to the previous block or the last word to the next one left a comment behind and dropped it altogether when it was on that word alone. A comment is on a word, so it now goes where the word goes: one on the moved word alone moves with it, and one on that word and others is on both blocks (a copy with the same text), as when a block is split. The two helpers that took the word out of a comment are no longer used and are removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
Both are flat Quasar buttons, which take the primary blue (#5898d4) for their text: 3.06:1 on the card's white, under the 4.5:1 that 14px text needs (WCAG 1.4.3). In light mode they now take the brand colour (#082954, 14.4:1), measured on the test environment. Dark mode is unchanged: the global flat-button rule already draws them white. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…nts-on-words Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…-words AGENTS.md: kept both the panel line from comments-follow-the-text and the Remove/Cancel contrast line. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
…s-on-words Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
A per-user preference beside My edits (transcriptions only, default on). Hidden comments are not drawn and not read out, and the comments card is put away, but every comment stays on its words and follows the text through every edit. The comment command, while they are hidden, turns the display on and opens the comment as usual, and says so in a toast. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
Hiding comments is a way of looking at the text for a while, not a preference, and a hidden comment forgotten for days is worse than switching them off again. Every editor now opens with them shown. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
The comment said the editor does not know the reader's name. It does (the username is in the token); the author is "Scribe" so that no personal identifier ends up in exported files. Comment and AGENTS.md only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW (cherry picked from commit 780d78fede6cd6e454e6080fe84f3a49ab8be347)
Collaborator
Author
|
Closing this PR: all of its commits are already in develop, so it will reach main with the develop → main release PR. No changes are lost, and the branch is kept. |
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.
Comments on words in the transcript editor
Refs #131 (the comment half; the highlight half is in its own PR, and this one builds on it)
Select words and press Ctrl + Shift + K, or use the Comment button in the toolbar, to write a note on them. The note is for the reader: it never changes the text. Words that have a note are underlined with a dotted magenta line. The note is written, read and changed in a card in the right column under the video, built like the Validate card, and the card follows the caret: put the caret in (or click) commented words and it shows that comment.
Transcriptions only, for now, for the same reason as highlights: a set of subtitles is saved as plain SRT, which has nowhere to keep a note. In the subtitle editor the key is not bound, there is no card, the shortcuts dialog does not list it and the export option is not offered.
Behaviour
carry_highlights, reused so the two cannot drift apart): through typing, split, merge, deleting across paragraphs, Find & Replace. A word corrected inside a commented stretch stays in it; a word typed between two commented words joins it; any other new word does not. When all of a comment's words are gone, the comment goes with them (the card hides if it was showing it), and Undo brings both back. Differences from highlights: a split across a comment keeps it on both halves (each with the same text, as separate notes); a merge keeps neighbouring comments as separate notes; the one-word moves (Ctrl/⌘ + ↑/↓) take the word out of the comment, which stays behind with the rest of its words."comments": [{"words": [...], "text": "..."}]per segment, only when there are any. Read back on open; anything unusable in the file is skipped (junk shapes, empty text, non-integer, boolean, negative or out-of-range positions, a word already taken by an earlier comment), and a text over 1000 characters is cut. Files saved before this open exactly as before. The text is limited to 1000 characters (the text area and the server).Appearance
This does change how things look, so for review:
#a1136a; dark mode#ff9fd2). It is a pattern and not colour alone (1.4.1), and different from the solid bars under flagged and changed words. It is thick and set off from the text because on words that are both highlighted and commented a thinner line close to the text was lost against the highlight's own frame lines (rendered in Chromium, both themes, one line and wrapped, before choosing). Magenta rather than blue, because blue is already the progress/playing tint. It measures 7.5:1 on white and at least 6.3:1 on every wash a word can have (highlight, flagged, changed, playing); in dark mode 9.4:1 on the surface and at least 4.6:1 on the others (all above 3:1, 1.4.11). It is drawn withtext-decoration, so it takes no room (the text does not move), touches no box-shadow (the other markings keep theirs and show together with it), and nothing is added after the last word (a marker there would sit where the caret goes, and::afteris already used by the review/edit words).background-imageover their own background. Text keeps at least 6.7:1 on it in light mode and 5.9:1 in dark, over every wash a word can have, and the comment line at least 4.3:1 and 3.4:1; no layout change (the rule swaps padding for border like the Validate marking does).add_commenticon from Material Symbols Outlined, which ships with NiceGUI), quiet like the others, beside Highlight, so transcriptions only. Tooltip naming the key,aria-keyshortcuts, and a mouse press on it does not take focus (so the selection it acts on is not lost). One new tab stop in the toolbar; the tab order inside the text is unchanged.aria-description="Comment: …"on the first word of the comment (not a role:markis already taken by highlights, andcommentis not in ARIA 1.2). The card's heading is focusable and a visually hidden live label says which comment is showing.Implementation
utils/caption.py:WordComment(words, text),SRTCaption.comments(copied deeply for undo, saved).utils/srt_comments.py(new):CommentsMixinwithcarry_comments,split_comments,join_comments,drop_word_from_comments,shift_comments,comment_target,set_comment,remove_comment,restore_comments,word_range.utils/comments_panel.py(new):CommentsPanel, built likeValidationPanel:open_for,open_first,follow,commit,save,remove,cancel,close,go_next/go_previous,go_to_words,sync.utils/srt_review.py:carry_markscarries comments too (so typing, split with unsent text and Replace all follow);review_runsgives wordscm/cf/ct/cl.utils/srt.py: restore inparse_txt, and the sites that carry marks (split, merges,delete_range, one-word moves).utils/srt_export.py:export_rtf(..., comments=False),rtf_comments_available(),rtf_date(),comment_ranges(), the checkbox.utils/transcript_editor.js: the key (Ctrl only, byevent.code, ahead of the block-scoped lists),commentSelection,reportCommentCaret(once per comment, from the caret update and from click),runClass, run attributes,isCommentOnShow(thedata-comment-currentattribute).utils/transcript_editor.py:open_comment,caret_comment,comment_selection,comments_panel,mark_commentand the propscommentId/commentIndex;refresh()ends by syncing the card.pages/srt.py: the button and the card in the right column;utils/srt_render.py: dialog group;utils/styles.py: the underline and the card's tone in both themes;AGENTS.md: a "Comments" section.Notes
tests/test_transcript_editor.pygets the new group.How it was checked, and what was not
Logic, saving, RTF text and the component source are covered by tests. The card's behaviour (write, Save, Remove, Esc, Ctrl+Enter, ⌘+Enter, Close, Previous/Next, following the caret,
syncafter edits and undo) was driven with NiceGUI's ownUsersimulation. The component's caret reporting and the key (including that Alt, ⌘, plain Ctrl and subtitles leave it alone) were driven against the real component in jsdom. The underline and the "you are here" marking were rendered in Chromium on every wash and in both themes; the marking's props and attributes were driven in jsdom against the real component. The RTF was converted with LibreOffice and opened in Word (two comments by "Scribe" with the right ranges).Not yet verified: the card in a real browser end to end (focus moving in and out of the text area, the caret following with a real selection), whether Ctrl + Shift + K is free in the reader's browser, the tab order (the card comes after the video in the page; no skip link was added), and whether a screen reader speaks
aria-descriptionand the live label sensibly.Tests
tests/test_comments.py(the model, saving and reopening including junk, targeting, adding/changing/removing, following every kind of edit, drawing, RTF and when it is offered, the card, the handlers and bad input, the button, the component source, the styles including the contrast of the line on every wash). Full suite: 1338 passed, 3 failed: the 3 pre-existing failures on main (TestAddingACaptionForSpeech).