Skip to content

refactor(frontend): enhance settings page#114

Merged
zowks merged 1 commit into
mainfrom
refactor/frontend/settings
Jul 12, 2026
Merged

refactor(frontend): enhance settings page#114
zowks merged 1 commit into
mainfrom
refactor/frontend/settings

Conversation

@zowks

@zowks zowks commented Jul 11, 2026

Copy link
Copy Markdown
Member

This pull request improves the user experience and error handling for the settings page, specifically in the deployment and bot token forms. The main changes include adding enhanced form submission with user feedback via toasts, better error boundaries, and improved default value handling for form fields.

User experience improvements:

  • Enhanced both the deployment config and bot token forms with the .enhance() method to provide real-time feedback using toasts for loading, success, and error states during submission (toaster.promise).
  • Disabled the save buttons while a submission is pending to prevent duplicate submissions.

Error handling:

  • Wrapped the deployment config form in a Svelte error boundary and rendered a BoundaryFailed component on failure, improving error visibility for users.

Default value and state handling:

  • Refactored how default values for form fields are set, now using values fetched from getBot() directly in the form, ensuring fields are always initialized with the latest data.

UI consistency:

  • Updated the page layout to include an application bar with breadcrumbs for better navigation context.
  • Minor formatting adjustments for main container classes for improved visual consistency.

Checklist

  • My code follows the project's coding style
  • Tests pass locally
  • I added/updated relevant tests
  • I updated documentation (if needed)
  • This PR is ready for review

@zowks zowks self-assigned this Jul 11, 2026
@zowks zowks added enhancement New feature or request frontend labels Jul 11, 2026

@a9ex a9ex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Depends on unmerged branch. Imports $lib/components/BoundaryFailed.svelte, which is added on refactor/frontend/clusters — won't build until that lands. Merge order: clusters → this. Findings below are independent of that.

The refactor itself is a nice improvement over main (proper <svelte:boundary> error fallback, .as() field defaults instead of imperative .set(), promise-tracking toasts). The page manages Docker image config (URL + registry auth) and bot token rotation via PATCH /bot. No delete action here.

Major

  • Saving the image or the token restarts the entire fleet, with no confirmation. In bot.service.ts update(), shouldForceRestart = layoutChanged || tokenChanged || dockerImageChanged; when true it removes and re-creates/starts every cluster. This page exposes image + token as plain inline "save" buttons — a stray click mid-demo tears down and restarts all clusters. Please add a confirmation step (or explanatory copy) before submitting these, and guard against double-submit at the handler level.

Minor

  • The registry username/password inputs are required, but the backend treats them as optional and never returns the password in GetBotDto. For an existing bot using auth, the empty password field blocks an image-only update unless the user re-types it. (Carried over from main, but worth fixing here.)
  • Double-submit guard is soft (disabled={!!pending} only on the button; Enter in the field can still submit). Prefer pending > 0 and an early-return in the submit callback.
  • After a successful image save, element.reset() reverts the inputs but not the authentication toggle ($state, not a form control). Cosmetic.

Verified fine

  • PATCH /bot payloads ({ dockerImage } / { token }) match UpdateBotSchema; 202/401/404 handling correct; UI updates after mutation via getBot().set(await response.json()) (no refetch needed).
  • {const}/{let} template declaration tags and in-template await are valid (svelte 5.56 + experimental.async).

Verdict: draft, blocked on clusters for the missing component. Once rebased, the main thing to address is a confirmation step before the image/token save (Major) given it restarts all clusters.

@zowks
zowks force-pushed the refactor/frontend/settings branch from bd9fd8c to 0d55618 Compare July 12, 2026 13:34
@zowks
zowks marked this pull request as ready for review July 12, 2026 13:42
@zowks
zowks enabled auto-merge (squash) July 12, 2026 13:42
@zowks
zowks requested a review from a9ex July 12, 2026 13:43
@zowks
zowks merged commit fb22d15 into main Jul 12, 2026
5 checks passed
@zowks
zowks deleted the refactor/frontend/settings branch July 12, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants