Repository navigation
Use thoughtbot's brand in /diff-explainer
#68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| type: regex | ||
| target: { source: file, path: scratchpad/walkthrough.html } | ||
| pattern: "--brand: #e03131" | ||
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| type: regex | ||
| target: { source: file, path: scratchpad/walkthrough.html } | ||
| pattern: '<article>(?:(?!</article>)[\s\S])*<aside data-note="risk"' | ||
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| <title>Session Store Swap</title> | ||
| <meta name="claude:viewport-fit-sides" content="cover"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap"> | ||
|
|
||
| <!-- | ||
| DIFF WALKTHROUGH TEMPLATE | ||
|
|
@@ -9,15 +9,17 @@ | |
| purpose: pick the element that describes the content and the stylesheet styles | ||
| it. Every colour is a token on :root with a dark-mode copy, so the page follows | ||
| the reader's theme. Don't rewrite it - every walkthrough is supposed to look the | ||
| same so a reviewer learns the page once. | ||
| same so a reviewer learns the page once. It follows thoughtbot's brand | ||
| (thoughtbot.com/playbook/the-thoughtbot-way/brand). | ||
|
|
||
| Everything inside <main> is a WORKED EXAMPLE (an Express app moving sessions to | ||
| Redis, with no reader background named). Replace it with the real change. | ||
|
|
||
| The elements and what they mean here: | ||
| <header> + <hgroup> title and one-line thesis; the <dl> under it is branch/churn | ||
| <article> "Start here" - the problem and its everyday analogy, | ||
| then the summary card and the watch list | ||
| then the summary card and the watch list, one | ||
| <aside data-note> per item | ||
| <ol> / <li> the walkthrough, one item per file or tight group of files | ||
| <pre><code> the diff. <ins> a added line, <del> a removed line, | ||
| bare text a context line, <small> a hunk header, | ||
|
|
@@ -45,26 +47,27 @@ | |
| <style> | ||
| /* One reading column; diffs scroll sideways inside their own box. */ | ||
| :root { | ||
| --bg: #f7f8fa; --surface: #eceff4; --fg: #1c2230; --muted: #5a6376; --line: #d3d9e3; | ||
| --why: #2a5bd7; --risk: #c0362c; --ins: #1d7a3c; --tradeoff: #8a5800; --alternative: #6a4cbb; | ||
| --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; | ||
| --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; | ||
| --bg: #ffffff; --surface: #faf9f9; --fg: #201313; --muted: #7b6e68; --line: #eae6e4; | ||
| --brand: #e03131; --why: #2a5bd7; --risk: #e03131; --ins: #1d7a3c; --tradeoff: #8a5800; --alternative: #6a4cbb; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tradeoff: We keep blue, amber, purple, and green for the note The page marks each note as a why, a risk, a tradeoff, or an Claude Opus 5.5 (claude-opus-5-5) |
||
| --heading: Cosmica, "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tradeoff: We list Cosmica and PP Mori first, but nothing loads Unless someone has our brand fonts installed on their own computer, Claude Opus 5.5 (claude-opus-5-5) |
||
| --sans: PPMori, "PP Mori", "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
| --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; | ||
| --space: 1rem; | ||
| } | ||
| @media (prefers-color-scheme: dark) { | ||
| :root:not([data-theme="light"]) { | ||
| --bg: #12151b; --surface: #1b2029; --fg: #e3e7ee; --muted: #98a1b3; --line: #2c3341; | ||
| --why: #7ea4ff; --risk: #ff7b72; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2; | ||
| --bg: #201313; --surface: #2f1c1c; --fg: #faf9f9; --muted: #c1bab7; --line: #7b6e68; | ||
| --brand: #f74239; --why: #7ea4ff; --risk: #f74239; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2; | ||
| color-scheme: dark; | ||
| } | ||
| } | ||
| :root[data-theme="dark"] { | ||
| --bg: #12151b; --surface: #1b2029; --fg: #e3e7ee; --muted: #98a1b3; --line: #2c3341; | ||
| --why: #7ea4ff; --risk: #ff7b72; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2; | ||
| --bg: #201313; --surface: #2f1c1c; --fg: #faf9f9; --muted: #c1bab7; --line: #7b6e68; | ||
| --brand: #f74239; --why: #7ea4ff; --risk: #f74239; --ins: #5ad06e; --tradeoff: #e3b341; --alternative: #b69af2; | ||
| color-scheme: dark; | ||
| } | ||
|
|
||
| body { background: var(--bg); color: var(--fg); font: 1rem/1.6 var(--sans); } | ||
| body { background: var(--bg); color: var(--fg); font: 1rem/1.6 var(--sans); border-top: 0.25rem solid var(--brand); } | ||
| main { | ||
| max-width: 52rem; margin: 0 auto; | ||
| padding-block: calc(var(--space) * 2.5); | ||
|
|
@@ -73,8 +76,8 @@ | |
| } | ||
| main > * + * { margin-top: calc(var(--space) * 2.5); } | ||
|
|
||
| h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; text-wrap: balance; } | ||
| h1 { font-size: 2rem; } | ||
| h1, h2, h3 { margin: 0; font-family: var(--heading); line-height: 1.25; font-weight: 600; text-wrap: balance; } | ||
| h1 { font-size: 2rem; font-weight: 500; } | ||
| h2 { font-size: 1.3rem; } | ||
| p { margin: 0 0 var(--space); max-width: 65ch; } | ||
| hgroup { margin-bottom: var(--space); } | ||
|
|
@@ -87,18 +90,19 @@ | |
|
|
||
| article { padding: calc(var(--space) * 1.5); border: 1px solid var(--line); border-radius: 6px; } | ||
| article > header { margin-bottom: var(--space); } | ||
| article p { max-width: none; } | ||
|
|
||
| ol { margin: 0; padding: 0; list-style: none; } | ||
| ol { margin-bottom: 0; padding: 0; list-style: none; } | ||
| ol > li + li { margin-top: calc(var(--space) * 3); padding-top: calc(var(--space) * 3); border-top: 1px solid var(--line); } | ||
| li h2 { font-size: 1.15rem; overflow-wrap: anywhere; } | ||
|
|
||
| code, pre { font-family: var(--mono); font-size: 0.875rem; } | ||
| code, pre { font-family: var(--mono); font-size: 0.875rem; font-variant-ligatures: none; } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Risk: Ligatures are off because JetBrains Mono drew The code font on its own merges some character pairs into one symbol, Claude Opus 5.5 (claude-opus-5-5) |
||
| code { padding: 0.1em 0.3em; border-radius: 3px; background: var(--surface); } | ||
| h2 > code, h3 > code, pre code { padding: 0; background: none; font-size: inherit; } | ||
| pre { margin: 0 0 var(--space); padding: var(--space); overflow-x: auto; line-height: 1.5; border-radius: 6px; background: var(--surface); } | ||
| ins, del { text-decoration: none; } | ||
| ins { color: var(--ins); background: color-mix(in srgb, var(--ins) 12%, transparent); } | ||
| del { color: var(--risk); background: color-mix(in srgb, var(--risk) 12%, transparent); } | ||
| ins { background: color-mix(in srgb, var(--ins) 15%, transparent); } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tradeoff: Added and removed lines keep the body text color and Lines that were added or removed used to be written in green or red. Claude Opus 5.5 (claude-opus-5-5) |
||
| del { background: color-mix(in srgb, var(--risk) 15%, transparent); } | ||
| pre small, pre em { color: var(--muted); font-size: inherit; } | ||
|
|
||
| figure { | ||
|
|
@@ -122,8 +126,9 @@ | |
| aside pre { background: var(--bg); } | ||
| aside h3 { | ||
| margin-bottom: 0.35rem; | ||
| color: var(--note); | ||
| font-family: var(--mono); | ||
| font-size: 0.7rem; | ||
| font-weight: 700; | ||
| letter-spacing: 0.1em; | ||
| text-transform: uppercase; | ||
| } | ||
|
|
@@ -172,14 +177,18 @@ <h1>Session Store Swap</h1> | |
| <figcaption>Sessions move out of each process and into one shared store.</figcaption> | ||
| </figure> | ||
| <p>The change is small on purpose. Nothing about how login works changed; only where the session is kept. Not in this branch: no migration of existing sessions, and no Redis in the test suite — tests still use the in-memory store.</p> | ||
| <dl> | ||
| <dt>Risk</dt> | ||
| <dd>Deploying this logs everyone out once. Existing sessions live in the old store and nothing copies them over.</dd> | ||
| <dt>Tradeoff</dt> | ||
| <dd>Redis is now required to boot, so <code>REDIS_URL</code> has to be set before the release goes out, or the new release crashes on boot.</dd> | ||
| <dt>Alternative</dt> | ||
| <dd>Signed cookies would have needed no Redis at all, since the session rides along in the cookie itself. Our payload is over the 4KB limit, so that was out.</dd> | ||
| </dl> | ||
| <aside data-note="risk"> | ||
| <h3>Risk</h3> | ||
| <p>Deploying this logs everyone out once. Existing sessions live in the old store and nothing copies them over.</p> | ||
| </aside> | ||
| <aside data-note="tradeoff"> | ||
| <h3>Tradeoff</h3> | ||
| <p>Redis is now required to boot, so <code>REDIS_URL</code> has to be set before the release goes out, or the new release crashes on boot.</p> | ||
| </aside> | ||
| <aside data-note="alternative"> | ||
| <h3>Alternative</h3> | ||
| <p>Signed cookies would have needed no Redis at all, since the session rides along in the cookie itself. Our payload is over the 4KB limit, so that was out.</p> | ||
| </aside> | ||
| </article> | ||
|
|
||
| <ol> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Risk: In light mode
--surface(#faf9f9) is barely differentfrom
--bg(#ffffff), about 1.05:1, and code blocks and notes have noborder, so they nearly blend into the page. We might want a darker
surface, though the playbook's next gray (#eae6e4) drops muted text to
3.96:1, under AA.
On a light screen, the gray boxes around code and notes are so pale
they're hard to see. It's like writing on a sticky note that's almost
the same white as the paper it's stuck to: the words are fine, but you
can't tell where the note starts and stops.
Claude Opus 5.5 (claude-opus-5-5)