You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
We now remove the call toHasTemplateVersionsWithAITask, and settasks-tab-visible to the opposite ofHideAITasks. As this was the only usage ofHasTemplateVersionsWithAITask, the query has been removed. If required, it can always be added back in the future.
Fixes#19059We now remove the call to `HasTemplateVersionsWithAITask`, and set`tasks-tab-visible` to the opposite of `HideAITasks`. As this was theonly usage of `HasTemplateVersionsWithAITask`, the query has beenremoved. If required, it can always be added back in the future.
DanielleMaywood changed the titlefix(site): show Tasks link when no templates have an AI taskfix(site): display tasks link when no templates contain an AI taskAug 5, 2025
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This change removes all code related to dynamically checking the database for the presence of AI task templates to control the visibility of the Tasks tab. Instead, the Tasks tab visibility is now determined solely by theHideAITasks configuration flag. The frontend placeholder for no task templates now includes a documentation link.
Changes
Cohort / File(s)
Change Summary
Backend: Remove AI task template existence check coderd/database/dbauthz/dbauthz.go,coderd/database/dbmetrics/querymetrics.go,coderd/database/dbmock/dbmock.go,coderd/database/querier.go,coderd/database/queries.sql.go,coderd/database/queries/templateversions.sql
Removed theHasTemplateVersionsWithAITask method and related SQL, interface, mock, and metrics code throughout the backend.
Backend: Test cleanup coderd/database/dbauthz_test.go
Removed the test for the deletedHasTemplateVersionsWithAITask method.
Backend: Site logic site/site.go
Removed the goroutine and logic that checked for AI task templates in the database; Tasks tab visibility now depends only on theHideAITasks option.
Updated the placeholder to include a documentation link when no task templates are found.
Sequence Diagram(s)
sequenceDiagram participant User participant Frontend participant Backend User->>Frontend: Load site Frontend->>Backend: (No longer queries for AI task templates) Frontend->>Frontend: Show Tasks tab if !HideAITasks Frontend->>User: Display Tasks tab and placeholder with docs link if no templates
Loading
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Assessment against linked issues
Objective
Addressed
Explanation
Always show the link to/tasks in the top navbar (#19059)
✅
If no tasks-compatible templates are configured, show a CTA with a link to the tasks documentation (#19059)
✅
Ensure the existing envCODER_HIDE_AI_TASKS is still respected (#19059)
✅
Assessment against linked issues: Out-of-scope changes
No out-of-scope changes detected.
Note
⚡️ Unit Test Generation is now available in beta!
Learn morehere, or try it out under "Finishing Touches" below.
📜 Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between760dc8b and6b14b89.
🧰 Additional context used🧠 Learnings (12)📚 Learning: applies to enterprise/audit/table.go : if a feature touches audit logs, update enterprise/audit/tabl...
Learnt from: CRPR: coder/coder#0File: CLAUDE.md:0-0Timestamp: 2025-07-28T00:33:10.063ZLearning: Applies to enterprise/audit/table.go : If a feature touches audit logs, update enterprise/audit/table.go.
Applied to files:
site/site.go
📚 Learning: applies to enterprise/audit/table.go : if audit errors occur after database changes, update enterpri...
Learnt from: CRPR: coder/coder#0File: CLAUDE.md:0-0Timestamp: 2025-07-28T00:33:07.777ZLearning: Applies to enterprise/audit/table.go : If audit errors occur after database changes, update enterprise/audit/table.go.
Applied to files:
site/site.go
📚 Learning: applies to enterprise/audit/table.go : if audit errors occur after database changes, update enterpri...
Learnt from: CRPR: coder/coder#0File: CLAUDE.md:0-0Timestamp: 2025-07-28T00:33:07.155ZLearning: Applies to enterprise/audit/table.go : If audit errors occur after database changes, update enterprise/audit/table.go and run make gen again.
Applied to files:
site/site.go
📚 Learning: applies to site/src/**/*.tsx : mui components are deprecated - migrate away from these when encounte...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.tsx : MUI components are deprecated - migrate away from these when encountered
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/src/**/*.tsx : use shadcn/ui components first - check site/src/components for existi...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.tsx : Use shadcn/ui components first - check site/src/components for existing implementations
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/src/**/*.tsx : prefer tailwind utilities over custom css when possible...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.tsx : Prefer Tailwind utilities over custom CSS when possible
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/src/**/*.tsx : replace emotion `css` prop with tailwind classes...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.tsx : Replace Emotion `css` prop with Tailwind classes
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/src/**/*.{ts,tsx} : use es modules (import/export) syntax, not commonjs (require)...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.{ts,tsx} : Use ES modules (import/export) syntax, not CommonJS (require)
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/**/*.tsx : all user-facing frontend code is developed in typescript using react and ...
Learnt from: CRPR: coder/coder#0File: .cursorrules:0-0Timestamp: 2025-07-21T14:32:43.064ZLearning: Applies to site/**/*.tsx : All user-facing frontend code is developed in TypeScript using React and lives in the `site/` directory.
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/src/**/*.tsx : leverage custom color tokens: content-primary, surface-secondary, etc...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.tsx : Leverage custom color tokens: content-primary, surface-secondary, etc.
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/**/*.ts : all user-facing frontend code is developed in typescript using react and l...
Learnt from: CRPR: coder/coder#0File: .cursorrules:0-0Timestamp: 2025-07-21T14:32:43.064ZLearning: Applies to site/**/*.ts : All user-facing frontend code is developed in TypeScript using React and lives in the `site/` directory.
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
📚 Learning: applies to site/src/**/*.{ts,tsx} : never mutate props, state, or values returned by hooks. always c...
Learnt from: CRPR: coder/coder#0File: site/CLAUDE.md:0-0Timestamp: 2025-07-21T14:33:50.957ZLearning: Applies to site/src/**/*.{ts,tsx} : Never mutate props, state, or values returned by Hooks. Always create new objects or use the setter from useState.
Applied to files:
site/src/pages/TasksPage/TasksPage.tsx
🔇 Additional comments (4)
site/src/pages/TasksPage/TasksPage.tsx (3)
16-16:LGTM! Good addition of Link component import.
The Link component import aligns with the PR objective to provide better user guidance through documentation links.
64-64:LGTM! Proper use of docs utility.
The docs utility import is correctly used for generating documentation URLs.
144-147:Excellent UX improvement with documentation link.
The replacement of static text with a clickable documentation link significantly enhances user experience when no task templates are available. The implementation correctly:
Uses proper link attributes (target="_blank",rel="noreferrer")
Points to the appropriate AI tasks documentation
Maintains the existing text flow while making "Learn about Tasks" actionable
This change perfectly complements the backend simplification by providing direct access to documentation rather than relying on database-driven UI state.
site/site.go (1)
559-559:Excellent simplification of tasks tab visibility logic.
The change from database-driven to configuration-driven visibility determination is a significant architectural improvement that:
Eliminates unnecessary complexity: Removes database query and related infrastructure
Improves performance: No more concurrent database operations for UI state
Increases reliability: Removes dependency on database availability for basic UI rendering
Maintains correctness: The!h.opts.HideAITasks logic properly inverts the hide flag to determine visibility
This change perfectly aligns with the PR objective of always showing the Tasks tab based on configuration rather than dynamic database content, with the frontend now handling the empty state gracefully through documentation links.
✨ Finishing Touches
📝 Generate Docstrings
🧪 Generate unit tests
Create PR with unit tests
Post copyable unit tests in a comment
Commit unit tests in branchdanielle/tasks/button-not-visible
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.
Explain this complex logic.
Open a follow-up GitHub issue for this discussion.
Files and specific lines of code (under the "Files changed" tab): Tag@coderabbitai in a new review comment at the desired location with your query. Examples:
@coderabbitai explain this code block.
PR comments: Tag@coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
@coderabbitai read src/utils.ts and explain its main purpose.
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Support
Need help? Create a ticket on oursupport page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pause to pause the reviews on a PR.
@coderabbitai resume to resume the paused reviews.
@coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
@coderabbitai full review to do a full review from scratch and review all the files again.
@coderabbitai summary to regenerate the summary of the PR.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#19059
We now remove the call to
HasTemplateVersionsWithAITask
, and settasks-tab-visible
to the opposite ofHideAITasks
. As this was the only usage ofHasTemplateVersionsWithAITask
, the query has been removed. If required, it can always be added back in the future.