Skip to content

improve: fetch-template - #17569

Merged
alperozturk96 merged 5 commits into
masterfrom
refactor/fetch-template
Sep 15, 2026
Merged

alperozturk96 merged 5 commits into
masterfrom
refactor/fetch-template

Conversation

@alperozturk96

@alperozturk96 alperozturk96 commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Uses TemplateFilenameState instead of booleans
  • hasUserInteracted guard helps to prevent error shown before the user types
  • Empty template list now dismisses the dialog with "Error retrieving templates" instead of leaving an unusable dialog open
  • Converts FetchTemplateOperation to Kotlin

@alperozturk96 alperozturk96 changed the title refactor: fetch-template improve: fetch-template Sep 7, 2026
@alperozturk96
alperozturk96 force-pushed the refactor/fetch-template branch from 04a5377 to b3c6bf8 Compare September 7, 2026 09:58
@alperozturk96 alperozturk96 added this to the Nextcloud App 35.0.1 milestone Sep 10, 2026
@alperozturk96

Copy link
Copy Markdown
Collaborator Author

/backport to stable-35.0.x

@daniele-verducci daniele-verducci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I noted the interaction on the creator popup was a little rough, very nice improvement! Thx!

@alperozturk96
alperozturk96 force-pushed the refactor/fetch-template branch from 0442a1e to 669a498 Compare September 14, 2026 17:26
@github-actions

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 70 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../android/ui/dialog/ChooseTemplateDialogFragment.kt 0.00% 34 Missing ⚠️
...m/owncloud/android/files/FetchTemplateOperation.kt 0.00% 29 Missing ⚠️
...wncloud/android/ui/dialog/TemplateFilenameState.kt 0.00% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
The redundant elvis on fileNames belongs to neither the crash fix nor the
Kotlin conversion, so it goes back to its previous form to keep this branch
scoped to one concern.

Assisted-by: ClaudeCode:claude-opus-5
When the template list comes back empty the dialog had no selected template,
so the extension check compared the typed name against null and reported
"Extension cannot be changed" for every name while Create stayed disabled.

Resolve the filename into a single state, treat "no template selected" as its
own state, hold the error back until the user has typed, and close the dialog
when no template could be loaded.

Assisted-by: ClaudeCode:claude-opus-5
Fail-fast control flow, JSON node names as constants, and URL building and
response parsing split into separate functions. Behaviour is unchanged.

Assisted-by: ClaudeCode:claude-opus-5
@alperozturk96
alperozturk96 force-pushed the refactor/fetch-template branch from 669a498 to f290682 Compare September 15, 2026 11:19
@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3232
Correctness5858
Dodgy code186186
Experimental11
Malicious code vulnerability22
Multithreaded correctness2626
Performance3737
Security1918
Total361360

@github-actions

Copy link
Copy Markdown

📱 QA build

Download app-qa-debug.apk (512)
QR code Open the QR code for this download
Commit f290682
Version 17569
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@alperozturk96
alperozturk96 merged commit 3115d0b into master Sep 15, 2026
25 checks passed
@alperozturk96
alperozturk96 deleted the refactor/fetch-template branch September 15, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants