On Thu, 5 Mar 2026 18:02:50 GMT, Dmitry Markov <[email protected]> wrote:

> In `MacCommonDialogs__showFileSaveChooser`, we pre-populate the Save dialog 
> name field using: `setNameFieldStringValue`.
> After that `DialogDispatcher applyExtensions(...)` is invoked. 
> applyExtensions builds the extension filters, selects the default filter and 
> immediately calls `extensionFilterChanged`. That callback reconfigures the 
> `NSSavePanel` allowed types for the selected filter. If the initial filename 
> already contains an extension (e.g. _file.rich_) and the selected filter also 
> enforces that extension (_rich_), the panel effectively appends the extension 
> again resulting in the UI showing _file.rich.rich_. This is especially 
> visible for non-standard extensions like ._rich_.The ._txt_ often appears 
> “normal” because macOS handles known extensions and “hide extension” 
> presentation.
> 
> Fix:
> Always pre-fill the name field with a base name only (no extension) and let 
> the panel/filter selection supply the extension

with the new monkey tester, the behavior appears incorrect.

to reproduce:
- initial file name = "aa.txt"
- select all extensions under Extension filter
- selected filter: *.txt
- press [Show Save] button

the dialog appears with "aa" file name (instead of aa.txt with "aa" portion 
selected as before).  click Save and the stdout shows "aa" filename instead of 
"aa.txt"

I could be doing something wrong with the original reproducer code, or in the 
monkey tester.

Note: same scenario in the master shows the dialog I've never seen before:

<img width="732" height="530" alt="Image" 
src="https://github.com/user-attachments/assets/889f7d7a-06b8-473a-b6b1-ed6316df6532";
 />

-------------

Changes requested by angorya (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/2096#pullrequestreview-3900340331

Reply via email to