recourse 4.6.0 → 4.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 314d13d5c8a4e44ae907b432a9f8c37d3c4f3401cb12856127681077171c969f
4
- data.tar.gz: c389ca81f7dbad23c1f185b4f50ec479f901c7dace6d57d94020be9b811f8c80
3
+ metadata.gz: a11682ec07a267a79a700100c417432c8268dffcd6a99db8aa42cb00981b246c
4
+ data.tar.gz: 855173ce5c38e34bcd2f505e24737ff7cd3670bc2d0df98b38fa07ff7a566b9e
5
5
  SHA512:
6
- metadata.gz: 1b1492f1befaab5648685a8894d255a70a376c3dbd076218ebe68d0cc5c88345e6f1debcc7598745fd0ec8b68151967bd896730b0dc50b9c8fa282bcb5dfcdf0
7
- data.tar.gz: 213e0a0eefc0137b315ac8bfb35861286b72958edd686798a820a5a8388b627bd0f5905be5aa682027f4333eccb50291a42361788781a66d9b226a8ff9f19f12
6
+ metadata.gz: aa84eac5f4c6b850d5c1d205b3d7391ae4645a3797b1c59c36141e5125d53fde629dde0c65401071269a0f1038d4b2e8764cf9f70ff74ca7eb66a3473762baeb
7
+ data.tar.gz: b0ca8815ff3f8cdae21319c888818b6c70806cea7dd51e7da4df4e35a5d1805e55c7a7dd0ae0df29094438197aa9a483c7006197f346a97054d919062fc0ef83
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  For more information about changelogs, check [Keep a Changelog](http://keepachangelog.com) and
6
6
  [Vandamme](http://tech-angels.github.io/vandamme).
7
7
 
8
+ ## 4.6.2 - 2026-09-08
9
+
10
+ * [Fix] A filter menu on a page under a record no longer counts each option: the counts were of the whole table, not of the record's share of it
11
+
12
+ * [Fix] A counter's tooltip stays away on a phone that reports a coarse pointer, where a tap on `Franchises: 11` flashed it before the page changed
13
+
14
+ * [Fix] A filter's menu is no longer cut off at the foot of a short page — one whose table has no rows — on a phone
15
+
16
+ ## 4.6.1 - 2026-09-08
17
+
18
+ * [Fix] On a phone the arrows that put the words back ask for the page again rather than reshaping it in place, which in Safari left the sidebar's entries drawn one over the next until a reload
19
+
8
20
  ## 4.6.0 - 2026-09-08
9
21
 
10
22
  * [Fix] On a phone the `Displaying items` sentence is centered over the pagination links, which already were
@@ -3,15 +3,17 @@ import { Controller } from '/recourse/stimulus.js'
3
3
  // The arrows at the foot of the sidebar, drawn on a phone alone: a tap puts the words
4
4
  // back beside every icon the chrome shows — the sidebar's entries, the crumbs, the tabs,
5
5
  // the foot's own controls — and the next tap takes them away again. The choice goes to
6
- // the server in a cookie, the way the zone does, so the next page is drawn with the
7
- // words in rather than drawn without them and widened once a script runs.
6
+ // the server in a cookie, the way the zone does, and the page is asked for again rather
7
+ // than reshaped in place: Safari left the row of entries where it was when the words
8
+ // came out of hiding, one link over the next, until a reload laid it out afresh.
8
9
  export default class extends Controller {
9
10
  static values = { storage: String }
10
11
 
11
12
  toggle() {
12
- const expanded = document.body.classList.toggle('recourse-expanded')
13
- const density = expanded ? 'expanded' : 'compact'
13
+ const expanded = document.body.classList.contains('recourse-expanded')
14
+ const density = expanded ? 'compact' : 'expanded'
14
15
 
15
16
  document.cookie = `${this.storageValue}=${density}; path=/; max-age=31536000; samesite=lax`
17
+ window.Turbo.visit(window.location.href, { action: 'replace' })
16
18
  }
17
19
  }
@@ -8,9 +8,11 @@ import { Tooltip } from '/recourse/bootstrap.bundle.min.js'
8
8
  //
9
9
  // None where nothing can hover: on a touch screen the tap that would open a link
10
10
  // is also what shows a tooltip, and a word popping up over a tap reads as a hitch.
11
+ // Asked two ways, since an iPhone answered the first with a tooltip all the same: a
12
+ // screen that cannot hover, or a pointer too coarse to rest on one word of a row.
11
13
  export default class extends Controller {
12
14
  connect() {
13
- if (matchMedia('(hover: none)').matches) return
15
+ if (matchMedia('(hover: none), (pointer: coarse)').matches) return
14
16
 
15
17
  this.tooltip = Tooltip.getOrCreateInstance(this.element)
16
18
  }
@@ -108,8 +108,13 @@
108
108
  /* Nothing here is meant to be wider than the window: the one thing that is, a
109
109
  table, scrolls inside its own wrapper. Safari lays a stacked table's hidden
110
110
  header row out at its full width all the same, and a page that can be
111
- scrolled to it is a page Safari zooms out of and draws the navbar short on. */
112
- html, .recourse-shell { overflow-x: hidden; }
111
+ scrolled to it is a page Safari zooms out of and draws the navbar short on.
112
+ `clip` on the shell rather than `hidden`: a `hidden` axis turns the other into
113
+ `auto`, and the body then cut off whatever hung below it — a filter's menu, on a
114
+ page whose table had no rows to be taller than the menu. `clip` leaves the
115
+ other axis alone. */
116
+ html { overflow-x: hidden; }
117
+ .recourse-shell { overflow-x: clip; }
113
118
 
114
119
  /* A finger does not hover. The tint a pointer leaves on the row under it, or on
115
120
  the link under it, would stay on whatever was last touched — or land on whatever
@@ -69,8 +69,11 @@ module Recourse
69
69
  # The column on the model a filter lists that counts the rows being filtered —
70
70
  # `markets.zips_count` on `/zips`. Read from the counter caches that model keeps
71
71
  # rather than from a column named after this one, so a `zips_count` nobody
72
- # maintains is not a count.
72
+ # maintains is not a count. None on a nested page: the count is of every row in
73
+ # the table, and the page shows the parent's share of them, which nothing counted.
73
74
  def filter_counter(klass)
75
+ return if resource_parent
76
+
74
77
  klass.recourse_counters.find { |_, one| one.klass == resource_model }&.first
75
78
  end
76
79
 
@@ -1,4 +1,4 @@
1
1
  module Recourse
2
2
  # Version of the gem, read by the gemspec and by hosts checking compatibility.
3
- VERSION = '4.6.0'
3
+ VERSION = '4.6.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob