Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(site): display tasks link when no templates contain an AI task#19184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 2 commits intomainfromdanielle/tasks/button-not-visible
Aug 5, 2025

Conversation

DanielleMaywood
Copy link
Contributor

Fixes#19059

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.
@DanielleMaywoodDanielleMaywood 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
@DanielleMaywoodDanielleMaywood marked this pull request as ready for reviewAugust 5, 2025 15:28
@DanielleMaywood
Copy link
ContributorAuthor

@coderabbitai review

coderabbitai[bot] reacted with eyes emoji

@coderabbitaicoderabbitai
Copy link

✅ Actions performed

Review triggered.

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.

@coderabbitaicoderabbitai
Copy link

📝 Walkthrough

Walkthrough

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.
Frontend: Tasks page placeholder
site/src/pages/TasksPage/TasksPage.tsx
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

ObjectiveAddressedExplanation
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.

📒 Files selected for processing (9)
  • coderd/database/dbauthz/dbauthz.go (0 hunks)
  • coderd/database/dbauthz/dbauthz_test.go (0 hunks)
  • coderd/database/dbmetrics/querymetrics.go (0 hunks)
  • coderd/database/dbmock/dbmock.go (0 hunks)
  • coderd/database/querier.go (0 hunks)
  • coderd/database/queries.sql.go (0 hunks)
  • coderd/database/queries/templateversions.sql (0 hunks)
  • site/site.go (1 hunks)
  • site/src/pages/TasksPage/TasksPage.tsx (3 hunks)
💤 Files with no reviewable changes (7)
  • coderd/database/queries/templateversions.sql
  • coderd/database/querier.go
  • coderd/database/dbauthz/dbauthz_test.go
  • coderd/database/queries.sql.go
  • coderd/database/dbmetrics/querymetrics.go
  • coderd/database/dbauthz/dbauthz.go
  • coderd/database/dbmock/dbmock.go
🧰 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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat withCodeRabbit:

  • 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.
  • @coderabbitai generate docstrings togenerate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add@coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add@coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add@coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit ourDocumentation for detailed information on how to use CodeRabbit.
  • Join ourDiscord Community to get help, request features, and share feedback.
  • Follow us onX/Twitter for updates and announcements.

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

Backend changes look good to me!
Deferring to Bruno on the copy changes.

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@DanielleMaywoodDanielleMaywood merged commitcc609cb intomainAug 5, 2025
31 of 33 checks passed
@DanielleMaywoodDanielleMaywood deleted the danielle/tasks/button-not-visible branchAugust 5, 2025 18:30
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 5, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

@aslilacaslilacAwaiting requested review from aslilacaslilac is a code owner

Assignees

@DanielleMaywoodDanielleMaywood

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Show Tasks tab when no AI tasks are configured
3 participants
@DanielleMaywood@BrunoQuaresma@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp