Completing a step removes stalled status from UI

Add `updatedAt` to stalled bubble options so JS can check if the card
was recently updated, matching the `Card::Stallable#stalled?`
logic. Refresh the bubble via Turbo Stream when a step is updated.

This should have been part of #1625

Fixes https://app.fizzy.do/5986089/cards/3668
This commit is contained in:
Mike Dalessio
2026-01-16 09:56:10 -05:00
parent 002149a1a7
commit 9c76002bc1
5 changed files with 40 additions and 1 deletions
@@ -52,8 +52,11 @@ export default class extends Controller {
this.#show()
}
// Keep in sync with Card::Stallable#stalled? in app/models/card/stallable.rb
get #isStalled() {
return this.stalledValue.lastActivitySpikeAt && signedDifferenceInDays(new Date(this.stalledValue.lastActivitySpikeAt), new Date()) > this.stalledValue.stalledAfterDays
return this.stalledValue.lastActivitySpikeAt &&
signedDifferenceInDays(new Date(this.stalledValue.lastActivitySpikeAt), new Date()) > this.stalledValue.stalledAfterDays &&
signedDifferenceInDays(new Date(this.stalledValue.updatedAt), new Date()) > this.stalledValue.stalledAfterDays
}
#showStalled() {