Skip to content

Add disabled 'Generate with AI' UI to subtasks#584

Open
arifulhoque7 wants to merge 3 commits intoweDevsOfficial:developfrom
arifulhoque7:feature/ai-subtask-generation
Open

Add disabled 'Generate with AI' UI to subtasks#584
arifulhoque7 wants to merge 3 commits intoweDevsOfficial:developfrom
arifulhoque7:feature/ai-subtask-generation

Conversation

@arifulhoque7
Copy link
Copy Markdown
Contributor

@arifulhoque7 arifulhoque7 commented Feb 27, 2026

PR Description

Summary

Adds AI-powered subtask generation to the Pro plugin. A "Generate with AI" button appears in the subtask header row of any active task. Clicking it opens a modal that fetches 3–10 AI-suggested subtasks based on the task title, description, and project context. Users can review, edit, uncheck, or individually accept suggestions before adding them.

wedevs-project-manager (Free plugin)

File Type Description
views/assets/src/components/settings/ai-settings.vue Modified Added description mentioning AI subtask generation (Pro); updated Max Tokens field description to cover both project and subtask generation
views/assets/src/components/pro-task-lists/subtask-lists.vue Modified AI button and modal integration on the free plugin's pro-task subtask list view

How It Works

  1. User clicks "Generate with AI" button in the subtask header (only shown for active tasks)
  2. Modal opens immediately with a loading spinner while the API call runs
  3. POST /pm-pro/v2/tasks/{task_id}/sub-tasks/ai/generate is called with project_id
  4. Controller builds a context-aware prompt using task title, description, project info, and up to 10 sibling task titles
  5. AI response is parsed, sanitized, and returned as a JSON array of { title, description? } objects
  6. User reviews suggestions — can edit titles, uncheck items, or accept all
  7. Each accepted subtask is created via the existing POST /pm-pro/v2/tasks/{task_id}/sub-tasks endpoint
  8. Modal closes and subtask list refreshes

AI Provider Support

  • OpenAI — GPT-4o, GPT-4o Mini, GPT-4 Turbo, o1, o3-mini, etc.
  • Anthropic — Claude 3.5 Sonnet, Claude 3 Haiku, etc.
  • Google Gemini — Gemini 1.5 Pro, Gemini 2.0 Flash, etc.

Provider, model, API key, max tokens, and temperature are all read from the existing Settings → AI configuration (free plugin).


Accessibility & Code Quality

  • Modal uses role="dialog", aria-modal="true", aria-labelledby
  • All buttons have explicit type="button" and aria-label where needed
  • External links use rel="noopener noreferrer"
  • Checkboxes have :aria-label bound to the subtask title
  • AI button changed from <a href="#"> to <button> with :disabled binding
  • New JS methods use arrow functions (no var self = this)
  • Inline SVG styles moved to CSS classes

Test Plan

  • AI Settings → configure a valid API key (any provider)
  • Open any active task → verify "Generate with AI" button appears in subtask header
  • Click button → modal opens with spinner, then shows 3–10 suggestions
  • Edit a suggestion title → verify change is reflected when added
  • Uncheck one item → verify it is excluded from "Add Selected" count
  • Click "Add Selected" → subtasks are created and list refreshes
  • Click "Regenerate" → new suggestions load
  • Click "Cancel" or press Esc → modal closes without creating subtasks
  • Test with no API key configured → verify error state with settings link
  • Verify completed tasks do not show the "Generate with AI" button

close 292 , related PR PRO

Summary by CodeRabbit

  • New Features

    • Added an AI-powered "Generate with AI" subtask button (preview, disabled by default) with a Pro badge and updated subtask header layout.
  • Documentation

    • Clarified AI Settings with a descriptive paragraph and updated Max Tokens description to note it affects both project and subtask generation.

Introduce a 'Generate with AI' Pro button to the Subtasks header (UI-only preview) with SVG icon and Pro badge; reorganize header into a flex row and adjust title margins. Add styles for the disabled button state (opacity, cursor, pointer-events) and nested Pro badge. Also update AI Settings: add an explanatory description about the AI provider and clarify the max_tokens help text to mention both project and subtask generation.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 789a235 and cfe46ca.

📒 Files selected for processing (1)
  • views/assets/src/components/pro-task-lists/subtask-lists.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • views/assets/src/components/pro-task-lists/subtask-lists.vue

Walkthrough

Adds a subtask header row with a disabled "Generate with AI" button and Pro badge to the subtask lists component, and clarifies AI provider usage plus Max Tokens description in the AI settings component.

Changes

Cohort / File(s) Summary
Subtask generation UI
views/assets/src/components/pro-task-lists/subtask-lists.vue
Inserts a .subtask-header-row wrapper for the "Subtasks" title and a disabled .pm-btn-ai-subtask--preview button with inline SVG and .pm-ai-pro-badge; adds CSS for header layout, button styling, disabled state, and adjusts .subtask-title margin.
AI settings descriptions
views/assets/src/components/settings/ai-settings.vue
Adds a descriptive paragraph about AI provider usage and updates the Max Tokens field description to state it applies to both project and subtask generation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • weDevsOfficial/pm-pro#292: Adds the disabled "Generate with AI" button and subtask header UI requested by the issue.

Possibly related PRs

Suggested labels

QA Approved

Suggested reviewers

  • iftakharul-islam

Poem

🐰 A tiny header, stitched with care and code,
A button that waits while the meadow's AI bodes,
A Pro badge that twinkles, but patience is due,
Tokens clarified, the roadmap in view,
Hop on — small changes, big blooms to be sowed. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a disabled 'Generate with AI' UI element to the subtask header, which is the primary modification across the modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@arifulhoque7 arifulhoque7 self-assigned this Feb 27, 2026
@arifulhoque7 arifulhoque7 added Needs Dev Review This PR needs review by a developer Needs Testing This issue/PR needs further testing labels Feb 27, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
views/assets/src/components/pro-task-lists/subtask-lists.vue (1)

66-88: Consider removing pointer-events: none if switching to a native disabled button.

The pointer-events: none rule is a workaround for the anchor element. If you switch to a <button disabled>, you can remove this line since disabled buttons natively prevent interaction. The opacity: 0.6 and cursor: not-allowed styles are appropriate for the visual disabled state.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@views/assets/src/components/pro-task-lists/subtask-lists.vue` around lines 66
- 88, The CSS rule .pm-btn-ai-subtask--preview uses pointer-events: none as a
workaround for disabling an anchor; switch the markup to a native <button
disabled> (and keep opacity: 0.6 and cursor: not-allowed for visuals) and remove
pointer-events: none from the .pm-btn-ai-subtask--preview rule; ensure the
nested .pm-ai-pro-badge styling remains unchanged and verify keyboard
accessibility and focus styles for the disabled button.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@views/assets/src/components/pro-task-lists/subtask-lists.vue`:
- Around line 8-16: Replace the anchor element carrying class "pm-btn pm-btn-ai
pm-btn-ai-subtask--preview" with a <button> so it can receive a native disabled
state and proper semantics; keep the `@click.prevent` handler (or use `@click` with
type="button"), remove the href attribute, add type="button" and when disabled
set the disabled attribute (and optionally aria-disabled) instead of relying on
pointer-events. Update any CSS selectors or rules that target the old anchor
(e.g., change selectors like .pm-btn-ai-subtask--preview a or
a.pm-btn-ai-subtask--preview to just .pm-btn-ai-subtask--preview and add button
reset styles such as border: none) so styling is preserved for the new button
element. Ensure the inner content (SVG, text, and .pm-ai-pro-badge span) remains
unchanged.

---

Nitpick comments:
In `@views/assets/src/components/pro-task-lists/subtask-lists.vue`:
- Around line 66-88: The CSS rule .pm-btn-ai-subtask--preview uses
pointer-events: none as a workaround for disabling an anchor; switch the markup
to a native <button disabled> (and keep opacity: 0.6 and cursor: not-allowed for
visuals) and remove pointer-events: none from the .pm-btn-ai-subtask--preview
rule; ensure the nested .pm-ai-pro-badge styling remains unchanged and verify
keyboard accessibility and focus styles for the disabled button.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6b20e1 and 789a235.

📒 Files selected for processing (2)
  • views/assets/src/components/pro-task-lists/subtask-lists.vue
  • views/assets/src/components/settings/ai-settings.vue

Comment thread views/assets/src/components/pro-task-lists/subtask-lists.vue Outdated
arifulhoque7 and others added 2 commits February 27, 2026 14:06
Replace the anchor used for the "Generate with AI" control with a semantic, disabled <button> and add aria-disabled for accessibility. Update the SVG to use an icon class and remove the non-breaking space. Adjust styles for the disabled control: add gap, padding, border, border-radius, line-height, and icon layout rules; remove text-decoration and pointer-events, while preserving the disabled visual (opacity and not-allowed cursor). These changes improve semantics, accessibility, and visual spacing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Dev Review This PR needs review by a developer Needs Testing This issue/PR needs further testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant