Skip to content

Add TaskModal component, story, and tests with fixes for test reliabi…#22712

Merged
JorPV merged 17 commits intofeature/task-listfrom
837-task-list-create-task-modal-component
Nov 14, 2025
Merged

Add TaskModal component, story, and tests with fixes for test reliabi…#22712
JorPV merged 17 commits intofeature/task-listfrom
837-task-list-create-task-modal-component

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Nov 11, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • [@yoast/dashboard-frontend 0.0.1] Adds the task modal component.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • For devs:
  • Spin the storybook for the dashboard-frontend package.
  • Check you see in the sidebar a place for task list components and a the task modal story.
Screenshot 2025-11-12 at 10 44 27
  • Check the documentation intro text makes sense in the story it self.
  • Check the props table is clear.
  • Open the modal and check the modal design is the same as in the design.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Task list: create task modal component

@vraja-pro vraja-pro added this to the feature/task-list milestone Nov 11, 2025
@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Nov 11, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Nov 11, 2025

Pull Request Test Coverage Report for Build 7bc9d00707c9b16dee562fde9eb845c914e5ffbd

Details

  • 32 of 34 (94.12%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on 837-task-list-create-task-modal-component at 31.071%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/dashboard-frontend/src/task-list/components/priority.js 7 9 77.78%
Totals Coverage Status
Change from base Build 5ec88c1e1bc60ee75dbcfde8a4034e11622b12e0: 31.1%
Covered Lines: 5148
Relevant Lines: 15224

💛 - Coveralls

@JorPV JorPV requested a review from Copilot November 14, 2025 09:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new TaskModal component to the dashboard-frontend package, including its story and comprehensive test coverage. The component displays task details in a modal dialog with priority indicators, duration estimates, and call-to-action buttons.

  • Implements a TaskModal component with supporting Duration, Priority, and CallToActionButton subcomponents
  • Adds Storybook documentation and interactive examples
  • Includes comprehensive test coverage with snapshot testing
  • Adds IntersectionObserver mock to test setup for improved test reliability

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/dashboard-frontend/src/task-list/components/task-modal.js Main TaskModal component implementation with modal structure and task details display
packages/dashboard-frontend/src/task-list/components/call-to-action-button.js Reusable button component supporting multiple action types (add, delete, link)
packages/dashboard-frontend/src/task-list/components/priority.js Priority indicator component with visual icons for low/medium/high levels
packages/dashboard-frontend/src/task-list/components/duration.js Duration display component showing task time estimates
packages/dashboard-frontend/src/icons/HowIcon.js Custom SVG icon for "how to complete" section
packages/dashboard-frontend/src/icons/YoastIcon.js Yoast brand icon SVG component
packages/dashboard-frontend/src/icons/index.js Icon exports barrel file
packages/dashboard-frontend/tests/task-list/task-modal.test.js Comprehensive test suite for TaskModal component
packages/dashboard-frontend/tests/task-list/call-to-action-button.test.js Test suite with snapshot tests for CallToActionButton
packages/dashboard-frontend/tests/setupTests.js Adds IntersectionObserver mock for test environment
packages/dashboard-frontend/stories/task-list/task-modal/task-modal.stories.js Storybook story with interactive controls
packages/dashboard-frontend/stories/task-list/task-modal/documentation.md Component documentation for Storybook
packages/dashboard-frontend/src/index.js Exports TaskModal for external use

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/dashboard-frontend/src/task-list/components/task-modal.js Outdated
Comment thread packages/dashboard-frontend/src/task-list/components/task-modal.js Outdated
it( "calls onClose when Close button is clicked", () => {
const onClose = jest.fn();
render( <TaskModal { ...defaultProps } onClose={ onClose } isOpen={ true } /> );
const closeButton = screen.getAllByRole( "button" )[ 1 ];
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Using array index [1] to select the close button is fragile and could break if button order changes. Consider using a more specific selector like screen.getByText(/Close/i) or adding a test ID to the close button.

Suggested change
const closeButton = screen.getAllByRole( "button" )[ 1 ];
const closeButton = screen.getByText( /Close/i );

Copilot uses AI. Check for mistakes.
Comment thread packages/dashboard-frontend/src/task-list/components/task-modal.js Outdated
Comment thread packages/dashboard-frontend/src/task-list/components/duration.js Outdated
Copy link
Copy Markdown
Contributor

@JorPV JorPV left a comment

Choose a reason for hiding this comment

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

Really neat 👍🏼 Just some small findings 🙂

@JorPV
Copy link
Copy Markdown
Contributor

JorPV commented Nov 14, 2025

CR ✅ AT ✅

@JorPV JorPV merged commit 874c0a7 into feature/task-list Nov 14, 2025
18 of 19 checks passed
@JorPV JorPV deleted the 837-task-list-create-task-modal-component branch November 14, 2025 15:12
@leonidasmi leonidasmi mentioned this pull request Nov 27, 2025
18 tasks
@leonidasmi leonidasmi removed this from the feature/task-list milestone Dec 1, 2025
@leonidasmi leonidasmi added this to the 26.6 milestone Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants