MM-69631: add checked/unchecked indicator chip checklist items - #2307
MM-69631: add checked/unchecked indicator chip checklist items#2307calebroseland wants to merge 5 commits into
Conversation
Surface task completion in the run RHS: a compact chip under each checked
or unchecked checklist item shows when it changed ("checked 5d ago") and,
when resolvable from the run timeline events, the avatar of who did it. The
tooltip mirrors the activity log ("<user> checked off <timestamp>" /
"<user> unchecked <timestamp>") with the full fixed timestamp, degrading to
no attribution when the actor can't be matched unambiguously (e.g. multiple
items changed in the same millisecond). A compact prop toggles the short
chip vs the "Checked <relative>" form, paralleling the Due chip. Reorders
the task metadata row to [checked] [assignee] [due date] [command].
Timeline events are passed down as props from the run (which holds them via
useRun); reading the Redux store directly is unreliable because the single-
run fetch keeps the run in local state and does not hydrate the store.
Webapp-only: state_modified and timeline events already reach the client.
Ticket: https://mattermost.atlassian.net/browse/MM-69356
📝 WalkthroughWalkthroughThis PR adds a ChangesChecked/Unchecked Chip Feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DraggableChecklistItem
participant ChecklistItem
participant CheckedChip
participant useStateEvent
participant Profile
DraggableChecklistItem->>ChecklistItem: timelineEvents (from playbookRun)
ChecklistItem->>ChecklistItem: showCheckedChip(item)
ChecklistItem->>CheckedChip: item, timelineEvents, compact
CheckedChip->>useStateEvent: item, timelineEvents, action
useStateEvent-->>CheckedChip: matched event or undefined
CheckedChip->>Profile: subject userId (if resolved)
CheckedChip-->>ChecklistItem: rendered chip or null
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
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 `@webapp/src/components/checklist_item/checked_chip.test.tsx`:
- Around line 147-152: The test 'falls back to a unique title match when no
event_at matches' in the checked_chip.test.tsx file currently expects an avatar
match based on title alone when timestamps do not match, which can cause false
actor attribution across tasks with similar titles. Change the assertion from
expecting ['carol'] to expecting an empty array, since attribution should only
succeed with a timestamp match. Title matching should only serve as a
tie-breaker when timestamps match exactly in the same millisecond, not as a
standalone fallback.
🪄 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: 907c366a-d0ef-47d0-bab6-8c73ca705bc6
📒 Files selected for processing (7)
e2e-tests/tests/integration/playbooks/runs/rdp_checked_chip_spec.jswebapp/i18n/en.jsonwebapp/src/components/checklist_item/checked_chip.test.tsxwebapp/src/components/checklist_item/checked_chip.tsxwebapp/src/components/checklist_item/checklist_item.test.tsxwebapp/src/components/checklist_item/checklist_item.tsxwebapp/src/components/checklist_item/checklist_item_draggable.tsx
Drop the title-only fallback used when no timeline event's event_at matched the item's state_modified. The event_at === state_modified equality is the authoritative link (the backend sets both from one clock read); title is now only a tiebreaker among same-millisecond exact matches. Matching on title across a different timestamp risked attributing the wrong user. Addresses PR #2307 review feedback.
|
@coderabbitai review |
✅ Action performedReview finished.
|
JulienTant
left a comment
There was a problem hiding this comment.
The only blocker I can see is the wrong location of the e2e file. Brilliant idea to use the timeline!
| @@ -0,0 +1,111 @@ | |||
| // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | |||
There was a problem hiding this comment.
This file must be moved into the new cypress directory
| // * Hovering the chip reveals the activity-style tooltip with the verb "checked off". | ||
| // Tooltip renders in a body-level portal, so assert at document scope. | ||
| cy.get('@taskRow').findByTestId('checklist-item-checked-chip').realHover(); | ||
| cy.contains(/checked off/i).should('be.visible'); |
There was a problem hiding this comment.
should we use cy.uiGetToolTip rather than a whole body scan?
Merging master removed src/components/widgets/tooltip in favor of the shared WithTooltip component and moved e2e specs under cypress/. Update the checked/unchecked chip to match: - use WithTooltip (title prop) from @mattermost/shared/components/tooltip - fix import ordering (the shared tooltip is now an external import) - move the e2e spec to e2e-tests/cypress/tests/... and assert via cy.uiGetToolTip Addresses PR #2307 review feedback and CI lint.
|
Test server destroyed |
|
Hey @calebroseland - I couldn't get a spinwick spun up on the PR so I tested on a Added my test plan to the Jira ticket and everything's looking good apart from my 2 questions below:
|


Summary
Adds a chip beneath each checked or unchecked checklist task in the run's right-hand sidebar, showing when the state changed and who did it — information previously only visible in the run's activity/event list.
✓ 5d ago(checked), or an empty-checkbox icon for unchecked.<user> checked off <timestamp>/<user> unchecked <timestamp>.compactprop toggles the short chip vs aChecked <relative>label (parallels the existingDue …chip).[checked] [assignee] [due date] [command].Implementation notes
state_modifiedand timeline events already reach the client; no server / GraphQL / schema changes.useRun). Reading the Redux store directly is unreliable: the single-run fetch keeps the run in component-local state and does not hydrate the store.event_at === state_modified, then a unique-title tiebreak, and degrades to no-avatar on any ambiguity (e.g. multiple items changed in the same millisecond) rather than mis-attributing.Testing
checked_chip.test.tsx+ existingchecklist_itemsuite): match / tiebreak / fallback, check + uncheck, compact / non-compact, icons.rdp_checked_chip_spec.js): check → chip + tooltip → uncheck → tooltip, plus no-chip-on-untouched-task.Ticket Link
https://mattermost.atlassian.net/browse/MM-69631
Checklist
Gated by experimental feature flag(N/A)