Skip to content

[MM-69381] Add check/uncheck chip to playbook checklist items - #9959

Open
vish9812 wants to merge 5 commits into
mainfrom
mm-69381-playbook-task-activity
Open

[MM-69381] Add check/uncheck chip to playbook checklist items#9959
vish9812 wants to merge 5 commits into
mainfrom
mm-69381-playbook-task-activity

Conversation

@vish9812

@vish9812 vish9812 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds task activity support to playbook run checklist items:

  • New task activity indicator on checklist items (with a dedicated task_activity model/schema field on PlaybookRun).
  • A check/uncheck chip in the checklist item row and a corresponding section in the checklist item bottom sheet.
  • Activity timestamps respect the user's clock display format (12/24 hour).

Ticket Link

JIRA - https://mattermost.atlassian.net/browse/MM-69381
Related Web PR - mattermost/mattermost-plugin-playbooks#2307

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes

Device Information

This PR was tested on: ios and android.

Screenshots

  • Item Row Checked/Unchecked with Assignee
playbook-checked-uncheked
  • Bottom action sheet Checked
playbook-checked
  • Bottom action sheet Unchecked
playbook-unchecked
Added a check/uncheck chip to playbook run checklist items.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Documentation Impact Analysis — updates needed

Documentation Impact Analysis

Overall Assessment: Documentation Updates Recommended

Changes Summary

This PR adds a task activity indicator feature to Playbook checklist items on mobile: a new chip and bottom-sheet detail section that display who last checked or unchecked a task item and when. It also bumps the server database schema from version 20 to 21 (adds a timeline_events column to the PlaybookRun table) and updates the internal schema documentation accordingly.

Documentation Impact Details

Change Type Files Changed Affected Personas Documentation Action Docs Location
New or changed UI component (new user interaction) app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity_indicator.tsx, checklist_item.tsx, checklist_item_bottom_sheet/checklist_item_bottom_sheet.tsx End User Document new "task activity" chip and bottom-sheet detail showing who checked/unchecked a task and when docs/source/end-user-guide/workflow-automation/work-with-tasks.rst
New i18n strings assets/base/i18n/en.json (+4 new keys for activity chip label, accessibility labels, and absolute-time format) End User Confirms new user-visible feature (activity display); no separate doc action needed beyond the above

Recommended Actions

  • Update docs/source/end-user-guide/workflow-automation/work-with-tasks.rst under the "Mobile playbooks task management" section to document the new task activity indicator: after checking or unchecking a task, a chip appears on the task row (and in the task's bottom sheet) showing who performed the action and when (relative time in the chip, full absolute time in the bottom sheet). Include the minimum mobile app version required (v2.43.0 based on the version bump in package-lock.json).

Confidence

Medium — The feature is clearly new and user-visible (new chip and bottom-sheet section), and the existing work-with-tasks.rst already documents mobile task interactions with version tags. The change is self-explanatory from the UI, so documentation is recommended but not strictly required for users to use the feature. No admin configuration changes were introduced.

@github-actions github-actions Bot added the Docs/Needed Requires documentation label Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Coverage Comparison Report

Generated on July 29, 2026 at 11:54:08 UTC

+-----------------+------------+------------+-----------+
| Metric          | Main       | This PR    | Diff      |
+-----------------+------------+------------+-----------+
| Lines           |     88.09% |     88.05% |    -0.04% |
| Statements      |     87.96% |     87.91% |    -0.05% |
| Branches        |     76.88% |     76.88% |     0.00% |
| Functions       |     87.37% |     87.31% |    -0.06% |
+-----------------+------------+------------+-----------+
| Total           |     85.07% |     85.03% |    -0.04% |
+-----------------+------------+------------+-----------+

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change persists playbook-run timeline events, derives checklist task activity from matching events, propagates activity through checklist components, and renders localized chip and detail indicators with timezone and military-time support. It also adds narrow friendly-date formatting and updates related schemas, tests, documentation, and CI settings.

Changes

Playbook run activity

Layer / File(s) Summary
Timeline event persistence
app/database/..., app/products/playbooks/database/..., app/products/playbooks/types/database/..., docs/database/server/server.md, test/test_helper.ts
Adds schema version 21 and persists optional timeline_events JSON, validates stored events, and maps them through create and update transformations.
Task activity derivation and formatting
app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.*, app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity_indicator.*, app/components/friendly_date/*, assets/base/i18n/en.json
Derives check or uncheck activity from timeline events, resolves matching actors, renders chip and detail variants, formats localized timestamps, and adds narrow relative-date support.
Checklist activity wiring and preferences
app/products/playbooks/screens/playbook_run/{playbook_run.tsx,checklist_list.tsx,checklist/*}, app/products/playbooks/types/api.d.ts, package.json
Passes timeline events through checklist components, observes timezone and military-time preferences, displays activity in checklist items and bottom sheets, updates tests, and limits Jest worker usage in CI.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlaybookRun
  participant ChecklistList
  participant ChecklistItem
  participant getTaskActivity
  participant TaskActivityIndicator
  PlaybookRun->>ChecklistList: timelineEvents
  ChecklistList->>ChecklistItem: timelineEvents
  ChecklistItem->>getTaskActivity: checklist item and timelineEvents
  getTaskActivity-->>ChecklistItem: activity and actorUserId
  ChecklistItem->>TaskActivityIndicator: activity, actor, timezone, display settings
  TaskActivityIndicator-->>ChecklistItem: chip or detail activity UI
Loading

Suggested labels: kind/feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding a check/uncheck chip to playbook checklist items.
Description check ✅ Passed The description is directly related to the changeset and accurately summarizes the new task activity UI and related schema updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mm-69381-playbook-task-activity

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
app/database/migration/server/index.test.ts (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Apply the required test naming convention consistently.

  • app/database/migration/server/index.test.ts#L9-L9: rename the case to start with should.
  • app/products/playbooks/database/models/playbook_run.test.ts#L28-L45: rename both cases to start with should; use object cases and $label to avoid the unused callback parameter.

As per coding guidelines, tests should use it('should...') naming and unused parameters must be removed completely.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/database/migration/server/index.test.ts` at line 9, Rename the test in
app/database/migration/server/index.test.ts:9 to start with “should”. In
app/products/playbooks/database/models/playbook_run.test.ts:28-45, rename both
cases to start with “should”, convert their cases to objects using $label for
descriptions, and remove the unused callback parameter.

Source: Coding guidelines

app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.test.ts (1)

37-102: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Test titles don't follow the it('should...') convention.

None of the titles in this file (e.g., Line 37, Line 55, Line 86) start with "should". As per path instructions, app/**/*.test.ts guideline states: "Tests should use it('should...') naming, not test('happy path')."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.test.ts`
around lines 37 - 102, Rename every test title in the checklist activity suite
to follow the it('should...') convention, including the parameterized tests and
collision cases. Preserve each test’s existing meaning and assertions while
prefixing titles with clear “should” wording.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/products/playbooks/database/models/playbook_run.ts`:
- Around line 39-43: Update the TimelineEvent type guard around the event
validation to verify every required TimelineEvent property, including id,
creator_user_id, and playbook_run_id, alongside the existing checks before
narrowing the value. Ensure only objects satisfying the complete TimelineEvent
contract are returned as valid, or narrow the guard’s declared type if those
fields are not required.

In
`@app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity_indicator.tsx`:
- Around line 119-176: The outer accessible View in the chip and detail-row
branches currently wraps tappable BaseChip or PressableOpacity content. Remove
that accessibility container behavior, place the accessibility label on the
non-interactive content, and assign the tappable chip/avatar its own appropriate
accessibility role and label while preserving the existing press handlers.

---

Nitpick comments:
In `@app/database/migration/server/index.test.ts`:
- Line 9: Rename the test in app/database/migration/server/index.test.ts:9 to
start with “should”. In
app/products/playbooks/database/models/playbook_run.test.ts:28-45, rename both
cases to start with “should”, convert their cases to objects using $label for
descriptions, and remove the unused callback parameter.

In
`@app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.test.ts`:
- Around line 37-102: Rename every test title in the checklist activity suite to
follow the it('should...') convention, including the parameterized tests and
collision cases. Preserve each test’s existing meaning and assertions while
prefixing titles with clear “should” wording.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e6b35a8-eaa9-47d0-b736-4e46a3ab092f

📥 Commits

Reviewing files that changed from the base of the PR and between 072c51c and 8d29646.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (33)
  • app/components/friendly_date/friendly_date.test.tsx
  • app/components/friendly_date/index.tsx
  • app/database/migration/server/index.test.ts
  • app/database/migration/server/index.ts
  • app/database/schema/server/index.ts
  • app/database/schema/server/test.ts
  • app/products/playbooks/database/models/playbook_run.test.ts
  • app/products/playbooks/database/models/playbook_run.ts
  • app/products/playbooks/database/operators/transformers/index.test.ts
  • app/products/playbooks/database/operators/transformers/index.ts
  • app/products/playbooks/database/schema/playbook_run.ts
  • app/products/playbooks/screens/playbook_run/checklist/checklist.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/checklist_item.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/checklist_item.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/checklist_item_bottom_sheet/checklist_item_bottom_sheet.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/checklist_item_bottom_sheet/checklist_item_bottom_sheet.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/checklist_item_bottom_sheet/index.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/checklist_item_bottom_sheet/index.ts
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/index.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/index.ts
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.test.ts
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.ts
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity_indicator.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity_indicator.tsx
  • app/products/playbooks/screens/playbook_run/checklist/index.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist_list.test.tsx
  • app/products/playbooks/screens/playbook_run/checklist_list.tsx
  • app/products/playbooks/screens/playbook_run/playbook_run.test.tsx
  • app/products/playbooks/screens/playbook_run/playbook_run.tsx
  • app/products/playbooks/types/api.d.ts
  • app/products/playbooks/types/database/models/playbook_run.ts
  • test/test_helper.ts

Comment thread app/products/playbooks/database/models/playbook_run.ts
@mattermost-build mattermost-build added the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 21, 2026
@vish9812 vish9812 self-assigned this Jul 21, 2026
@vish9812 vish9812 changed the title [MM-69381] Add task activity indicator and check/uncheck chip to playbook checklist items [MM-69381] Add check/uncheck chip to playbook checklist items Jul 21, 2026
@mattermost-build mattermost-build removed the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 21, 2026
@vish9812 vish9812 removed the Docs/Needed Requires documentation label Jul 21, 2026
@vish9812 vish9812 added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester 2: UX Review Requires review by a UX Designer labels Jul 21, 2026
@mattermost-build mattermost-build added the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 21, 2026
@github-actions github-actions Bot added the Docs/Needed Requires documentation label Jul 21, 2026
@vish9812 vish9812 removed the Docs/Needed Requires documentation label Jul 21, 2026
@mattermost-build mattermost-build removed the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 21, 2026
@asaadmahmood

Copy link
Copy Markdown
Contributor

Does clicking on that chip open the bottom sheet @vish9812 ?

@vish9812

Copy link
Copy Markdown
Contributor Author

@asaadmahmood clicking on both chips open the regular profile bottom sheet. Clicking on the task opens the "task" bottom sheet you see.

@mattermost-build mattermost-build added the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 24, 2026
@github-actions github-actions Bot added the Docs/Needed Requires documentation label Jul 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.ruby-version:
- Line 1: Update the Ruby version declared in .ruby-version from the EOL 3.2
series to a supported release, using Ruby 3.4 or newer. If retaining Ruby 3.2 is
required, document the exception instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c616b9c3-4e9b-4c59-9551-3fbff6a41a6d

📥 Commits

Reviewing files that changed from the base of the PR and between b451c98 and 62d1ad7.

📒 Files selected for processing (1)
  • .ruby-version

Comment thread .ruby-version Outdated
@vish9812
vish9812 force-pushed the mm-69381-playbook-task-activity branch from 62d1ad7 to b451c98 Compare July 24, 2026 08:12
@mattermost-build mattermost-build added E2E/Run Triggers E2E tests on both iOS and Android via Matterwick and removed E2E/Run Triggers E2E tests on both iOS and Android via Matterwick labels Jul 24, 2026
@Willyfrog

Copy link
Copy Markdown
Contributor

@asaadmahmood isn't that double chip confusing? Especially when there is an assignee and a different person checks on it.

Given the space in the mobile app, shouldn't that info be accessed through the bottom sheet? i like how it looks in it and I don't see a lot of value in it being in the checklist view

@mattermost-build mattermost-build removed the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 24, 2026

@asaadmahmood asaadmahmood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mattermost-build mattermost-build added the E2E/Run Triggers E2E tests on both iOS and Android via Matterwick label Jul 29, 2026
@mm-cloud-bot

Copy link
Copy Markdown

❌ E2E Test Setup Failed

Failed to trigger E2E workflow: failed to trigger mobile e2e workflow: POST https://api.github.com/repos/mattermost/mattermost-mobile/actions/workflows/e2e-detox-pr.yml/dispatches: 422 Unexpected inputs provided: ["ANDROID_SITE_1_URL", "ANDROID_SITE_2_URL", "IOS_SITE_1_URL", "IOS_SITE_2_URL"] []

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 209: Update the test:ci script in package.json to remove the
--workerIdleMemoryLimit=1GB CLI argument while preserving --maxWorkers=2 and the
other existing options. Configure workerIdleMemoryLimit through the project’s
Jest configuration instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be666a8d-f9e6-4826-b069-c3dfb1dda166

📥 Commits

Reviewing files that changed from the base of the PR and between 62d1ad7 and 29e76ef.

📒 Files selected for processing (1)
  • package.json

Comment thread package.json Outdated
Comment thread package.json Outdated
@vish9812
vish9812 force-pushed the mm-69381-playbook-task-activity branch from 29e76ef to b451c98 Compare July 29, 2026 10:31
@mattermost-build mattermost-build added E2E/Run Triggers E2E tests on both iOS and Android via Matterwick and removed E2E/Run Triggers E2E tests on both iOS and Android via Matterwick labels Jul 29, 2026
@mm-cloud-bot

Copy link
Copy Markdown

❌ E2E Test Setup Failed

Failed to trigger E2E workflow: failed to trigger mobile e2e workflow: POST https://api.github.com/repos/mattermost/mattermost-mobile/actions/workflows/e2e-detox-pr.yml/dispatches: 422 Unexpected inputs provided: ["ANDROID_SITE_1_URL", "ANDROID_SITE_2_URL", "IOS_SITE_1_URL", "IOS_SITE_2_URL"] []

@mattermost-build mattermost-build added E2E/Run Triggers E2E tests on both iOS and Android via Matterwick and removed E2E/Run Triggers E2E tests on both iOS and Android via Matterwick labels Jul 29, 2026
@mm-cloud-bot

Copy link
Copy Markdown

❌ E2E Test Setup Failed

Failed to create E2E test instances: installation wait cancelled: context canceled

@vish9812
vish9812 force-pushed the mm-69381-playbook-task-activity branch from 39eb65e to b451c98 Compare July 29, 2026 11:00
@mattermost-build mattermost-build added E2E/Run Triggers E2E tests on both iOS and Android via Matterwick and removed E2E/Run Triggers E2E tests on both iOS and Android via Matterwick labels Jul 29, 2026
@mm-cloud-bot

Copy link
Copy Markdown

❌ E2E Test Setup Failed

Failed to trigger E2E workflow: failed to trigger mobile e2e workflow: POST https://api.github.com/repos/mattermost/mattermost-mobile/actions/workflows/e2e-detox-pr.yml/dispatches: 422 Unexpected inputs provided: ["ANDROID_SITE_1_URL", "ANDROID_SITE_2_URL", "IOS_SITE_1_URL", "IOS_SITE_2_URL"] []

@vish9812
vish9812 force-pushed the mm-69381-playbook-task-activity branch from b451c98 to 2c1c822 Compare July 29, 2026 11:44
@mattermost-build mattermost-build added E2E/Run Triggers E2E tests on both iOS and Android via Matterwick and removed E2E/Run Triggers E2E tests on both iOS and Android via Matterwick labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core commiter 2: UX Review Requires review by a UX Designer 3: QA Review Requires review by a QA tester Docs/Needed Requires documentation E2E/Run Triggers E2E tests on both iOS and Android via Matterwick release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants