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" feature to playbook run 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 (relative time), and the task detail bottom sheet gains a new section showing the actor name, relative time, and absolute timestamp. Internally, the server database schema advances to version 21 to persist timeline events on the PlaybookRun record.

Documentation Impact Details

Change Type Files Changed Affected Personas Documentation Action Docs Location
New or changed UI component (new user-visible 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 indicator: compact chip on checklist items (check/uncheck icon, actor avatar, relative time) and new activity detail row in the task bottom sheet (actor name, relative + absolute time) docs/source/end-user-guide/workflow-automation/work-with-tasks.rst
New i18n strings (4 new keys) assets/base/i18n/en.json End User Confirms the task activity display is genuinely new user-facing text — supports the recommendation above docs/source/end-user-guide/workflow-automation/work-with-tasks.rst

Recommended Actions

  • Update docs/source/end-user-guide/workflow-automation/work-with-tasks.rst — in the "Mobile playbooks task management / Interact with playbook tasks" section, add a bullet describing the new task activity indicator: checked and unchecked tasks now display a chip showing who performed the action (avatar + relative time), and tapping the task to open the bottom sheet reveals the actor name, relative time, and exact timestamp. Include a version qualifier consistent with the surrounding entries (e.g., "From Mattermost mobile v2.43.0").

Confidence

Medium — The new TaskActivityIndicator component and the 4 new i18n strings clearly confirm a new user-visible capability. The existing work-with-tasks.rst page already documents individual mobile task interactions at this level of granularity (including "Check/Uncheck tasks" and "Task interaction: Tap on any task to open a detailed bottom sheet view"), so this new indicator fits naturally there. Confidence is medium rather than high only because the feature is fairly self-evident from the UI and the docs team may choose to bundle it into a release-note entry rather than an inline update.

@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 21, 2026 at 17:29:41 UTC

+-----------------+------------+------------+-----------+
| Metric          | Main       | This PR    | Diff      |
+-----------------+------------+------------+-----------+
| Lines           |     88.08% |     88.08% |     0.00% |
| Statements      |     87.94% |     87.94% |     0.00% |
| Branches        |     76.88% |     76.90% |     0.02% |
| Functions       |     87.34% |     87.35% |     0.01% |
+-----------------+------------+------------+-----------+
| Total           |     85.06% |     85.06% |     0.00% |
+-----------------+------------+------------+-----------+

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4e76a94c-74e7-4287-9993-1aafa5a3b1c2

📥 Commits

Reviewing files that changed from the base of the PR and between 3c20d99 and b451c98.

📒 Files selected for processing (1)
  • assets/base/i18n/en.json

📝 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 military-time 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, parses valid TimelineEvent values into PlaybookRunModel, 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
Derives check and uncheck activity from matching timeline events, adds narrow relative-time formatting, supports the open checklist state, and renders chip or detail activity 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 military-time and timezone 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
🚥 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
Title check ✅ Passed The title clearly reflects the main change: adding check/uncheck chips to playbook checklist items.
Description check ✅ Passed The description is directly aligned with the changeset, covering task activity support, checklist UI updates, and clock-format handling.
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.
✨ 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
…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
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 release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants