Skip to content

fix(settings): Improve internal address dialog - #13977

Merged
kesselb merged 3 commits into
mainfrom
fix/internal-address-dialog
Oct 31, 2026
Merged

kesselb merged 3 commits into
mainfrom
fix/internal-address-dialog

Conversation

@DerDreschner

@DerDreschner DerDreschner commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

The internal address dialog has a few issues that this PR fixes:

  • The "cancel" and "ok" buttons were not translated into the local language
  • It allowed sending empty addresses or obviously incorrect values like "@"
  • It didn't remove leading or trailing whitespace
  • If the server returned 200 with data: null (which means: address already exists), the UI handled that as error and showed a "Could not add internal address" error
  • If the server returned 422 (server-side validation follows in a separate PR), there was no error message on the input field
  • It disappeared right after clicking "ok" without waiting for the server response, which is frustrating if there were any issues and you had to open the dialog again
  • Hitting enter while focusing the input field did nothing

References to: #5139
References to: #13976

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (Claude Opus 5.5)

The API answers with no data when the address is already stored or
covered by an internal domain, but the store passed that response on to
the mutation, which failed on the missing ID. The settings therefore
showed "Could not add internal address" for an address that is internal.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
The Ok button callback didn't return the promise of the request, so the
dialog closed right away without a loading state, also when the request
then failed. Returning the promise lets NcDialog show a spinner and
ignore further clicks until the request is done, and a failure keeps the
dialog open with the entered address.

While saving, Cancel, the close button and Escape are blocked, and the
text field is read-only. Ok itself stays enabled, because disabling the
focused button would drop the focus out of the dialog. Ok is disabled
while the address is empty, also after trimming spaces and a leading
"@", which would otherwise request an invalid URL. The address is sent
without those spaces, the button labels are translated, and Enter in the
text field now submits the dialog like Ok.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
When the server rejects an address as invalid with HTTP 422, the dialog
now shows the reason below the text field and moves the focus there, so
screen readers announce it, instead of showing a toast. The message
clears as soon as the address is edited, and closing the dialog resets
the field, so a rejected address doesn't come back without its error.
Other errors still show the toast.

The server doesn't validate internal addresses yet. That follows in a
separate change, which answers invalid input with HTTP 422.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
@DerDreschner DerDreschner self-assigned this Oct 30, 2026
@DerDreschner DerDreschner added bug 3. to review AI assisted This PR contains AI-assisted commits labels Oct 30, 2026
@DerDreschner DerDreschner added the skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills label Oct 30, 2026
@kesselb
kesselb merged commit 665a3f7 into main Oct 31, 2026
34 checks passed
@kesselb
kesselb deleted the fix/internal-address-dialog branch October 31, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits bug skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants