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

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 to Playbooks checklist items on mobile. When a task is checked or unchecked, a compact chip now appears on the item showing who performed the action and when; tapping it opens a detail view with the actor's avatar, name, relative time, and absolute time. The change also bumps the server database schema to v21 (adding a timeline_events column to PlaybookRun) and adds 4 new i18n strings supporting the new UI.

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, task_activity.ts, checklist_item.tsx, checklist_item_bottom_sheet.tsx End User Document the new task activity chip and detail view visible on checked/unchecked checklist items in mobile Playbook runs docs/source/end-user-guide/workflow-automation/work-with-runs.rst
New i18n strings assets/base/i18n/en.json (+4 new keys: playbooks.checklist_item.activity.*) End User Confirms new user-facing feature — "Checked"/"Unchecked" by actor with timestamp is now surfaced in the mobile checklist docs/source/end-user-guide/workflow-automation/work-with-runs.rst

Recommended Actions

  • Update docs/source/end-user-guide/workflow-automation/work-with-runs.rst — expand the "Playbook runs on mobile" section (around line 26–29) to mention that checklist items now display a task activity indicator showing who last checked or unchecked the task and when, along with the minimum mobile app version this became available (v2.43.0 based on the package-lock.json version bump).

Confidence

Medium — The "Playbook runs on mobile" section in work-with-runs.rst is brief and does not enumerate specific mobile checklist capabilities, so the new activity indicator represents a meaningful addition to that feature area. The change is self-evident from the UI (a chip with avatar and timestamp), so it narrowly passes the materiality test — a user curious about the new indicator might look to documentation for context, but no admin configuration is required.


@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 24, 2026 at 08:02:07 UTC

+-----------------+------------+------------+-----------+
| Metric          | Main       | This PR    | Diff      |
+-----------------+------------+------------+-----------+
| Lines           |     88.04% |     88.08% |     0.04% |
| Statements      |     87.91% |     87.94% |     0.03% |
| Branches        |     76.85% |     76.89% |     0.04% |
| Functions       |     87.30% |     87.35% |     0.05% |
+-----------------+------------+------------+-----------+
| Total           |     85.02% |     85.06% |     0.04% |
+-----------------+------------+------------+-----------+

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change persists playbook-run timeline events, derives checklist task activity and actors, and displays activity chips and detail rows with localized relative and absolute times. Checklist components now receive timeline events and time-format preferences, while friendly-date formatting supports narrow relative-time output.

Changes

Playbook run activity

Layer / File(s) Summary
Timeline event persistence
app/database/migration/server/*, app/database/schema/server/*, app/products/playbooks/database/models/playbook_run.*, app/products/playbooks/database/operators/transformers/*, app/products/playbooks/database/schema/playbook_run.ts, app/products/playbooks/types/database/models/playbook_run.ts, test/test_helper.ts, docs/database/server/server.md
Adds schema version 21 with an optional timeline_events JSON column, validates persisted TimelineEvent values, and maps timeline events through create and update transformations.
Task activity derivation and formatting
app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity.*, app/components/friendly_date/*, app/products/playbooks/screens/playbook_run/checklist/checklist_item/task_activity_indicator.*, app/products/playbooks/types/api.d.ts, assets/base/i18n/en.json
Derives check and uncheck activity from matching timeline events, supports the open checklist state, adds narrow relative-time formatting, and renders localized chip or detail indicators with timezone and 12/24-hour time formatting.
Checklist activity wiring and preferences
app/products/playbooks/screens/playbook_run/playbook_run.*, app/products/playbooks/screens/playbook_run/checklist_list.*, app/products/playbooks/screens/playbook_run/checklist/*, app/products/playbooks/screens/playbook_run/checklist/checklist_item/*
Passes timeline events through checklist components, resolves activity actors, observes time-format preferences, and renders activity indicators in checklist items and bottom sheets.

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

Sequence Diagram(s)

sequenceDiagram
  participant PlaybookRun
  participant ChecklistList
  participant Checklist
  participant ChecklistItem
  participant TaskActivityIndicator
  PlaybookRun->>ChecklistList: pass timelineEvents
  ChecklistList->>Checklist: forward timelineEvents
  Checklist->>ChecklistItem: forward timelineEvents
  ChecklistItem->>ChecklistItem: derive activity and activityActor
  ChecklistItem->>TaskActivityIndicator: render activity chip
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 matches the changeset by describing task activity support, the chip, the bottom sheet section, and clock-format handling.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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
…ents

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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
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
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 release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants