studio-engine 0.141.1 → 0.141.3
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile +11 -0
- data/app/assets/stylesheets/studio/sticky_table_header.css +8 -4
- data/app/javascript/studio/controllers/link_preview_card_controller.js +7 -1
- data/app/javascript/studio/in_page_links.js +11 -4
- data/app/javascript/studio/link_preview_card.js +8 -0
- data/app/javascript/studio/sticky_table_header.js +17 -6
- data/app/views/studio/_page_header.html.erb +3 -1
- data/db/migrate/20260620000001_create_studio_links.rb +1 -1
- data/db/migrate/20260623130000_create_studio_enumerals.rb +3 -3
- data/db/migrate/20260901000001_create_studio_knowledge_docs.rb +4 -2
- data/db/migrate/20260902000001_create_studio_knowledge_expectations.rb +2 -1
- data/db/migrate/20261108130000_create_studio_connections.rb +1 -1
- data/db/migrate/20261108160000_require_slugs_on_engine_tables.rb +2 -2
- data/lib/studio/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca078eb9a5dbe6acfd9979b40081b446fc4a74455e21b9b8417a595225a19b42
|
|
4
|
+
data.tar.gz: 15c40bf152b5e6a6cd0d8459a22e2a32543a86c2c0821573b10e669afc5da63f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 35b1aeb4b523008613f191d4782482464ecf8048b75a7175177c944e4e7f2e170da64ab0435470d442aa6d8be08f83a4cca5bfd0f4e30ee804820cec73e65d12
|
|
7
|
+
data.tar.gz: de8d944eac95a2f399bd328e2513b95145eb208ea8f38600d188ec6b1ad7069240d4fb4c12324b25b650e66d40d9c45225c1d7374b6f0e66266a523b567233fe
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ The format is [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This pro
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.141.3 — 2026-11-09
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **Engine migrations pass a host's omakase lint.** Hosts copy `db/migrate/*.rb` as `*.studio_engine.rb` and lint the copies as their own; four engine migrations used `["a"]` where rubocop-rails-omakase wants `[ "a" ]`, which turned moms-app's release static check red. The sources are fixed (whitespace only, no behavior change), and `test/lib/migrations_host_lint_test.rb` runs the omakase config over `db/migrate` so a lint-red migration cannot ship. A host that already copied a migration keeps its copy; a host that hand-fixed one keeps its fix.
|
|
12
|
+
- **The sticky table header's copy no longer draws over the pinned page header.** As a table scrolled out, the copy was pushed up by the table's bottom into the page header's band, and at the same z-index (`--z-sticky`) it painted over the title, because it is appended to `<body>` and wins the tie (Turf Monster `/contests`, My Contests). The copy now stays at the pinned stack's bottom edge and gets shorter as the table leaves, with the copied row moving up inside it, and it stacks at `--z-sticky - 2`, under the page header and the stuck section header. `StudioStickyTableHeaders.placement` now also returns `height` and `shift`; `top` is never above `edge`. No host change.
|
|
13
|
+
|
|
14
|
+
## 0.141.2 — 2026-11-09
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **The link-preview card shows text typed before its controller loads.** The `link-preview-card` controller is registered lazily, so an operator could type in /admin/link_preview before it listened, and the card kept the saved title. `connect()` now paints the card from the fields as they stand (`paintAll` in `studio/link_preview_card`). No host change.
|
|
19
|
+
- **An in-page jump ends at the browser's scrollend, not at a quiet spell.** `studio/in_page_links` ended a smooth jump after 150 ms with no scroll event, even in a browser that fires `scrollend`. On a slow main thread (a phone, or CI at 8x CPU) a smooth scroll's frames come further apart than that, so the jump ended at its first frame: the tab highlight followed the passing sections, and a target that moved on the way (a lazy feed above it) was not aimed at again. Now only `scrollend` ends a scroll that moved, where the browser has it; the quiet spell stays for a browser without it, and the 400 ms cap still ends a scroll that never starts. Nothing for a consumer to do.
|
|
20
|
+
|
|
7
21
|
## 0.141.1 — 2026-11-09
|
|
8
22
|
|
|
9
23
|
### Fixed
|
data/Gemfile
CHANGED
|
@@ -110,3 +110,14 @@ end
|
|
|
110
110
|
group :development, :test do
|
|
111
111
|
gem "importmap-rails", ">= 2.0"
|
|
112
112
|
end
|
|
113
|
+
|
|
114
|
+
# rubocop-rails-omakase lints the engine's MIGRATIONS with the config a host
|
|
115
|
+
# runs. Hosts copy db/migrate/*.rb into their own tree as *.studio_engine.rb, so
|
|
116
|
+
# an engine migration is linted by every host that installs it; moms-app runs
|
|
117
|
+
# this exact omakase config, and a copied migration once turned its release
|
|
118
|
+
# static check red over `["a"]` vs `[ "a" ]`. test/lib/migrations_host_lint_test.rb
|
|
119
|
+
# runs it over db/migrate only. Not a runtime dependency, and not a whole-engine
|
|
120
|
+
# style rule: the rest of the engine keeps its own style.
|
|
121
|
+
group :development, :test do
|
|
122
|
+
gem "rubocop-rails-omakase", require: false
|
|
123
|
+
end
|
|
@@ -25,10 +25,14 @@
|
|
|
25
25
|
display: none;
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
pointer-events: none;
|
|
28
|
-
/* --z-sticky:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/* TWO RUNGS UNDER --z-sticky: under the pinned page header (--z-sticky) and the
|
|
29
|
+
stuck section header (--z-sticky - 1), and still over --z-raised content. It
|
|
30
|
+
fakes a sticky <thead>, so a side panel or a menu opened over the table still
|
|
31
|
+
covers it. At --z-sticky itself it TIED the page header, and a tie goes to the
|
|
32
|
+
later element: this one is appended to <body>, so it painted over the title.
|
|
33
|
+
The script also never places it above the stack's bottom edge
|
|
34
|
+
(sticky_table_header.js, placement), so the rung is the second guard. */
|
|
35
|
+
z-index: calc(var(--z-sticky, 30) - 2);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
.sticky-table-header-clone table {
|
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
//
|
|
8
8
|
// The repaint is studio/link_preview_card. One listener on the root takes the
|
|
9
9
|
// `input` of every [data-link-preview-input] inside it.
|
|
10
|
+
//
|
|
11
|
+
// The controller is registered lazily, so its module arrives after the page has
|
|
12
|
+
// loaded and an operator can type before connect() listens. That input event is
|
|
13
|
+
// gone, so connect() also paints the card from the fields as they stand
|
|
14
|
+
// (e2e/site_identity.spec.js holds the module back to prove it).
|
|
10
15
|
import { Controller } from "@hotwired/stimulus"
|
|
11
|
-
import { paintCard } from "studio/link_preview_card"
|
|
16
|
+
import { paintCard, paintAll } from "studio/link_preview_card"
|
|
12
17
|
|
|
13
18
|
export default class extends Controller {
|
|
14
19
|
connect() {
|
|
@@ -17,6 +22,7 @@ export default class extends Controller {
|
|
|
17
22
|
if (input && input.matches && input.matches("[data-link-preview-input]")) paintCard(this.element, input)
|
|
18
23
|
}
|
|
19
24
|
this.element.addEventListener("input", this.repaint)
|
|
25
|
+
paintAll(this.element)
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
disconnect() {
|
|
@@ -36,7 +36,10 @@ export const SCROLL_END_EVENT = "studio:in-page-scroll-end"
|
|
|
36
36
|
export const STATE_KEY = "studioInPage"
|
|
37
37
|
// The mark on a target that took tabindex=-1 for focus here; engine.css draws no ring on it.
|
|
38
38
|
export const FOCUS_MARK = "data-in-page-focus"
|
|
39
|
-
// No scroll for this long ends the scroll, where the browser has no scrollend event.
|
|
39
|
+
// No scroll for this long ends the scroll, where the browser has no scrollend event. Where it
|
|
40
|
+
// has one, only scrollend ends a scroll that moved: on a slow main thread (a phone, or CI at
|
|
41
|
+
// 8x CPU) a smooth scroll's frames come further apart than this, and a quiet spell ended the
|
|
42
|
+
// jump at its first frame. Then the target moved and nothing aimed again.
|
|
40
43
|
export const SETTLE_MS = 150
|
|
41
44
|
// A scroll the reader never sees move still ends: the cap for a scroll that never starts.
|
|
42
45
|
export const START_CAP_MS = 400
|
|
@@ -188,9 +191,11 @@ export function installInPageLinks(doc) {
|
|
|
188
191
|
// target was at the start. Content that grows on the way (a lazy frame the scroll passes,
|
|
189
192
|
// the navbar's collapse) moves the target, so the scroll aims again, up to MAX_AIMS times,
|
|
190
193
|
// until the reader takes over (a wheel, a touch, a key, a press). The end is the browser's
|
|
191
|
-
// scrollend where it has one, a quiet spell where not; then the end event, once.
|
|
194
|
+
// scrollend where it has one, a quiet spell where not; then the end event, once. A scroll
|
|
195
|
+
// that never starts ends at the cap either way.
|
|
192
196
|
const jump = (target, behavior) => {
|
|
193
197
|
if (settling) settling()
|
|
198
|
+
const hasScrollend = "onscrollend" in win
|
|
194
199
|
let quiet = null
|
|
195
200
|
let cap = null
|
|
196
201
|
let aims = 0
|
|
@@ -226,7 +231,9 @@ export function installInPageLinks(doc) {
|
|
|
226
231
|
const onScroll = () => {
|
|
227
232
|
win.clearTimeout(cap)
|
|
228
233
|
reaim()
|
|
229
|
-
|
|
234
|
+
// The scroll has started: with scrollend, it alone ends it (an aim's cap is spent too).
|
|
235
|
+
if (hasScrollend) win.clearTimeout(quiet)
|
|
236
|
+
else wait(SETTLE_MS)
|
|
230
237
|
}
|
|
231
238
|
const stop = () => {
|
|
232
239
|
reader = true
|
|
@@ -234,7 +241,7 @@ export function installInPageLinks(doc) {
|
|
|
234
241
|
}
|
|
235
242
|
settling = stop
|
|
236
243
|
win.addEventListener("scroll", onScroll, { passive: true })
|
|
237
|
-
if (
|
|
244
|
+
if (hasScrollend) win.addEventListener("scrollend", end)
|
|
238
245
|
for (const name of INPUTS) win.addEventListener(name, takeOver, { capture: true, passive: true })
|
|
239
246
|
cap = win.setTimeout(end, START_CAP_MS)
|
|
240
247
|
scrollTo(target, behavior)
|
|
@@ -32,3 +32,11 @@ export function paintCard(page, input) {
|
|
|
32
32
|
target.textContent = text
|
|
33
33
|
return text
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
// Repaints the card from every [data-link-preview-input] on the page, as each
|
|
37
|
+
// field stands now. The controller calls it on connect: it is registered
|
|
38
|
+
// lazily, so an operator can type before it listens, and that input event is
|
|
39
|
+
// gone.
|
|
40
|
+
export function paintAll(page) {
|
|
41
|
+
page.querySelectorAll("[data-link-preview-input]").forEach((input) => paintCard(page, input))
|
|
42
|
+
}
|
|
@@ -57,11 +57,22 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// Where the clone goes for one table, as a pure function of what was measured:
|
|
60
|
-
// shown once the real header has scrolled up to the edge, and
|
|
61
|
-
// table's own bottom
|
|
60
|
+
// shown once the real header has scrolled up to the edge, and gone once the
|
|
61
|
+
// table's own bottom has.
|
|
62
|
+
//
|
|
63
|
+
// IT NEVER RISES ABOVE THE EDGE. As the table leaves, the clone used to be
|
|
64
|
+
// pushed up by the table's bottom (top = tableBottom - cloneHeight), and that
|
|
65
|
+
// slid it into the pinned page header's band, where it painted over the title
|
|
66
|
+
// (Turf Monster /contests: CONTEST / STATUS / ENTRY over "Contests"). A glass
|
|
67
|
+
// header is translucent, so even a clone stacked under it would show through.
|
|
68
|
+
// Now the shell stays at the edge and gets SHORTER, `height` = what is left of
|
|
69
|
+
// the table below the edge, and the copied row moves up inside it by `shift`
|
|
70
|
+
// (zero or negative), so the row still leaves with the table, cut at the edge.
|
|
62
71
|
function placement({ edge, headerTop, tableBottom, cloneHeight }) {
|
|
63
72
|
const active = headerTop <= edge && tableBottom > edge;
|
|
64
|
-
return { active, top:
|
|
73
|
+
if (!active) return { active, top: null, height: null, shift: null };
|
|
74
|
+
const height = Math.min(cloneHeight, tableBottom - edge);
|
|
75
|
+
return { active, top: edge, height, shift: height - cloneHeight };
|
|
65
76
|
}
|
|
66
77
|
|
|
67
78
|
window.StudioStickyTableHeaders = { loaded: true, pinnedEdge, placement };
|
|
@@ -151,7 +162,7 @@
|
|
|
151
162
|
const tableRect = this.table.getBoundingClientRect();
|
|
152
163
|
const scrollerRect = this.scroller.getBoundingClientRect();
|
|
153
164
|
const cloneHeight = headerRect.height || this.cloneShell.getBoundingClientRect().height;
|
|
154
|
-
const { active, top } = placement({
|
|
165
|
+
const { active, top, height, shift } = placement({
|
|
155
166
|
edge, headerTop: headerRect.top, tableBottom: tableRect.bottom, cloneHeight
|
|
156
167
|
});
|
|
157
168
|
|
|
@@ -169,9 +180,9 @@
|
|
|
169
180
|
this.cloneShell.style.left = `${scrollerRect.left}px`;
|
|
170
181
|
this.cloneShell.style.top = `${top}px`;
|
|
171
182
|
this.cloneShell.style.width = `${scrollerRect.width}px`;
|
|
172
|
-
this.cloneShell.style.height = `${
|
|
183
|
+
this.cloneShell.style.height = `${height}px`;
|
|
173
184
|
this.cloneTable.style.width = `${tableRect.width}px`;
|
|
174
|
-
this.cloneTable.style.transform = `
|
|
185
|
+
this.cloneTable.style.transform = `translate(${translateX}px, ${shift}px)`;
|
|
175
186
|
this.table.setAttribute("data-sticky-table-active", "true");
|
|
176
187
|
}
|
|
177
188
|
}
|
|
@@ -58,7 +58,9 @@
|
|
|
58
58
|
IT JOINS THE STACK WITH data-pin="page" AND POSITIONS OFF --pin-page-top, the
|
|
59
59
|
bottom of everything above it. --pin-stack-bottom includes the row's own edge,
|
|
60
60
|
so a row positioned off it would chase itself down the page. Anything below,
|
|
61
|
-
such as the sticky table header's clone, sits under the row
|
|
61
|
+
such as the sticky table header's clone, sits under the row: the clone starts
|
|
62
|
+
at the stack's bottom edge, never above it, and stacks two rungs under the
|
|
63
|
+
row's --z-sticky (studio/sticky_table_header.css).
|
|
62
64
|
|
|
63
65
|
THE SENTINEL stays at the row's place in the flow, and the row's distance from
|
|
64
66
|
it is what "stuck" means, on every kind of header. It is absolutely positioned,
|
|
@@ -21,7 +21,7 @@ class CreateStudioLinks < ActiveRecord::Migration[7.2]
|
|
|
21
21
|
add_index :studio_links, :kind
|
|
22
22
|
# Covers both "this owner's links" and "this owner's referral" lookups
|
|
23
23
|
# (referral_for) via the leading columns.
|
|
24
|
-
add_index :studio_links, [:linkable_type, :linkable_id, :kind],
|
|
24
|
+
add_index :studio_links, [ :linkable_type, :linkable_id, :kind ],
|
|
25
25
|
name: "idx_studio_links_owner_kind"
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -23,8 +23,8 @@ class CreateStudioEnumerals < ActiveRecord::Migration[7.2]
|
|
|
23
23
|
t.timestamps
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
add_index :studio_enumerals, [:category, :key], unique: true
|
|
27
|
-
add_index :studio_enumerals, [:category, :position]
|
|
28
|
-
add_index :studio_enumerals, [:category, :rank]
|
|
26
|
+
add_index :studio_enumerals, [ :category, :key ], unique: true
|
|
27
|
+
add_index :studio_enumerals, [ :category, :position ]
|
|
28
|
+
add_index :studio_enumerals, [ :category, :rank ]
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
#
|
|
7
7
|
# STYLE NOTE: reference migrations are written omakase-rubocop-compatible
|
|
8
8
|
# (spaces inside array brackets) because the installed copy is linted by the
|
|
9
|
-
# CONSUMER's rubocop
|
|
10
|
-
#
|
|
9
|
+
# CONSUMER's rubocop — an engine-styled copy fails the consumer's cert
|
|
10
|
+
# untouched (measured on the Industries adoption ship).
|
|
11
|
+
# test/lib/migrations_host_lint_test.rb runs that omakase config over
|
|
12
|
+
# db/migrate, so a lint-red migration fails here first.
|
|
11
13
|
class CreateStudioKnowledgeDocs < ActiveRecord::Migration[7.2]
|
|
12
14
|
def change
|
|
13
15
|
create_table :studio_knowledge_docs do |t|
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
#
|
|
6
6
|
# STYLE NOTE: reference migrations are written omakase-rubocop-compatible
|
|
7
7
|
# (spaces inside array brackets) because the installed copy is linted by the
|
|
8
|
-
# CONSUMER's rubocop
|
|
8
|
+
# CONSUMER's rubocop. test/lib/migrations_host_lint_test.rb runs that omakase
|
|
9
|
+
# config over db/migrate, so a lint-red migration fails here first.
|
|
9
10
|
class CreateStudioKnowledgeExpectations < ActiveRecord::Migration[7.2]
|
|
10
11
|
def change
|
|
11
12
|
create_table :studio_knowledge_expectations do |t|
|
|
@@ -42,7 +42,7 @@ class RequireSlugsOnEngineTables < ActiveRecord::Migration[7.2]
|
|
|
42
42
|
"studio_geo_settings" => "geo",
|
|
43
43
|
"studio_site_identities" => "site-identity"
|
|
44
44
|
}.freeze
|
|
45
|
-
TABLES = (["error_logs"] + NAMED.keys).freeze
|
|
45
|
+
TABLES = ([ "error_logs" ] + NAMED.keys).freeze
|
|
46
46
|
|
|
47
47
|
def up
|
|
48
48
|
set_lock_timeout
|
|
@@ -111,7 +111,7 @@ class RequireSlugsOnEngineTables < ActiveRecord::Migration[7.2]
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
def unique_slug_index(table)
|
|
114
|
-
slug_indexes = connection.indexes(table).select { |index| Array(index.columns) == ["slug"] }
|
|
114
|
+
slug_indexes = connection.indexes(table).select { |index| Array(index.columns) == [ "slug" ] }
|
|
115
115
|
return if slug_indexes.any?(&:unique)
|
|
116
116
|
|
|
117
117
|
slug_indexes.each { |index| remove_index table, name: index.name }
|
data/lib/studio/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: studio-engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.141.
|
|
4
|
+
version: 0.141.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex McRitchie
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|