-
Notifications
You must be signed in to change notification settings - Fork 122
Transactions & Activities pages improvements #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4a39f65
2cfd431
36bec8e
48a2e47
b170d4f
804ff1f
5dfd172
025afc0
b794ef8
82c28b1
64c2871
bdcf985
8eebe9d
22a444d
7fa99cd
ad90345
11b451c
47ced2f
9766c50
de36292
b006d21
ba549c9
de24ced
7b61e2f
9f54836
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { Controller } from "@hotwired/stimulus" | ||
|
|
||
| export default class extends Controller { | ||
| static targets = ["selectionEntry", "toggleButton"] | ||
|
|
||
| toggle() { | ||
| if (this.selectionEntryTargets.length === 0) return | ||
|
|
||
| const shouldShow = this.selectionEntryTargets[0].classList.contains("hidden") | ||
|
|
||
| this.selectionEntryTargets.forEach((el) => { | ||
| if (shouldShow) { | ||
| el.classList.remove("hidden") | ||
| } else { | ||
| el.classList.add("hidden") | ||
| } | ||
| }) | ||
|
|
||
| if (!shouldShow) { | ||
| const bulkSelectElement = | ||
| this.element.querySelector("[data-controller~='bulk-select']") || | ||
| this.element.closest("[data-controller~='bulk-select']") || | ||
| document.querySelector("[data-controller~='bulk-select']") | ||
| if (bulkSelectElement) { | ||
| const bulkSelectController = this.application.getControllerForElementAndIdentifier( | ||
| bulkSelectElement, | ||
| "bulk-select" | ||
| ) | ||
| if (bulkSelectController) { | ||
| bulkSelectController.deselectAll() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (this.hasToggleButtonTarget) { | ||
| this.toggleButtonTarget.classList.toggle("bg-surface", shouldShow) | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <%# locals: (category:) %> | ||
| <% category ||= Category.uncategorized %> | ||
|
|
||
| <div> | ||
| <span class="flex lg:hidden items-center gap-1 text-sm font-medium rounded-full px-1.5 py-1 border truncate focus-visible:outline-none focus-visible:ring-0 w-8 h-8 justify-center" | ||
| style=" | ||
| background-color: color-mix(in oklab, <%= category.color %> 10%, transparent); | ||
| border-color: color-mix(in oklab, <%= category.color %> 10%, transparent); | ||
| color: <%= category.color %>;"> | ||
| <% if category.lucide_icon.present? %> | ||
| <%= icon category.lucide_icon, size: "sm", color: "current" %> | ||
| <% end %> | ||
| </span> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <span id="category_name_mobile_<%= transaction.id %>" class="text-secondary lg:hidden"> | ||
| <% if transaction.transfer&.categorizable? || transaction.transfer.nil? %> | ||
| <%= transaction.category&.name || Category.uncategorized.name %> | ||
| <% else %> | ||
| <%= transaction.transfer&.payment? ? payment_category.name : transfer_category.name %> | ||
| <% end %> | ||
| </span> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| <%# locals: (classes: nil) %> | ||
| <hr class="border-divider <%= classes || "mx-4" %>"> | ||
| <hr class="border-divider <%= classes || "mx-3 lg:mx-4" %>"> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,5 +30,16 @@ | |
| <%= render "transactions/searches/menu", form: form %> | ||
| <% end %> | ||
| <% end %> | ||
|
|
||
| <%= button_tag type: "button", | ||
| id: "toggle-checkboxes-button", | ||
| aria: { label: t(".toggle_selection_checkboxes") }, | ||
| class: "lg:hidden font-medium whitespace-nowrap inline-flex items-center gap-1 rounded-lg px-3 py-2 text-sm text-primary border border-secondary hover:bg-surface-hover", | ||
| data: { | ||
| action: "click->checkbox-toggle#toggle", | ||
| checkbox_toggle_target: "toggleButton" | ||
| } do %> | ||
| <%= icon("list-todo") %> | ||
| <% end %> | ||
|
Comment on lines
+34
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg "toggle_selection_checkboxes" config/locales/ -A 2 -B 2Repository: we-promise/sure Length of output: 41 🏁 Script executed: cat -n app/views/transactions/searches/_form.html.erb | sed -n '34,43p'Repository: we-promise/sure Length of output: 618 🏁 Script executed: # Check for any related i18n keys in the transactions search form locale
rg "transactions\.searches\.form\." config/locales/ | head -20Repository: we-promise/sure Length of output: 41 Add the missing i18n key to your locale files. The button uses Add the key to your locale files: # config/locales/en.yml (or appropriate locale)
en:
transactions:
searches:
form:
toggle_selection_checkboxes: "Toggle all checkboxes" # or appropriate label textThe rest of the implementation (Stimulus bindings, icon helper, Tailwind tokens, semantic HTML) is correct. 🤖 Prompt for AI Agents |
||
| </div> | ||
| <% end %> | ||
Uh oh!
There was an error while loading. Please reload this page.