Skip to content

feat: every column a style declares, in the editor - #110

Merged
xAlcahest merged 1 commit into
mainfrom
style-columns
Sep 7, 2026
Merged

feat: every column a style declares, in the editor#110
xAlcahest merged 1 commit into
mainfrom
style-columns

Conversation

@xAlcahest

Copy link
Copy Markdown
Owner

Summary

The style editor now holds every column a style declares, not the ten the parser happened to read. StyleFormat reads all twenty-three by name, AssStyle records where each sits, and the dialog draws them in the groups the reference's own dialog uses: font, colours, margins, outline, alignment, miscellaneous.

Two of them are not text boxes, because they are not text. The alignment is the grid: nine buttons, and ASS counts from the bottom left, so the top row is 7, 8, 9 and the number a place writes is not its position on screen. The opaque box is drawn as what it is, a border style writing 3 or 1, rather than as a fifth flag beside bold and italic.

Two names are worth stating because the format reuses them. Outline is the border's width and Shadow is the shadow's depth; OutlineColour and BackColour are the colours the dialog labels Outline colour and Shadow colour. They are different columns and the record keeps them apart as outline_width and shadow against outline and back.

The harness needed one change: the panel is taller than the window now and scrolls inside itself, so a control further down had a rectangle outside the viewport and a click at its centre landed on nothing. The spec brings the element into view before it measures.

Changes

  • crates/sublore-formats/src/ass.rs: twelve more columns read by name from the section's own Format: line.
  • crates/sublore-formats/src/document.rs: their spans on AssStyle, and ass_style_text handing back nineteen readable values instead of seven.
  • crates/sublore-edit/src/plan.rs: twelve more AssStyleField variants and the span each names.
  • src-tauri/src/subtitle/mod.rs: the same twelve on the wire and on the style the interface reads.
  • src/types/subtitle.ts: the field names and the values.
  • src/components/StyleEditor.tsx: the six groups, the alignment grid and the opaque box.
  • src/i18n/en.ts and src/styles/chrome.css: the group headings, the field words, and the panel that scrolls when it outgrows the window.
  • e2e/specs/style-editor.spec.js: the alignment moved on the grid, written as the number ASS uses, with every event line still byte-identical; and the click helper that scrolls before it measures.
  • e2e/wdio.conf.js: the count the guard holds.
  • BACKLOG.md: N42 closed.

How to verify it by using the app

  1. Open fixtures/subtitles/ass/clean/basic.ass and click Edit beside the Style dropdown.
  2. The panel now has six groups. Font holds the family, the size and the four flags. Colours holds four. Margins holds three. Outline holds the border's width, the shadow's depth and an Opaque box tick. Alignment is a grid of nine. Miscellaneous holds the two scales, the rotation, the spacing and the encoding.
  3. The grid's marked square is the one the file names: this fixture says 2, which is bottom centre.
  4. Click the top left square. Close the panel and press Ctrl+S.
  5. Open the saved file: the alignment column is now 7, and every Dialogue: line is exactly the bytes it was.
  6. Tick Opaque box and save again: the border style column is 3, not -1, because it is not a flag.
  7. Open a subtitle whose styles section declares fewer columns. The fields it has no column for are drawn and greyed, not hidden.

Verified on Linux: full gate green step by step, and the battery green at 36 spec files of 36 with 296 checks. One mutation, the alignment column read at the encoding's index, reddened the grid check first.

@xAlcahest
xAlcahest merged commit ebd6524 into main Sep 7, 2026
14 checks passed
@xAlcahest
xAlcahest deleted the style-columns branch September 7, 2026 00:39
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.

1 participant