Merge branch 'main' into mobile/prepare-webviews-2

* main:
  Return to Board page when clearing filters
  Bump card perma z-index when dialog is open
  Only submit on blur if the input has a value
  Make the CLAUDE.md stub less obtrusive
  Only index up to 32KB of search content
  Use inline spacing variable
  Actually make it affect larger screens too
  Use CSS variable for panel size in delete dialogs
  Add viewport padding to dialogs on mobile
  Prevent page scrolling when modal dialog is open
This commit is contained in:
Adrien Maston
2026-01-22 11:01:38 +01:00
10 changed files with 45 additions and 6 deletions
+1
View File
@@ -0,0 +1 @@
@../AGENTS.md
-1
View File
@@ -1 +0,0 @@
@AGENTS.md
+1 -1
View File
@@ -25,7 +25,7 @@
position: relative;
&:has(dialog[open]) {
z-index: 2;
z-index: 3;
}
&:has(.card-perma__star-input:checked) {
+10
View File
@@ -1,4 +1,9 @@
@layer components {
/* Prevent page scrolling when modal dialog is open */
html:has(dialog:modal) {
overflow: hidden;
}
:is(.dialog) {
border: 0;
opacity: 0;
@@ -35,4 +40,9 @@
}
}
}
/* Ensure padding from viewport edges */
.dialog.panel {
max-inline-size: calc(100vw - var(--inline-space-double) * 2);
}
}
@@ -54,6 +54,10 @@ export default class extends Controller {
}
submitToTopTarget(event) {
const value = event.target.value?.trim()
if (!value) return false
this.element.setAttribute("data-turbo-frame", "_top")
this.submit()
}
+7 -1
View File
@@ -1,6 +1,8 @@
module Searchable
extend ActiveSupport::Concern
SEARCH_CONTENT_LIMIT = 32.kilobytes
included do
after_create_commit :create_in_search_index
after_update_commit :update_in_search_index
@@ -32,11 +34,15 @@ module Searchable
card_id: search_card_id,
board_id: search_board_id,
title: search_title,
content: search_content,
content: search_record_content,
created_at: created_at
}
end
def search_record_content
search_content&.truncate_bytes(SEARCH_CONTENT_LIMIT, omission: "")
end
def search_record_class
Search::Record.for(account_id)
end
+1 -1
View File
@@ -3,7 +3,7 @@
<%= icon_tag "trash" %>
<span>Delete this board</span>
</button>
<dialog class="dialog panel fill-white shadow gap flex-column" style="max-width: 40ch" data-dialog-target="dialog">
<dialog class="dialog panel fill-white shadow gap flex-column" style="--panel-size: 40ch" data-dialog-target="dialog">
<h3 class="txt-large txt-bold">Delete this board?</h3>
<p class="txt-medium margin-block-half">Are you sure you want to permanently delete this board and all the cards on it? This can't be undone.</p>
<div class="flex gap-half justify-center margin-block-start">
+1 -1
View File
@@ -3,7 +3,7 @@
<%= icon_tag "trash" %>
<span>Delete this card</span>
</button>
<dialog class="dialog panel fill-white shadow gap flex-column" style="max-width: 40ch" data-dialog-target="dialog">
<dialog class="dialog panel fill-white shadow gap flex-column" style="--panel-size: 40ch" data-dialog-target="dialog">
<h3 class="txt-large txt-bold">Delete this card?</h3>
<p class="txt-medium margin-block-half">Are you sure you want to permanently delete this card?</p>
<div class="flex gap-half justify-center margin-block-start">
+2 -1
View File
@@ -1,7 +1,8 @@
<% filter = user_filtering.filter %>
<% clear_url = filter.single_board ? board_path(filter.single_board) : no_filtering_url %>
<div class="filters__manage gap-half">
<%= link_to no_filtering_url, class: "btn btn--remove txt-x-small", data: { controller: "hotkey tooltip", action: "keydown.esc@document->hotkey#click"} do %>
<%= link_to clear_url, class: "btn btn--remove txt-x-small", data: { controller: "hotkey tooltip", action: "keydown.esc@document->hotkey#click"} do %>
<%= icon_tag "close" %>
<span class="for-screen-reader">Clear all</span>
<% end %>
+18
View File
@@ -32,6 +32,24 @@ class Card::SearchableTest < ActiveSupport::TestCase
assert_not_includes results, card_in_other_board
end
test "search content is truncated to a reasonable limit" do
search_record_class = Search::Record.for(@user.account_id)
# Create a card with unreasonably long content
long_content = "asdf " * Searchable::SEARCH_CONTENT_LIMIT
card = @board.cards.create!(title: "Card with long description", creator: @user)
card.description = ActionText::Content.new(long_content)
card.save!
# Check if was indexed
results = Card.mentioning("asdf", user: @user)
assert_includes results, card
# Check the content length was within the limit
search_record = search_record_class.find_by(searchable_type: "Card", searchable_id: card.id)
assert search_record.content.bytesize <= Searchable::SEARCH_CONTENT_LIMIT
end
test "deleting card removes search record and FTS entry" do
search_record_class = Search::Record.for(@user.account_id)
card = @board.cards.create!(title: "Card to delete", creator: @user)