i18n_proofreading 0.11.1 → 0.12.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: e53c601f0d59bb568454af7a87e5cac5e60b0eefd798961758b11aa0ff627493
4
- data.tar.gz: 8a548e99b0aab7eb2bbac8ab1680a0bb5ab0b53ce9ead8306a3e5043319834cd
3
+ metadata.gz: 0dd116667dbbc3243bc9eb5ae929db378fd60d6354dc9101cde3c137474272dd
4
+ data.tar.gz: 67cb971e8e0d957f9ce6ccd6e3a39f102242588e7e6599945267423b7a32c0ba
5
5
  SHA512:
6
- metadata.gz: 1274c40b9ff99fbafcafb02488c14cd2f99f4d615f40a611f3e7e398b1e2c808bfb6bdc7e7f7c7e1d1036ce4f93e0ceac1e36083b893fedd71bea8e79b478bf4
7
- data.tar.gz: 1b3d39d2cf246ba8856de45bb51c562924000428d51245f1e6b85782a40b539661c2a3a543ac21a67ecc9d4648bb353fffeface1d16fcb2c1b414d84e3aeffcf
6
+ metadata.gz: dd83ae4d457202c63398da204778301533d78c575426591eb4c28acc58a299beab35ccbea8861a468688af0ea09e9a7c67053d299fe0174080377e58ada84b8c
7
+ data.tar.gz: e88607a7ebc036f1be84553bd88d995b99ca548992ed9e88d519f0f2497759d48933ce7520eed72524d0c804998c15a0d95aaec88384f7447ce94a44fcac6ee6
data/AGENTS.md CHANGED
@@ -102,6 +102,7 @@ Everything is optional; a fresh install works with zero config in development. F
102
102
  | `enabled_environments` | `%w[development staging]` | The hard gate. Never add production |
103
103
  | `enabled` | everyone | Per-request gate on top of the environment check |
104
104
  | `authorize_admin` | development only | **Who can read the dashboard.** Independent of the above |
105
+ | `base_controller_class` | `ActionController::Base` | Controller the dashboard inherits. Name your admin's and it adopts that layout, helpers, authentication and request context. Public endpoints never inherit it. |
105
106
  | `admin_layout` | `i18n_proofreading/application` | Render the dashboard in your admin shell |
106
107
  | `current_user` | `nil` | Receives the request |
107
108
  | `author_label` | email, else `to_s` | Receives the user |
@@ -119,6 +120,7 @@ The tool's own UI ships in 26 languages, RTL mirrored, and follows system light/
119
120
 
120
121
  | Symptom | Cause |
121
122
  | --- | --- |
123
+ | `NameError` for one of your own helpers in the dashboard | `isolate_namespace` scopes `helper` to the engine. Use `config.base_controller_class` so the dashboard inherits your helpers, rather than `admin_layout` alone. |
122
124
  | No pill, no outlines | The environment is not in `enabled_environments` (this is the usual one), or `config.enabled` returned false, or `show_pill = false` |
123
125
  | Pill appears but no strings are outlined | The I18n backend patch is only prepended in an enabled environment at boot — check you are actually in development/staging, and restart after changing the setting |
124
126
  | `/i18n_proofreading` returns a 403 | `authorize_admin` still at its development-only default |
@@ -129,6 +131,10 @@ The tool's own UI ships in 26 languages, RTL mirrored, and follows system light/
129
131
 
130
132
  ---
131
133
 
134
+ ## One family
135
+
136
+ `testimonials`, `ideasbugs`, `livechat`, `product_tours` are the sibling engines. Same install shape, same host hooks (`base_controller_class`, `admin_layout`), same scoped dashboard CSS, same `primary_key_type`-aware migrations — so what you learn here transfers.
137
+
132
138
  ## Working on the gem itself
133
139
 
134
140
  ```bash
@@ -145,5 +151,6 @@ Conventions this codebase holds to — follow them rather than the first thing t
145
151
  - **The tool never writes to the host's locale files.** That is why there is deliberately no update or destroy route, and why the dashboard is read-only. Do not add an "apply" action that edits YAML.
146
152
  - **The widget is injected by middleware and served same-origin**, which is what keeps it working under a nonce-based CSP with `strict-dynamic` across Turbo body swaps. Do not inline it.
147
153
  - **Key marking must degrade to plain strings.** A host that reads translations outside a request, or in an environment where the tool is off, has to get ordinary values back.
154
+ - **`lib/i18n_proofreading/dashboard.css` is half shared.** Everything above the `GEM-SPECIFIC` banner is the design system all five gems in the family ship — the same tokens, the same `.page-head`/`.tabs`/`.filters`/`.card`/`.badge`/`button`, the same `.dashboard-shell` + `.record-row` + `.detail-panel` two-pane dashboard — identical in every repo apart from the `ip` prefix. Diff it against a sibling before changing it, and carry the change to the other four. Anything only this gem has goes below the banner. New dashboard markup reuses the shared class names rather than inventing a domain-specific one.
148
155
  - Every user-facing change bumps `lib/i18n_proofreading/version.rb` and adds a `CHANGELOG.md` entry (Keep a Changelog format) that says what it costs, not only what it adds.
149
156
  - Commit messages are prose that explains the tradeoff — read `git log` before writing one.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0
4
+
5
+ - **One design system across the family.** The stylesheet now opens with a
6
+ shared core — the colour tokens, `.page-head`, `.tabs`, `.filters`, `.card`,
7
+ `.badge`, buttons and form controls, and the `.dashboard-shell` +
8
+ `.record-row` + `.detail-panel` two-pane dashboard — identical in all five
9
+ gems of the family, apart from the `--ip-` prefix. The five had drifted:
10
+ sidebars between 380px and 430px, reading columns between 860px and 1020px,
11
+ two different tab styles and three different button styles. The sidebar is
12
+ now 330–430px everywhere, a reading page 1020px, a dashboard 1280px.
13
+ Everything below the `GEM-SPECIFIC` banner is what only this gem has.
14
+ - **The dashboard markup uses the shared class names.** `.review-shell`,
15
+ `.review-sidebar` and `.review-detail` are `.dashboard-shell`,
16
+ `.dashboard-sidebar` and `.dashboard-detail`; `.suggestion-list`,
17
+ `.suggestion-row`, `.suggestion-main`, `.suggestion-topline`,
18
+ `.suggestion-copy`, `.suggestion-meta` and `.suggestion-time` are
19
+ `.record-*`; `.suggestion-panel` is `.detail-panel`; the page heading is a
20
+ `.page-head` rather than a `header.page`, and the status badge in a row sits
21
+ in `.record-side`. A card is unpadded until you add `.pad`, as in the other
22
+ four gems, and the empty state lost its dashed border. If you styled or
23
+ scripted any of those names in a host app, that is the breaking change — no
24
+ configuration, route or database change is involved.
25
+ - **The narrow-screen rules work again.** The `max-width: 760px` block sat above
26
+ the component rules it means to override, and CSS nesting adds no specificity,
27
+ so the desktop grid won every tie: showing one pane at a time on a phone had
28
+ quietly stopped working. The media query moved to the end of the file.
29
+ - Smaller fixes that came with the shared core: a submit input is styled as a
30
+ button rather than a full-width field, the filter row keeps its search box and
31
+ button on one line, and a `code.key` truncates inside a list row instead of
32
+ wrapping over three lines.
33
+ - **The dashboard subtitle is gone,** and with it the
34
+ `i18n_proofreading.dashboard.subtitle` translation key. The page said what the
35
+ three tabs already say. If you overrode that key in your own locale file, the
36
+ override is now dead weight — nothing reads it.
37
+
3
38
  ## 0.11.0
4
39
 
5
40
  - **`config.admin_layout` now works on its own.** The dashboard's stylesheet was
data/README.md CHANGED
@@ -298,13 +298,24 @@ bundle exec rubocop
298
298
 
299
299
  Tests run against a dummy Rails app in `test/dummy`.
300
300
 
301
- ## Also by the same author
302
-
303
- - [testimonials](https://github.com/yshmarov/testimonials) testimonials,
304
- reviews and NPS for Rails.
305
- - [ideasbugs](https://github.com/yshmarov/ideasbugs) — in-app bug reports and
306
- feature requests.
307
- - [SupeRails](https://superails.com) Rails screencasts.
301
+ ## One family
302
+
303
+ Five Rails engines built on the same backbone, so adopting a second one is
304
+ mostly muscle memory:
305
+
306
+ | Gem | What it does |
307
+ | --- | --- |
308
+ | [testimonials](https://github.com/yshmarov/testimonials) | Testimonials, reviews and NPS — text and video, collected in your own app |
309
+ | [ideasbugs](https://github.com/yshmarov/ideasbugs) | In-app bug reports and feature requests, with a triage queue |
310
+ | [livechat](https://github.com/yshmarov/livechat) | Live chat between your visitors and your agents, self-hosted |
311
+ | [product_tours](https://github.com/yshmarov/product_tours) | Product tours and video tutorials, shown in-app at the right moment |
312
+ | **i18n_proofreading** *(this gem)* | In-context translation fixes suggested by your own users |
313
+
314
+ They share the install shape (`generate <gem>:install`, mount, one initializer),
315
+ the same host hooks (`base_controller_class` to inherit your admin's controller,
316
+ `admin_layout` for just the shell), one dashboard design system — the same
317
+ two-pane layout, colour tokens and components in all five, scoped so it cannot
318
+ touch your own CSS — and migrations that follow your app's `primary_key_type`.
308
319
 
309
320
  ## License
310
321
 
@@ -1,4 +1,4 @@
1
- <section class="suggestion-panel">
1
+ <section class="detail-panel">
2
2
  <div class="panel-head">
3
3
  <h1>
4
4
  <code class="key"><%= suggestion.translation_key %></code>
@@ -1,13 +1,12 @@
1
1
  <% content_for :body_class, 'ip-index' %>
2
2
 
3
3
  <%= render layout: 'i18n_proofreading/shared/dashboard' do %>
4
- <header class="page">
4
+ <div class="page-head">
5
5
  <h1><%= t('i18n_proofreading.dashboard.title', default: 'I18nProofreading') %></h1>
6
- <p class="lede"><%= t('i18n_proofreading.dashboard.subtitle', default: 'Review what reviewers proposed, then apply it to your locale files.') %></p>
7
- </header>
6
+ </div>
8
7
 
9
- <div class="review-shell <%= 'has-selected' if @selected_suggestion %>">
10
- <aside class="review-sidebar" aria-label="<%= t('i18n_proofreading.dashboard.suggestions', default: 'Suggestions') %>">
8
+ <div class="dashboard-shell <%= 'has-selected' if @selected_suggestion %>">
9
+ <aside class="dashboard-sidebar" aria-label="<%= t('i18n_proofreading.dashboard.suggestions', default: 'Suggestions') %>">
11
10
  <nav class="tabs">
12
11
  <% I18nProofreading::Suggestion::STATUSES.each do |status| %>
13
12
  <%= link_to suggestions_path(status: status, locale: @locale),
@@ -34,30 +33,32 @@
34
33
  </form>
35
34
  <% end %>
36
35
 
37
- <div class="suggestion-list">
36
+ <div class="record-list">
38
37
  <% if @suggestions.any? %>
39
38
  <% @suggestions.each do |suggestion| %>
40
39
  <%= link_to suggestions_path(status: @status, locale: @locale, page: @page,
41
40
  suggestion_id: suggestion.id),
42
- class: ['suggestion-row', ('active' if @selected_suggestion&.id == suggestion.id)].compact do %>
43
- <span class="suggestion-main">
44
- <span class="suggestion-topline">
41
+ class: ['record-row', ('active' if @selected_suggestion&.id == suggestion.id)].compact do %>
42
+ <span class="record-main">
43
+ <span class="record-topline">
45
44
  <code class="key"><%= suggestion.translation_key %></code>
46
45
  <span class="badge locale"><%= suggestion.locale %></span>
47
- <span class="muted suggestion-time" title="<%= suggestion.created_at %>">
46
+ <span class="muted record-time" title="<%= suggestion.created_at %>">
48
47
  <%= time_ago_in_words(suggestion.created_at) %> <%= t('i18n_proofreading.dashboard.ago', default: 'ago') %>
49
48
  </span>
50
49
  </span>
51
- <span class="suggestion-copy" dir="auto"><%= truncate(suggestion.proposed_value, length: 110) %></span>
52
- <span class="muted suggestion-meta">
50
+ <span class="record-copy" dir="auto"><%= truncate(suggestion.proposed_value, length: 110) %></span>
51
+ <span class="muted record-meta">
53
52
  <span>#<%= suggestion.id %></span>
54
53
  <% if suggestion.author_label.present? %>
55
54
  <span><%= suggestion.author_label %></span>
56
55
  <% end %>
57
56
  </span>
58
57
  </span>
59
- <span class="badge status-<%= suggestion.status %>">
60
- <%= t("i18n_proofreading.statuses.#{suggestion.status}", default: suggestion.status.humanize) %>
58
+ <span class="record-side">
59
+ <span class="badge status-<%= suggestion.status %>">
60
+ <%= t("i18n_proofreading.statuses.#{suggestion.status}", default: suggestion.status.humanize) %>
61
+ </span>
61
62
  </span>
62
63
  <% end %>
63
64
  <% end %>
@@ -82,7 +83,7 @@
82
83
  </nav>
83
84
  </aside>
84
85
 
85
- <main class="review-detail" aria-label="<%= t('i18n_proofreading.dashboard.current_suggestion', default: 'Current suggestion') %>">
86
+ <main class="dashboard-detail" aria-label="<%= t('i18n_proofreading.dashboard.current_suggestion', default: 'Current suggestion') %>">
86
87
  <% if @selected_suggestion %>
87
88
  <p class="mobile-back">
88
89
  <%= link_to t('i18n_proofreading.dashboard.back', default: '← All suggestions'),
@@ -23,7 +23,6 @@ en:
23
23
  rejected: "Rejected"
24
24
  dashboard:
25
25
  title: "I18nProofreading"
26
- subtitle: "Review what reviewers proposed, then apply it to your locale files."
27
26
  locale: "Locale"
28
27
  filter: "Filter"
29
28
  all_locales: "All locales"
@@ -4,75 +4,59 @@
4
4
  *
5
5
  * :root custom properties, all `--ip-` prefixed so they can
6
6
  * neither overwrite a host's nor be overwritten by them.
7
- * .ip-page the page frame (was bare html/body). Only the gem's own
7
+ * .ip-page the page frame (was bare html/body). Only the gem's own
8
8
  * layout puts this class on <body>, so inside a host admin
9
9
  * these rules simply do not apply.
10
- * .ip-dashboard everything else, nested. Names like .container, .card
10
+ * .ip-dashboard everything else, nested. Names like .container, .card
11
11
  * and .tabs are confined to the dashboard's own markup, so
12
12
  * loading this file inside a host cannot restyle its chrome.
13
13
  *
14
14
  * Nothing here styles a bare `body`, `a`, `table` or `*` at the top level.
15
+ *
16
+ * Two sections follow: the design system shared by the whole gem family,
17
+ * then what only this gem has. A rule that belongs in the shared section
18
+ * belongs in all five copies of it.
19
+ *
20
+ * Order inside a section matters — components, then the page frame, then the
21
+ * narrow-screen overrides. Nesting adds no specificity, so the last rule
22
+ * wins the ties, and an override placed before the rule it means to beat
23
+ * silently does nothing.
15
24
  */
16
25
 
26
+ /* ---------------------------------------------------------------------------
27
+ * SHARED CORE — identical in testimonials, ideasbugs, livechat, product_tours
28
+ * and i18n_proofreading apart from the prefix. Diff it against a sibling gem
29
+ * before you change it, and carry the change to all five.
30
+ * ------------------------------------------------------------------------- */
17
31
 
18
32
  :root {
19
- color-scheme: light dark;
20
- --ip-bg: #f6f7f9; --ip-surface: #fff; --ip-text: #1c2024; --ip-muted: #6b7280;
21
- --ip-border: #e5e7eb; --ip-accent: #2563eb; --ip-accent-text: #fff; --ip-code: #f0f1f3;
22
- --ip-pending: #d97706; --ip-applied: #16a34a; --ip-rejected: #6b7280;
33
+ color-scheme: light dark;
34
+ --ip-bg: #f6f7f9;
35
+ --ip-surface: #fff;
36
+ --ip-text: #1c2024;
37
+ --ip-muted: #6b7280;
38
+ --ip-border: #e5e7eb;
39
+ --ip-accent: #2563eb;
40
+ --ip-accent-text: #fff;
41
+ --ip-code: #f0f1f3;
42
+ /* The four semantic states every gem in the family badges something with. */
43
+ --ip-success: #16a34a;
44
+ --ip-warning: #d97706;
45
+ --ip-danger: #dc2626;
46
+ --ip-neutral: #6b7280;
23
47
  }
24
48
  @media (prefers-color-scheme: dark) {
25
49
  :root {
26
- --ip-bg: #111418; --ip-surface: #1a1f26; --ip-text: #e6e8ea; --ip-muted: #9aa2ab;
27
- --ip-border: #2a313a; --ip-accent: #3b82f6; --ip-code: #232a33;
28
- }
29
- }
30
- @media (max-width: 760px) {
31
- .ip-page { font-size: 14px; }
32
- .ip-index, .ip-show { overflow-x: hidden; }
33
- .ip-index { overflow-y: auto; overflow-x: hidden; }
34
- .ip-index, .ip-index .container { min-height: 100vh; height: auto; }
35
- .ip-index .container { padding-bottom: 10px; }
36
- .ip-dashboard {
37
- & .container { padding: 14px 10px 24px; }
38
- & .review-detail,
39
- & .suggestion-panel,
40
- & .detail-scroll,
41
- & .card,
42
- & dl,
43
- & dd { min-width: 0; max-width: 100%; }
44
- & .suggestion-panel .card { width: calc(100vw - 20px); }
45
- & .lede,
46
- & dd,
47
- & .comment { max-width: calc(100vw - 54px); white-space: normal; overflow-wrap: anywhere; }
48
- & .review-shell { display: block; min-height: calc(100vh - 76px); }
49
- & .review-sidebar,
50
- & .review-detail { min-height: calc(100vh - 76px); }
51
- & .review-shell.has-selected .review-sidebar { display: none; }
52
- & .review-shell:not(.has-selected) .review-detail { display: none; }
53
- & .suggestion-list { overflow: visible; }
54
- & .suggestion-row { padding: 12px; }
55
- & .suggestion-meta { display: none; }
56
- & .review-detail .suggestion-panel { min-height: calc(100vh - 64px); }
57
- & .mobile-back { display: block; flex: 0 0 auto; margin: 10px 10px 0; font-size: 13px; }
58
- & .panel-head h1 { font-size: 18px; }
59
- & .panel-head .key { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
60
- & dl.diff,
61
- & .meta-list { grid-template-columns: 1fr; gap: 3px; }
50
+ --ip-bg: #111418;
51
+ --ip-surface: #1a1f26;
52
+ --ip-text: #e6e8ea;
53
+ --ip-muted: #9aa2ab;
54
+ --ip-border: #2a313a;
55
+ --ip-accent: #3b82f6;
56
+ --ip-code: #232a33;
62
57
  }
63
58
  }
64
59
 
65
- /* Page frame — the gem's own layout only. */
66
- .ip-page { margin: 0; background: var(--ip-bg); color: var(--ip-text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
67
- /* Desktop review: queue on the left, selected suggestion on the right. */
68
- .ip-index, .ip-index .container { height: 100vh; height: 100dvh; }
69
- .ip-index { overflow: hidden; }
70
- .ip-index .container { max-width: 1280px; display: flex; flex-direction: column; padding-bottom: 16px; }
71
- .ip-index header.page { flex: 0 0 auto; margin-bottom: 14px; }
72
- /* Standalone show pages keep normal page scrolling. */
73
- .ip-show { min-height: 100vh; overflow: auto; }
74
- .ip-show .detail-scroll { overflow: visible; }
75
-
76
60
  /* Dashboard components — any layout. */
77
61
  .ip-dashboard {
78
62
  /* A scoping device, not a layout one: without this the wrapper would
@@ -82,79 +66,239 @@
82
66
  & * { box-sizing: border-box; }
83
67
  & a { color: var(--ip-accent); text-decoration: none; }
84
68
  & a:hover { text-decoration: underline; }
85
- & .container { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
86
- & h1 { font-size: 22px; margin: 0; }
87
- & .lede { color: var(--ip-muted); margin: 4px 0 0; }
88
- & header.page { margin-bottom: 20px; }
89
- & .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ip-border); margin-bottom: 16px; flex-wrap: wrap; }
90
- & .tabs a { padding: 8px 14px; border-radius: 8px 8px 0 0; color: var(--ip-muted); }
91
- & .tabs a.active { color: var(--ip-text); font-weight: 600; border: 1px solid var(--ip-border); border-bottom: 2px solid var(--ip-surface); background: var(--ip-surface); margin-bottom: -1px; }
92
- & .tabs a:hover { text-decoration: none; color: var(--ip-text); }
93
- & .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--ip-border); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
94
- & .filters { margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }
95
- & .filters label { color: var(--ip-muted); font-size: 13px; }
96
- & .filters select { padding: 6px 8px; border: 1px solid var(--ip-border); border-radius: 8px; background: var(--ip-surface); color: var(--ip-text); font: inherit; }
97
- & .card { background: var(--ip-surface); border: 1px solid var(--ip-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
98
- & .card.pad { margin: 0; }
99
- & .row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
100
- & code.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--ip-code); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }
101
- & .badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
102
- & .badge.status-pending { background: var(--ip-pending); }
103
- & .badge.status-applied { background: var(--ip-applied); }
104
- & .badge.status-rejected { background: var(--ip-rejected); }
105
- & .badge.locale { background: transparent; color: var(--ip-muted); border: 1px solid var(--ip-border); }
106
- & .spacer { flex: 1; }
107
- & .meta { color: var(--ip-muted); font-size: 13px; }
108
- & dl.diff { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
109
- & dl.diff dt { color: var(--ip-muted); font-size: 13px; }
110
- & dl.diff dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
111
- & dd .old { color: var(--ip-muted); }
112
- & dd .new { font-weight: 600; }
113
- & .comment { margin-top: 10px; padding: 8px 10px; background: var(--ip-code); border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; }
114
- & button { padding: 7px 13px; border: 1px solid var(--ip-border); border-radius: 8px; cursor: pointer; background: var(--ip-surface); color: var(--ip-text); font: inherit; font-size: 14px; font-weight: 600; }
115
- & button:hover { border-color: var(--ip-muted); }
116
69
  & :focus-visible { outline: 2px solid var(--ip-accent); outline-offset: 2px; }
117
- & .empty { padding: 48px 16px; text-align: center; color: var(--ip-muted); border: 1px dashed var(--ip-border); border-radius: 12px; }
118
- & .pager { margin-top: 16px; display: flex; justify-content: space-between; }
119
- & .pager .muted { color: var(--ip-muted); }
70
+
71
+ /* Page furniture. `.container` is the reading width; an index page widens it
72
+ to 1280px in the page frame below. */
73
+ & .container { max-width: 1020px; margin: 0 auto; padding: 24px 16px 64px; }
74
+ & h1 { margin: 0 0 16px; font-size: 22px; }
75
+ & h2 { margin: 0 0 12px; font-size: 16px; }
76
+ & .page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
77
+ & .page-head h1 { margin: 0; }
78
+ & .lede { margin: 4px 0 0; color: var(--ip-muted); }
120
79
  & .breadcrumb { margin: 0 0 12px; font-size: 13px; }
80
+ & .muted { color: var(--ip-muted); font-size: 13px; }
121
81
  & .case-id { color: var(--ip-muted); font-weight: 400; font-size: 15px; }
122
- & .panel-head { flex: 0 0 auto; }
123
- & .panel-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
124
- & .detail-scroll { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
125
- & .suggestion-panel { min-width: 0; display: flex; flex-direction: column; }
126
- & .meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
127
- & .meta-list dt { color: var(--ip-muted); font-size: 13px; }
128
- & .meta-list dd { margin: 0; overflow-wrap: anywhere; }
129
- & .review-shell { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(330px, 430px) 1fr; gap: 16px; }
130
- & .review-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--ip-surface); border: 1px solid var(--ip-border); border-radius: 8px; overflow: hidden; }
131
- & .review-sidebar .tabs { flex: 0 0 auto; margin: 12px 12px 0; padding: 0; background: transparent; border: 0; border-radius: 0; gap: 6px; flex-wrap: nowrap; }
132
- & .review-sidebar .tabs a { flex: 1 1 0; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 10px 8px; border-radius: 8px; color: var(--ip-muted); font-weight: 600; }
133
- & .review-sidebar .tabs a.active { color: var(--ip-text); border: 0; background: transparent; box-shadow: none; margin: 0; }
134
- & .review-sidebar .tabs a.active::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 2px; border-radius: 999px; background: var(--ip-accent); }
135
- & .review-sidebar .tabs a:not(.active):hover { text-decoration: none; color: var(--ip-text); background: var(--ip-bg); }
136
- & .review-sidebar .tabs .count { margin-left: 0; background: color-mix(in srgb, var(--ip-muted) 14%, transparent); }
137
- & .review-sidebar .tabs a.active .count { background: var(--ip-border); }
138
- & .review-sidebar .filters { flex: 0 0 auto; margin: 0; padding: 12px; border-bottom: 1px solid var(--ip-border); }
139
- & .suggestion-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
140
- & .suggestion-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 13px 14px; color: var(--ip-text); border-bottom: 1px solid var(--ip-border); }
141
- & .suggestion-row > .badge { align-self: start; }
142
- & .suggestion-row:hover { text-decoration: none; background: var(--ip-bg); }
143
- & .suggestion-row.active { background: color-mix(in srgb, var(--ip-accent) 9%, var(--ip-surface)); box-shadow: inset 3px 0 0 var(--ip-accent); }
144
- & .suggestion-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
145
- & .suggestion-topline,
146
- & .suggestion-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
147
- & .suggestion-topline .key { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
148
- & .suggestion-copy,
149
- & .suggestion-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
150
- & .suggestion-copy { display: block; font-weight: 600; }
151
- & .suggestion-time { margin-left: auto; white-space: nowrap; }
152
- & .review-sidebar .pager { flex: 0 0 auto; margin: 0; padding: 10px 12px; border-top: 1px solid var(--ip-border); }
153
- & .review-detail { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
154
- & .review-detail .suggestion-panel { flex: 1 1 auto; min-height: 0; }
155
- & .review-detail .detail-scroll { flex: 1 1 auto; overflow-y: auto; padding-right: 2px; }
156
- & .empty-state { margin: auto; max-width: 320px; padding: 24px; text-align: center; }
82
+ & .spacer { flex: 1; }
83
+ & .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
84
+
85
+ /* Section switcher: the pills above the dashboard when a gem has more than
86
+ one section. Lives on the page, so a host `admin_layout` can drop it. */
87
+ & .nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
88
+ & .nav a { padding: 6px 16px; border: 1px solid var(--ip-border); border-radius: 999px; background: var(--ip-surface); color: var(--ip-muted); font-weight: 600; }
89
+ & .nav a:hover { text-decoration: none; color: var(--ip-text); }
90
+ & .nav a.active { border-color: var(--ip-accent); background: var(--ip-accent); color: var(--ip-accent-text); }
91
+ & .nav a.active:hover { color: var(--ip-accent-text); }
92
+
93
+ /* Tabs: one system for the whole family an underlined row of equal-width
94
+ tabs, sized to sit at the top of the sidebar. */
95
+ & .tabs { display: flex; gap: 6px; }
96
+ & .tabs a { position: relative; display: flex; flex: 1 1 0; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 10px 8px; border-radius: 8px; color: var(--ip-muted); font-weight: 600; }
97
+ & .tabs a:hover { background: var(--ip-bg); color: var(--ip-text); text-decoration: none; }
98
+ & .tabs a.active { color: var(--ip-text); }
99
+ & .tabs a.active::after { content: ""; position: absolute; right: 20px; bottom: 0; left: 20px; height: 2px; border-radius: 999px; background: var(--ip-accent); }
100
+ & .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--ip-muted) 14%, transparent); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
101
+ & .tabs a.active .count { background: var(--ip-border); }
102
+
103
+ /* Filter row under the tabs: a full-width select over a search + submit row,
104
+ however many of the three a gem actually has. */
105
+ & .filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px; border-bottom: 1px solid var(--ip-border); }
106
+ & .filters label { flex: 1 1 100%; color: var(--ip-muted); font-size: 13px; }
107
+ & .filters select { flex: 1 1 100%; }
108
+ /* Basis 0, not auto: the controls below are `width: 100%`, which would
109
+ otherwise push the submit button onto its own row. */
110
+ & .filters input[type="search"] { flex: 1 1 0; min-width: 0; }
111
+ & .filters button,
112
+ & .filters input[type="submit"] { flex: 0 0 auto; }
113
+
114
+ /* Form controls. 16px so iOS does not zoom the page on focus. */
115
+ & input,
116
+ & select,
117
+ & textarea { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--ip-border); border-radius: 8px; background: var(--ip-surface); color: var(--ip-text); font: inherit; font-size: 16px; letter-spacing: 0; }
118
+ & textarea { resize: vertical; }
119
+ & input[type="checkbox"],
120
+ & input[type="radio"] { width: auto; min-width: 0; min-height: 0; }
121
+ & input:focus,
122
+ & select:focus,
123
+ & textarea:focus { border-color: var(--ip-accent); outline: 2px solid color-mix(in srgb, var(--ip-accent) 22%, transparent); outline-offset: 0; }
124
+ & .field { margin-bottom: 16px; }
125
+ & .field label { display: block; margin-bottom: 5px; font-weight: 600; }
126
+ & .field small { display: block; margin-top: 5px; color: var(--ip-muted); }
127
+
128
+ /* A submit input is a button, whatever the markup says. */
129
+ & button,
130
+ & .button,
131
+ & input[type="submit"] { display: inline-flex; width: auto; align-items: center; justify-content: center; min-height: 38px; padding: 8px 14px; border: 1px solid var(--ip-border); border-radius: 8px; background: var(--ip-surface); color: var(--ip-text); font: inherit; cursor: pointer; }
132
+ & button:hover,
133
+ & .button:hover,
134
+ & input[type="submit"]:hover { border-color: var(--ip-muted); text-decoration: none; }
135
+ & button.primary,
136
+ & .button.primary,
137
+ & input[type="submit"].primary { border-color: var(--ip-accent); background: var(--ip-accent); color: var(--ip-accent-text); }
138
+ & button.danger,
139
+ & .button.danger { color: var(--ip-danger); }
140
+ & button.small,
141
+ & .button.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
142
+ & .actions,
143
+ & .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
144
+ & .actions form { display: inline; }
145
+ & .form-actions { padding-top: 12px; }
146
+
147
+ & .card { overflow: hidden; border: 1px solid var(--ip-border); border-radius: 12px; background: var(--ip-surface); }
148
+ & .card.pad { padding: 16px; overflow: visible; }
149
+ & table { width: 100%; border-collapse: collapse; }
150
+ & th,
151
+ & td { padding: 10px 14px; text-align: left; vertical-align: top; }
152
+ & th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ip-muted); border-bottom: 1px solid var(--ip-border); }
153
+ & tr + tr td { border-top: 1px solid var(--ip-border); }
154
+ & td.row-actions { white-space: nowrap; text-align: right; }
155
+ & td.row-actions form { display: inline-block; }
156
+ & td.row-actions form + form { margin-left: 6px; }
157
+
158
+ & .badge { display: inline-flex; padding: 2px 10px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
159
+ & .badge.locale { border: 1px solid var(--ip-border); background: transparent; color: var(--ip-muted); }
160
+ & code.key { max-width: 100%; padding: 2px 7px; border-radius: 6px; background: var(--ip-code); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
161
+
162
+ & .flash,
163
+ & .errors { margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--ip-border); border-radius: 8px; background: var(--ip-surface); }
164
+ & .flash.notice { border-color: var(--ip-success); }
165
+ & .flash.alert,
166
+ & .errors { border-color: var(--ip-danger); }
167
+ & .errors ul { margin-bottom: 0; }
168
+
169
+ & dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
170
+ & dt { color: var(--ip-muted); }
171
+ & dd { margin: 0; overflow-wrap: anywhere; }
172
+ & .message { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
173
+
174
+ & .empty { padding: 48px 16px; color: var(--ip-muted); text-align: center; }
175
+ & .empty-state { max-width: 320px; margin: auto; padding: 24px; text-align: center; }
157
176
  & .empty-state h2 { margin: 0 0 6px; font-size: 18px; }
158
177
  & .empty-state p { margin: 0; }
178
+
179
+ /* The two-pane dashboard: the queue on the left, the selected record on the
180
+ right, each pane owning its own scroll. */
181
+ & .dashboard-shell { display: grid; flex: 1 1 auto; grid-template-columns: minmax(330px, 430px) 1fr; gap: 16px; min-height: 0; }
182
+ & .dashboard-sidebar { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--ip-border); border-radius: 8px; background: var(--ip-surface); }
183
+ & .dashboard-sidebar .tabs { flex: 0 0 auto; margin: 12px 12px 0; }
184
+ & .dashboard-sidebar .filters { flex: 0 0 auto; }
185
+
186
+ /* One row shape for every gem: a topline of badges and a timestamp, the copy
187
+ that identifies the record, then a muted line of ids and authors. */
188
+ & .record-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
189
+ & .record-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--ip-border); color: var(--ip-text); }
190
+ & .record-row:hover { background: var(--ip-bg); text-decoration: none; }
191
+ & .record-row.active { background: color-mix(in srgb, var(--ip-accent) 9%, var(--ip-surface)); box-shadow: inset 3px 0 0 var(--ip-accent); }
192
+ & .record-main { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
193
+ & .record-topline,
194
+ & .record-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
195
+ & .record-name,
196
+ & .record-copy,
197
+ & .record-meta span,
198
+ /* A key is `overflow-wrap: anywhere` in prose; in a row it truncates. */
199
+ & .record-topline code.key,
200
+ & .record-meta code.key { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
201
+ & .record-name { font-weight: 600; }
202
+ & .record-copy { display: block; font-weight: 600; }
203
+ & .record-time { margin-left: auto; white-space: nowrap; }
204
+ & .record-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 1px; }
205
+ & .pager { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 16px; min-height: 42px; margin: 0; padding: 10px 12px; border-top: 1px solid var(--ip-border); }
206
+
207
+ /* The selected record. `.detail-scroll` is the only part that scrolls, so the
208
+ panel heading and its actions stay put. */
209
+ & .dashboard-detail { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
210
+ & .dashboard-detail .detail-panel { flex: 1 1 auto; min-height: 0; }
211
+ & .dashboard-detail .detail-scroll { flex: 1 1 auto; overflow-y: auto; padding-right: 2px; }
212
+ & .dashboard-detail .actions { margin-bottom: 0; }
213
+ & .detail-panel { display: flex; min-width: 0; flex-direction: column; }
214
+ /* The panel's own heading row: the title on the left, whatever acts on the
215
+ whole record on the right. */
216
+ & .panel-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
217
+ & .panel-head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
218
+ & .detail-scroll { display: flex; min-height: 0; flex-direction: column; gap: 12px; }
159
219
  & .mobile-back { display: none; }
160
220
  }
221
+
222
+ /* Page frame — the gem's own layout only. After the components, so it wins the
223
+ specificity ties against them. */
224
+ .ip-page { margin: 0; min-height: 100vh; background: var(--ip-bg); color: var(--ip-text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
225
+ /* An index page is the dashboard: it fills the viewport and never scrolls
226
+ itself, because the queue and the detail pane each scroll on their own. */
227
+ .ip-index, .ip-index .container { height: 100vh; height: 100dvh; }
228
+ .ip-index { overflow: hidden; }
229
+ .ip-index .container { display: flex; max-width: 1280px; flex-direction: column; padding-bottom: 16px; }
230
+ .ip-index .nav,
231
+ .ip-index .page-head { flex: 0 0 auto; }
232
+ /* Standalone show pages keep normal page scrolling. */
233
+ .ip-show { min-height: 100vh; overflow: auto; }
234
+ .ip-show .detail-panel { width: 100%; }
235
+ .ip-show .detail-scroll { overflow: visible; }
236
+
237
+ /* Narrow screens: one pane at a time, the queue until a record is picked.
238
+ Last in the file, so these overrides actually reach the rules above. */
239
+ @media (max-width: 760px) {
240
+ .ip-page { font-size: 14px; }
241
+ .ip-index, .ip-show { overflow-x: hidden; }
242
+ .ip-index { overflow-y: auto; }
243
+ .ip-index, .ip-index .container { min-height: 100vh; height: auto; }
244
+ .ip-index .container { padding-bottom: 10px; }
245
+ .ip-dashboard {
246
+ & .container { padding: 14px 10px 24px; }
247
+ & .page-head { margin-bottom: 12px; }
248
+ & .detail-panel,
249
+ & .detail-scroll,
250
+ & .card,
251
+ & dl,
252
+ & dd { min-width: 0; max-width: 100%; }
253
+ & .dashboard-detail .card { width: 100%; }
254
+ & .message,
255
+ & .lede,
256
+ & dd,
257
+ & .muted { overflow-wrap: anywhere; }
258
+ & .dashboard-shell { display: block; min-height: calc(100vh - 62px); }
259
+ & .dashboard-sidebar,
260
+ & .dashboard-detail { min-height: calc(100vh - 62px); }
261
+ & .dashboard-shell.has-selected .dashboard-sidebar { display: none; }
262
+ & .dashboard-shell:not(.has-selected) .dashboard-detail { display: none; }
263
+ & .record-list { overflow: visible; }
264
+ & .record-row { padding: 12px; }
265
+ & .record-meta { display: none; }
266
+ & .dashboard-detail .detail-panel { min-height: calc(100vh - 64px); }
267
+ & .mobile-back { display: block; flex: 0 0 auto; margin: 4px 0 10px; font-size: 13px; }
268
+ & .panel-head h1 { font-size: 18px; }
269
+ & dl { grid-template-columns: 1fr; gap: 3px; }
270
+ & dd { margin-bottom: 8px; }
271
+ }
272
+ }
273
+
274
+ /* ---------------------------------------------------------------------------
275
+ * GEM-SPECIFIC — i18n_proofreading only: the before/after diff of a proposed
276
+ * translation and the reviewer's comment.
277
+ * ------------------------------------------------------------------------- */
278
+
279
+ :root {
280
+ --ip-pending: var(--ip-warning);
281
+ --ip-applied: var(--ip-success);
282
+ --ip-rejected: var(--ip-neutral);
283
+ }
284
+
285
+ .ip-dashboard {
286
+ & .badge.status-pending { background: var(--ip-pending); }
287
+ & .badge.status-applied { background: var(--ip-applied); }
288
+ & .badge.status-rejected { background: var(--ip-rejected); }
289
+
290
+ /* What the translation says now, against what the reviewer proposes. */
291
+ & dl.diff dt { font-size: 13px; }
292
+ & dl.diff dd { white-space: pre-wrap; }
293
+ & dd .old { color: var(--ip-muted); }
294
+ & dd .new { font-weight: 600; }
295
+ & .meta-list dt { font-size: 13px; }
296
+ & .comment { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--ip-code); font-size: 14px; overflow-wrap: anywhere; }
297
+ }
298
+
299
+ @media (max-width: 760px) {
300
+ .ip-dashboard {
301
+ & .comment { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
302
+ & .panel-head code.key { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
303
+ }
304
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18nProofreading
4
- VERSION = '0.11.1'
4
+ VERSION = '0.12.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_proofreading
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov