diff --git a/app/assets/stylesheets/cards.css b/app/assets/stylesheets/cards.css
index 1056f387e..c9f325d8b 100644
--- a/app/assets/stylesheets/cards.css
+++ b/app/assets/stylesheets/cards.css
@@ -107,7 +107,11 @@
position: relative;
z-index: 0;
- .btn {
+ &:has(dialog[open]) {
+ z-index: 1;
+ }
+
+ .btn:not(.popup__item, .btn--plain) {
--btn-background: var(--bubble-color);
--btn-color: var(--color-ink-reversed);
}
@@ -356,6 +360,10 @@
}
}
+ .card__move-button {
+ --btn-background: color-mix(in srgb, var(--bubble-color) 40%, var(--color-ink));
+ }
+
.card__stages {
flex: 1 1 25%;
}
@@ -450,9 +458,9 @@
font-size: var(--text-rel-large);
font-weight: 900;
text-shadow:
- -2px -2px 0 var(--bubble-color),
+ -2px -2px 0 var(--bubble-color),
2px -2px 0 var(--bubble-color),
- -2px 2px 0 var(--bubble-color),
+ -2px 2px 0 var(--bubble-color),
2px 2px 0 var(--bubble-color);
}
}
diff --git a/app/controllers/bubbles/stagings_controller.rb b/app/controllers/bubbles/stagings_controller.rb
index 3c955a56c..591bcb790 100644
--- a/app/controllers/bubbles/stagings_controller.rb
+++ b/app/controllers/bubbles/stagings_controller.rb
@@ -2,7 +2,11 @@ class Bubbles::StagingsController < ApplicationController
include BubbleScoped, BucketScoped
def create
- @bubble.toggle_stage Current.account.stages.find(params[:stage_id])
+ if params[:stage_id].present?
+ @bubble.toggle_stage Current.account.stages.find(params[:stage_id])
+ else
+ @bubble.update!(stage: nil)
+ end
redirect_to @bubble
end
end
diff --git a/app/javascript/controllers/local_save_controller.js b/app/javascript/controllers/local_save_controller.js
index aaea8fa87..5d9b89a72 100644
--- a/app/javascript/controllers/local_save_controller.js
+++ b/app/javascript/controllers/local_save_controller.js
@@ -1,5 +1,5 @@
import { Controller } from "@hotwired/stimulus"
-import { debounce } from "helpers/timing_helpers"
+import { debounce, nextFrame } from "helpers/timing_helpers"
export default class extends Controller {
static targets = ["input"]
@@ -10,7 +10,7 @@ export default class extends Controller {
}
connect() {
- this.#restoreContent()
+ this.restoreContent()
}
submit({ detail: { success } }) {
@@ -28,20 +28,22 @@ export default class extends Controller {
}
}
- // Private
-
- #clear() {
- localStorage.removeItem(this.keyValue)
- }
-
- #restoreContent() {
+ async restoreContent() {
+ await nextFrame()
const savedContent = localStorage.getItem(this.keyValue)
+
if (savedContent) {
this.inputTarget.value = savedContent
this.#triggerChangeEvent(savedContent)
}
}
+ // Private
+
+ #clear() {
+ localStorage.removeItem(this.keyValue)
+ }
+
#triggerChangeEvent(newValue) {
if (this.inputTarget.tagName === "HOUSE-MD") {
this.inputTarget.dispatchEvent(new CustomEvent('house-md:change', {
diff --git a/app/views/bubbles/_card.html.erb b/app/views/bubbles/_card.html.erb
index 69b378125..c961195aa 100644
--- a/app/views/bubbles/_card.html.erb
+++ b/app/views/bubbles/_card.html.erb
@@ -30,7 +30,14 @@
<% end %>
- <%= turbo_frame_tag dom_id(bubble, :stage_picker), src: new_bucket_bubble_stage_picker_path(bubble.bucket, bubble) unless (previewing_card? && bubble.popped?) %>
+ <%= turbo_frame_tag dom_id(bubble, :stage_picker), src: new_bucket_bubble_stage_picker_path(bubble.bucket, bubble), refresh: :morph unless (previewing_card? && bubble.popped?) %>
+
+ <% if bubble.stage.nil? %>
+ <%= button_to bucket_bubble_stagings_path(bubble.bucket, bubble, stage_id: bubble.bucket&.workflow&.stages&.first), method: :post, class: "card__move-button card__hide-on-index btn btn--reversed" do %>
+ Move to Doing
+ <%= icon_tag "arrow-right" %>
+ <% end %>
+ <% end %>