Skip to content

cloud: fix UI settings default to actually show the tab by default#2805

Merged
bghira merged 2 commits into
mainfrom
bugfix/cloud-tab-enablement
Jun 27, 2026
Merged

cloud: fix UI settings default to actually show the tab by default#2805
bghira merged 2 commits into
mainfrom
bugfix/cloud-tab-enablement

Conversation

@bghira

@bghira bghira commented Jun 27, 2026

Copy link
Copy Markdown
Owner

This pull request implements a series of improvements and fixes to the handling of the "cloud tab" feature flag and the webhook configuration in both the backend and frontend, along with new and updated tests to ensure robust behavior. The main focus is on making the cloud_tab_enabled setting more robust to missing, null, or legacy values, and on improving the management and display of webhook URLs in the UI.

Cloud tab feature flag handling:

  • The backend now consistently treats missing or None values for cloud_tab_enabled as enabled (defaulting to True), and interprets string representations like "0", "false", etc., as disabled. This ensures backward compatibility with legacy defaults and prevents accidental disabling. [1] [2] [3]
  • New and updated tests verify that the cloud tab is enabled by default, remains enabled for legacy or null values, and is properly disabled when explicitly set to False. [1] [2]

Webhook configuration and UI state management:

  • The frontend now distinguishes between a draft (webhookUrl) and a saved (savedWebhookUrl) webhook URL, ensuring that the UI always reflects the last successfully saved value. All logic and display in the UI now use savedWebhookUrl for consistency. [1] [2] [3] [4] [5]
  • The webhook save logic is improved: it trims whitespace, handles server validation errors, updates all relevant state fields, and disables local upload if the webhook is cleared.
  • The output destination logic now correctly considers the savedWebhookUrl and the new local_upload_available flag. [1] [2]

Testing improvements:

  • New and enhanced tests cover all key scenarios for webhook configuration (success, validation failure, clearing the webhook) and provider config loading, ensuring correct state updates and error handling. [1] [2] [3]

These changes improve reliability and user experience around the cloud tab and webhook configuration, while ensuring robust test coverage for future changes.

Copilot AI 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.

Pull request overview

This PR improves the Cloud tab experience by making the cloud_tab_enabled flag default to enabled across legacy/missing/null values, and by separating “draft” vs “saved” webhook URL state so the UI reliably reflects the last successfully saved webhook configuration.

Changes:

  • Backend: normalize cloud_tab_enabled to default True (including robust handling of None and string legacy values) and apply consistent gating in TabService.
  • Frontend: introduce savedWebhookUrl alongside webhookUrl (draft), update UI logic to use the saved value, and improve webhook save behavior (trim/validation handling/state updates).
  • Tests: add/extend backend, Jest, and Selenium E2E coverage for cloud tab gating and webhook draft/saved behavior.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_webui_e2e.py Adds E2E coverage ensuring webhook draft input stays editable and doesn’t incorrectly mark outputs configured before save.
tests/test_webui_backend.py Adds backend tests for cloud tab defaulting behavior across missing/null/false values.
tests/test_git_services.py Adds TabService gating tests for Cloud tab visibility based on defaults.
tests/js/cloud_providers.test.js Updates provider config loading tests to assert savedWebhookUrl is set consistently.
tests/js/cloud_metrics.test.js Adds Jest tests for webhook save success, validation failure, and clearing behavior.
simpletuner/templates/partials/cloud_onboarding_flow.html Switches “webhook configured” UI checks to use savedWebhookUrl.
simpletuner/templates/partials/cloud_dataloader_hint.html Updates output destination hint logic to use savedWebhookUrl.
simpletuner/templates/cloud_tab.html Updates displayed local endpoint derivation to use savedWebhookUrl.
simpletuner/static/js/modules/cloud/state/publishing-state.js Introduces savedWebhookUrl in initial publishing state.
simpletuner/static/js/modules/cloud/providers.js Loads provider config with wrapped { config: ... } responses and syncs savedWebhookUrl/webhookUrl.
simpletuner/static/js/modules/cloud/metrics.js Improves webhook save logic (trim, error propagation, saved vs draft state, local upload flagging).
simpletuner/static/js/modules/cloud/index.js Updates “output configured” logic to consider savedWebhookUrl and local_upload_available.
simpletuner/simpletuner_sdk/server/services/webui_state.py Ensures defaults loading fills missing keys with dataclass defaults and normalizes cloud_tab_enabled.
simpletuner/simpletuner_sdk/server/services/tab_service.py Makes Cloud tab gating robust to None and string legacy values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_webui_e2e.py
@bghira bghira merged commit 68513a2 into main Jun 27, 2026
2 checks passed
@bghira bghira deleted the bugfix/cloud-tab-enablement branch June 27, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants