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 +4 -4
- data/AGENTS.md +7 -0
- data/CHANGELOG.md +35 -0
- data/README.md +18 -7
- data/app/views/i18n_proofreading/suggestions/_suggestion_panel.html.erb +1 -1
- data/app/views/i18n_proofreading/suggestions/index.html.erb +16 -15
- data/config/locales/i18n_proofreading.en.yml +0 -1
- data/lib/i18n_proofreading/dashboard.css +266 -122
- data/lib/i18n_proofreading/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0dd116667dbbc3243bc9eb5ae929db378fd60d6354dc9101cde3c137474272dd
|
|
4
|
+
data.tar.gz: 67cb971e8e0d957f9ce6ccd6e3a39f102242588e7e6599945267423b7a32c0ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
##
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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,13 +1,12 @@
|
|
|
1
1
|
<% content_for :body_class, 'ip-index' %>
|
|
2
2
|
|
|
3
3
|
<%= render layout: 'i18n_proofreading/shared/dashboard' do %>
|
|
4
|
-
<
|
|
4
|
+
<div class="page-head">
|
|
5
5
|
<h1><%= t('i18n_proofreading.dashboard.title', default: 'I18nProofreading') %></h1>
|
|
6
|
-
|
|
7
|
-
</header>
|
|
6
|
+
</div>
|
|
8
7
|
|
|
9
|
-
<div class="
|
|
10
|
-
<aside class="
|
|
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="
|
|
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: ['
|
|
43
|
-
<span class="
|
|
44
|
-
<span class="
|
|
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
|
|
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="
|
|
52
|
-
<span class="muted
|
|
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="
|
|
60
|
-
|
|
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="
|
|
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'),
|
|
@@ -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
|
|
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
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
& .
|
|
123
|
-
& .
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
& .
|
|
128
|
-
& .
|
|
129
|
-
& .
|
|
130
|
-
& .
|
|
131
|
-
& .
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
& .
|
|
136
|
-
& .
|
|
137
|
-
& .
|
|
138
|
-
& .
|
|
139
|
-
& .
|
|
140
|
-
& .
|
|
141
|
-
& .
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
& .
|
|
146
|
-
& .
|
|
147
|
-
& .
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
& .
|
|
151
|
-
& .
|
|
152
|
-
& .
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
&
|
|
156
|
-
&
|
|
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
|
+
}
|