Skip to content

improve: fetch-template - #17569

Open
alperozturk96 wants to merge 5 commits into
masterfrom
refactor/fetch-template
Open

improve: fetch-template#17569
alperozturk96 wants to merge 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
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 04a5377 to b3c6bf8 Compare September 7, 2026 09:58
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3535
Correctness5858
Dodgy code195195
Experimental11
Malicious code vulnerability22
Multithreaded correctness2626
Performance3737
Security1918
Total373372

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

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.

1 participant