recourse 4.1.2 → 4.2.0

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: af93482d287e4e17a767eda579b65e6e1be6a1b137ba0b60f4bcb81d079afbc7
4
- data.tar.gz: e345935ababe4e104054f2072cdb2a0f270cd0fa651946a40b96178fef318a38
3
+ metadata.gz: 37d576acaaf1fd87766eb000852a30004862d606e02ea950577f76a3d4f8c8ee
4
+ data.tar.gz: af168a49adf4d3df402ee1f6f093cefe3528dbcfb77727ada7b1270539006475
5
5
  SHA512:
6
- metadata.gz: e9270aa3d092c1c760ca0a9b2a7fcdb754afb8fcbdeb48def3a8afb6ad7218ec96d48e10ed20bd13c1893c49e025bacc0016c5fe895fe5cabd56cb3f8cd7cbef
7
- data.tar.gz: 9218b731e6d782dc16b1fa26480367dbe5867cc8945fd7102d3d03b5dd64d399c3496e0edb4b24e13a67f6176650c11b005c633cbe7511405f1ca49454b13f73
6
+ metadata.gz: bf99a21586c91bb03722206dc18f289cc49338c659e6ef0c3ffeac37ede0aba147ac80f1da437df3ab21c0b59951fcb2ecf86e0d6c2b411e8c465a59a17b48c3
7
+ data.tar.gz: 966f579457d4917bf4b9f17f2efe65bda9445b0e013d7cff33712fc07e027bfe6606cb0e78c45d2b11c26c42dfdcaf014c78e54ad3e9df8ca71c167b94cfef8c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ 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.2.0 - 2026-09-08
9
+
10
+ * [Feature] The log-out button sits beside the light/dark toggle
11
+
12
+ The two share the sidebar's foot, each centered in its own half, and a hover tints
13
+ either under a rounded corner.
14
+
15
+ * [Fix] A bookmark click no longer marks the row green
16
+ * [Fix] The log-out button is submitted by the browser, not by Turbo
17
+
18
+ A log out ends with a redirect to wherever the host signs people in, which is
19
+ another origin a fetch cannot follow, so the click left the page where it was.
20
+
21
+ The kept tint taking or leaving is the whole report.
22
+
8
23
  ## 4.1.2 - 2026-09-08
9
24
 
10
25
  * [Fix] The engine requires turbo-rails after Rails, not before
@@ -1,6 +1,5 @@
1
1
  import { Controller } from '/recourse/stimulus.js'
2
2
  import { flash } from '/recourse/flash.js'
3
- import { marked } from '/recourse/written.js'
4
3
 
5
4
  // The square that keeps a row, answered before the server does. The icon flips under
6
5
  // the cursor and the request goes in the background, so the table is never redrawn and
@@ -78,13 +77,11 @@ export default class extends Controller {
78
77
  })
79
78
  if (!response.ok) return this.revert(kept)
80
79
 
81
- // Two halves of one report, and the reason there is no toast. The tint lasts and
82
- // says which rows are kept; the mark passes and says this one was written just
83
- // now the same outline a create or an update leaves while its message stands.
84
- // The icon flipped on the click and would have flipped under a request that
85
- // never landed, so both are the half only the server can give.
80
+ // The report, and the reason there is no toast: the row takes or loses its tint,
81
+ // which says which rows are kept. The icon flipped on the click and would have
82
+ // flipped under a request that never landed, so this is the half only the server
83
+ // can give.
86
84
  this.row?.classList.toggle('recourse-kept', kept)
87
- marked(this.row)
88
85
  } catch {
89
86
  this.revert(kept)
90
87
  }
@@ -1,7 +1,5 @@
1
- // The mark a write leaves on the row it landed on, and how long it stands for. Two
2
- // things write rows here and both say so this way: a create or an update, which has a
3
- // toast to keep time with, and the square that keeps a row, which has none — so the
4
- // marking is here and the clock belongs to whoever calls it.
1
+ // The mark a create or an update leaves on the row it landed on, and how long the toast
2
+ // saying so stands the one clock, which the toast controller reads too.
5
3
  export const DELAY = 2000
6
4
 
7
5
  // Marked, and handed back the way to let it go. Letting go swaps one class for the
@@ -20,10 +18,3 @@ export function mark(row) {
20
18
  row.classList.add('recourse-written-out')
21
19
  }
22
20
  }
23
-
24
- // And the same, on a clock of its own, for a write with no message to keep time with.
25
- export function marked(row) {
26
- const fade = mark(row)
27
-
28
- setTimeout(fade, DELAY)
29
- }
@@ -335,12 +335,23 @@
335
335
  .table > tbody > .recourse-written-out > * { animation: none; }
336
336
  }
337
337
 
338
- /* The scheme toggle sits at the foot of the sidebar and centered across it while
339
- the sidebar is a column, and is simply the last item of the row while it is not
338
+ /* The foot of the sidebar holds the scheme toggle and the way out side by side,
339
+ each centered in its own half of the row: the toggle alone is in the middle, and
340
+ the two together are at a quarter and at three quarters. Each control sits in
341
+ a wrapper — the toggle's own, the form `button_to` draws — and the wrapper is
342
+ the half, so a button is only as wide as its icon and so is its hover. */
343
+ .recourse-foot { display: flex; }
344
+ .recourse-foot > * { flex: 1 1 0; display: flex; justify-content: center; }
345
+ .recourse-foot .nav-link { border-radius: var(--bs-radius-5); }
346
+ /* A hand cursor alone says little on an icon: a tint under it says it is a control. */
347
+ .recourse-foot .nav-link:hover { background-color: var(--bs-bg-1); color: var(--bs-fg-body); }
348
+
349
+ /* The foot sits at the bottom of the sidebar and stretches across it while the
350
+ sidebar is a column, and is simply the last item of the row while it is not
340
351
  — the query matches the `md:` the sidebar's own classes use. Both lines are
341
352
  needed: `.nav-item` ships `flex: auto`, so every item would take an equal share
342
353
  of a full-height nav and the auto margin would never have anything left to
343
- push against. Pin the items to their own height and the toggle takes the rest. */
354
+ push against. Pin the items to their own height and the foot takes the rest. */
344
355
  @media (width >= 768px) {
345
356
  /* A floor rather than a height, and never wrapped. `.nav` ships `flex-wrap:
346
357
  wrap`, and a column that may wrap, whose items are pinned to their own height
@@ -351,17 +362,17 @@
351
362
  .recourse-sidebar .nav-item { flex: 0 0 auto; }
352
363
  /* And it rides at the foot of the screen, which the auto margin alone is
353
364
  enough to do: the nav's floor is the sidebar's full height, so while the
354
- links leave room the margin takes all of it and the toggle sits on the fold,
365
+ links leave room the margin takes all of it and the foot sits on the fold,
355
366
  rising with it as the window is shortened. Once the links fill the nav there
356
- is no room left to take, and the toggle comes to rest immediately below the
367
+ is no room left to take, and the foot comes to rest immediately below the
357
368
  last of them and goes under the fold with it, to be scrolled to.
358
369
  Deliberately not sticky. Sticking it to the bottom of the viewport would lift
359
370
  it off that resting place and hold it over the links it had passed — which is
360
371
  what the background color was for, masking whichever one it covered. Both go
361
372
  together: nothing is painted over, so nothing needs painting out. */
362
- .recourse-sidebar .recourse-scheme {
373
+ .recourse-sidebar .recourse-foot {
363
374
  margin-block-start: auto;
364
- align-self: center;
375
+ align-self: stretch;
365
376
  }
366
377
  }
367
378
 
@@ -9,32 +9,37 @@
9
9
  </li>
10
10
  <% end %>
11
11
 
12
- <%# A reader's own say in how the page looks: the last item of the sidebar, and at the
13
- foot of it wherever it is a column. Which side of the fold that lands on is the
14
- layout's business rather than this file's, and so is which of the two icons shows
15
- the mode may be the system's, which only CSS knows, so both are drawn. -%>
16
- <li class='nav-item recourse-scheme'>
17
- <%= tag.button type: 'button', class: 'nav-link border-0 bg-transparent',
18
- data: scheme_data do %>
19
- <span class='recourse-scheme-light'>
20
- <i class='bi bi-moon-fill'></i>
21
- <span class='visually-hidden'><%= t 'recourse.darken' %></span>
22
- </span>
23
- <span class='recourse-scheme-dark'>
24
- <i class='bi bi-sun-fill'></i>
25
- <span class='visually-hidden'><%= t 'recourse.lighten' %></span>
26
- </span>
27
- <% end %>
28
- </li>
29
-
30
- <%# And the way out, where the host drew a route named `exit`: a button, since ending
31
- a session is never a GET, and an icon like the toggle beside it. -%>
32
- <% if exit? %>
33
- <li class='nav-item recourse-exit'>
34
- <%= button_to exit_path, method: :delete, class: 'nav-link border-0 bg-transparent' do %>
12
+ <%# The foot of the sidebar: a reader's own say in how the page looks and, where the
13
+ host drew a route named `exit`, the way out beside it a button, since ending a
14
+ session is never a GET. Each takes half the row and centers its icon in it, so the
15
+ toggle alone sits in the middle and the two together sit at a quarter and at three
16
+ quarters. Which side of the fold the foot lands on is the layout's business, and so
17
+ is which of the two mode icons shows — the mode may be the system's, which only CSS
18
+ knows, so both are drawn. -%>
19
+ <li class='nav-item recourse-foot'>
20
+ <%# In a wrapper of its own, as the way out is in its form: the wrapper is the half
21
+ of the row, and the button is only as wide as its icon. -%>
22
+ <div>
23
+ <%= tag.button type: 'button', class: 'nav-link border-0 bg-transparent',
24
+ data: scheme_data do %>
25
+ <span class='recourse-scheme-light'>
26
+ <i class='bi bi-moon-fill'></i>
27
+ <span class='visually-hidden'><%= t 'recourse.darken' %></span>
28
+ </span>
29
+ <span class='recourse-scheme-dark'>
30
+ <i class='bi bi-sun-fill'></i>
31
+ <span class='visually-hidden'><%= t 'recourse.lighten' %></span>
32
+ </span>
33
+ <% end %>
34
+ </div>
35
+ <%# Submitted by the browser rather than by Turbo: a log out ends with a redirect to
36
+ wherever the host signs people in, which is another origin a fetch cannot follow. -%>
37
+ <% if exit? %>
38
+ <%= button_to exit_path, method: :delete, class: 'nav-link border-0 bg-transparent',
39
+ form: { data: { turbo: false } } do %>
35
40
  <i class='bi bi-box-arrow-right'></i>
36
41
  <span class='visually-hidden'><%= t 'recourse.exit' %></span>
37
42
  <% end %>
38
- </li>
39
- <% end %>
43
+ <% end %>
44
+ </li>
40
45
  </ul>
@@ -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.1.2'
3
+ VERSION = '4.2.0'
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.1.2
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob