Skip to content

fix(fx): flush pending field edits before persisting or signing - #513

Merged
kwart merged 1 commit into
masterfrom
fix/flush-pending-field-edits
Sep 23, 2026
Merged

kwart merged 1 commit into
masterfrom
fix/flush-pending-field-edits

Conversation

@kwart

@kwart kwart commented Sep 23, 2026

Copy link
Copy Markdown
Member

Follow-up to #512, which fixed the proxy port only for paths that move focus out of the field.

  • Menu accelerators (Shortcut+S, Shortcut+T) fire without changing the scene focus owner, and WINDOW_CLOSE_REQUEST runs before the stage hides, so onSign()/onTimestamp()/storeAndCleanup() still saw the last committed port. One flushUiToViewModel() now commits the proxy port and font size fields (plus the placement rectangle) ahead of every syncToOptions().
  • File -> Exit called saveViewStateToConfig() and stage.close(); close() does not fire WINDOW_CLOSE_REQUEST, so Ctrl+Q dropped all signing options. It calls storeAndCleanup() now.
  • Proxy port out of 1..65535 and non-positive or non-finite font sizes are rejected the same way a non-numeric entry is; both fields trim whitespace, so a pasted " 3128 " commits.
  • The proxy port field is seeded from the view model instead of text="80" in TsaSettings.fxml.

Tests: new TsaSettingsControllerTest, one more case in SignatureSettingsControllerTest. mvn -pl jsignpdf -am test green (439).

- Commit the proxy port and font size fields from one flushUiToViewModel()
  before every syncToOptions(): menu accelerators (Ctrl+S, Ctrl+T) and the
  window close request never fire focus loss, so #512 left those paths stale
- File -> Exit persists the signing options, not only the view state
- Reject out-of-range proxy ports and non-positive font sizes, trim whitespace
- Seed the proxy port field from the view model, not from a literal in the FXML
@kwart
kwart merged commit f096e4e into master Sep 23, 2026
2 checks passed
@kwart
kwart deleted the fix/flush-pending-field-edits branch September 23, 2026 20:21
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