Add workload button to Workloads dashboard#5290
Conversation
The Workloads page had no way to create or deploy a new workload directly — users had to navigate to the Deploy page manually or use an AI mission. This adds: - A header "Add Workload" button (purple, with Plus icon) that navigates to the Deploy dashboard - A prominent "Deploy a Workload" call-to-action in the empty state when no workloads are detected (Rocket icon) Both buttons use the ROUTES.DEPLOY constant and follow the existing EmptyClusterState pattern. Closes #5287 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
There was a problem hiding this comment.
Pull request overview
Adds “Add Workload” navigation CTAs to the Workloads dashboard so users can more easily reach the Deploy page (/deploy) to add new workloads.
Changes:
- Adds an “Add Workload” button to the Workloads dashboard header that navigates to Deploy.
- Adds an empty-state “Deploy a Workload” button when no workloads are detected.
- Introduces new i18n keys/usages for Workloads empty-state strings and CTA labels.
| title={t('workloads.addWorkload', 'Deploy a new workload')} | ||
| > | ||
| <Plus className="w-3.5 h-3.5" /> | ||
| {t('workloads.addWorkload', 'Add Workload')} |
There was a problem hiding this comment.
The same i18n key (workloads.addWorkload) is used for both the button label and the title tooltip, but with different default strings. If translations are provided, both values will resolve to the same translated string, which can make the tooltip incorrect/unhelpful. Use distinct translation keys (e.g., workloads.addWorkloadLabel vs workloads.addWorkloadTitle) or use a non-translated title derived from the label if you want them identical.
| title={t('workloads.addWorkload', 'Deploy a new workload')} | |
| > | |
| <Plus className="w-3.5 h-3.5" /> | |
| {t('workloads.addWorkload', 'Add Workload')} | |
| title={t('workloads.addWorkloadTitle', 'Deploy a new workload')} | |
| > | |
| <Plus className="w-3.5 h-3.5" /> | |
| {t('workloads.addWorkloadLabel', 'Add Workload')} |
| <DashboardPage | ||
| title="Workloads" | ||
| subtitle="View and manage deployed applications across clusters" | ||
| icon="Layers" | ||
| rightExtra={<RotatingTip page="workloads" />} | ||
| rightExtra={ |
There was a problem hiding this comment.
| @@ -232,8 +247,15 @@ | |||
| ) : apps.length === 0 ? ( | |||
| <div className="text-center py-12"> | |||
| <div className="text-6xl mb-4">📦</div> | |||
| <p className="text-lg text-foreground">No workloads found</p> | |||
| <p className="text-sm text-muted-foreground">No deployments detected across your clusters</p> | |||
| <p className="text-lg text-foreground">{t('workloads.noWorkloadsTitle', 'No workloads found')}</p> | |||
| <p className="text-sm text-muted-foreground mb-6">{t('workloads.noWorkloadsDesc', 'No deployments detected across your clusters')}</p> | |||
| <button | |||
| onClick={() => navigate(ROUTES.DEPLOY)} | |||
| className="inline-flex items-center gap-2 px-5 py-2.5 text-sm font-medium rounded-lg bg-purple-600 hover:bg-purple-500 text-white transition-colors" | |||
| > | |||
| <Rocket className="w-4 h-4" /> | |||
| {t('workloads.deployWorkload', 'Deploy a Workload')} | |||
| </button> | |||
There was a problem hiding this comment.
New navigation behavior is introduced via the “Add Workload” and empty-state “Deploy a Workload” buttons, but there doesn’t appear to be a Workloads page Playwright spec that asserts these CTAs are present and navigate to /deploy. Consider adding an e2e test (similar to other dashboard page specs) to prevent regressions in routing and empty-state rendering.
🔄 Auto-Applying Copilot Code ReviewCopilot code review found 1 code suggestion(s) and 2 general comment(s). @copilot Please apply all of the following code review suggestions:
Also address these general comments:
Push all fixes in a single commit. Run Auto-generated by copilot-review-apply workflow. |
✅ Post-Merge Verification: passedCommit: |
Summary
/deploywhere users can deploy workloads via drag-and-dropTest plan
Closes #5287