feat(organization): add Agent Tasks overview entry - #2976
RemiBonnet wants to merge 1 commit into
Conversation
|
View your CI Pipeline Execution ↗ for commit 78b6022
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
3 issues found across 3 files
Confidence score: 3/5
- In
section-agent-tasks-highlight.tsx, selecting onlyprojects[0]can hide the card when that project lacks environments even though another project is eligible, causing a user-facing feature omission; select the first project with an available environment. - In
section-agent-tasks-highlight.tsx, the global dismissal storage key makes dismissing the card in one organization suppress it across all organizations in the same browser; scope the key byorganizationId. - In
section-agent-tasks-highlight.tsx, dismissed cards still trigger project and environment requests despite rendering nothing, wasting network and query work; gate the project query withisVisibleand avoid the environment lookup after dismissal.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx">
<violation number="1" location="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx:13">
P2: Dismissing this card in one organization hides it in every organization opened in the same browser because the storage key is global. Scope the key by `organizationId` so dismissal applies only to the current organization.</violation>
<violation number="2" location="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx:14">
P2: After dismissal, this component still fetches projects and environments even though it always returns `null`. Include `isVisible` in the project query enablement and pass an empty project ID to `useEnvironments` when the card is hidden.</violation>
<violation number="3" location="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx:15">
P2: When the first project has no environments, the card disappears even if another project has an environment. Select the first project with an available environment, rather than stopping after `projects[0]`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled }) | ||
| const firstProject = projects[0] | ||
| const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' }) |
There was a problem hiding this comment.
P2: After dismissal, this component still fetches projects and environments even though it always returns null. Include isVisible in the project query enablement and pass an empty project ID to useEnvironments when the card is hidden.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx, line 14:
<comment>After dismissal, this component still fetches projects and environments even though it always returns `null`. Include `isVisible` in the project query enablement and pass an empty project ID to `useEnvironments` when the card is hidden.</comment>
<file context>
@@ -0,0 +1,80 @@
+ const { organizationId = '' } = useParams({ strict: false })
+ const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
+ const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
+ const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
+ const firstProject = projects[0]
+ const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' })
</file context>
| const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled }) | |
| const firstProject = projects[0] | |
| const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' }) | |
| const { data: projects = [] } = useProjects({ | |
| organizationId, | |
| enabled: isAgenticWorkflowEnabled && isVisible, | |
| }) | |
| const firstProject = projects[0] | |
| const { data: environments = [] } = useEnvironments({ | |
| projectId: isAgenticWorkflowEnabled && isVisible ? (firstProject?.id ?? '') : '', | |
| }) |
| const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow')) | ||
| const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true) | ||
| const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled }) | ||
| const firstProject = projects[0] |
There was a problem hiding this comment.
P2: When the first project has no environments, the card disappears even if another project has an environment. Select the first project with an available environment, rather than stopping after projects[0].
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx, line 15:
<comment>When the first project has no environments, the card disappears even if another project has an environment. Select the first project with an available environment, rather than stopping after `projects[0]`.</comment>
<file context>
@@ -0,0 +1,80 @@
+ const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
+ const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
+ const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
+ const firstProject = projects[0]
+ const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' })
+ const firstEnvironment = environments[0]
</file context>
| export function SectionAgentTasksHighlight() { | ||
| const { organizationId = '' } = useParams({ strict: false }) | ||
| const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow')) | ||
| const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true) |
There was a problem hiding this comment.
P2: Dismissing this card in one organization hides it in every organization opened in the same browser because the storage key is global. Scope the key by organizationId so dismissal applies only to the current organization.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx, line 13:
<comment>Dismissing this card in one organization hides it in every organization opened in the same browser because the storage key is global. Scope the key by `organizationId` so dismissal applies only to the current organization.</comment>
<file context>
@@ -0,0 +1,80 @@
+export function SectionAgentTasksHighlight() {
+ const { organizationId = '' } = useParams({ strict: false })
+ const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
+ const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
+ const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
+ const firstProject = projects[0]
</file context>
| const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true) | |
| const [isVisible, setIsVisible] = useLocalStorage(`agent-tasks-highlight-visible-${organizationId}`, true) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #2976 +/- ##
===========================================
- Coverage 50.08% 49.43% -0.66%
===========================================
Files 1349 710 -639
Lines 29144 17376 -11768
Branches 8574 5205 -3369
===========================================
- Hits 14596 8589 -6007
+ Misses 12152 7406 -4746
+ Partials 2396 1381 -1015
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Issue: N/A
argentic-workflowfeature flag and preserves the Open Policy entry.Screenshots / Recordings
Not included.
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn tsc --noEmit -p apps/console/tsconfig.app.jsonPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-releaseSummary by cubic
Adds a dismissible Agent Tasks card to the organization overview that routes users to the service creation flow for their first project and environment.
argentic-workflowfeature flag is enabled and a project with environments exists.Written for commit 78b6022. Summary will update on new commits.