Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat(neuron): step 4 of the introduction shows one answer with a line across it

purple54adb71f2f32
diff --git a/src/components/neuron/NeuronIntro.tsx b/src/components/neuron/NeuronIntro.tsx
index cf77372e..21a152aa 100644
--- a/src/components/neuron/NeuronIntro.tsx
+++ b/src/components/neuron/NeuronIntro.tsx
@@ -98,21 +98,18 @@ function ArtEqualizer() {
)
}
-/** Before and after: the same question, two answers being written. */
+// Step 4 (3.1.0): one real answer, and a line that wipes across it. Left of
+// the line the sliders are on, right of it they are off. Both answers lie on
+// the same spot, so the eye compares the words and not two boxes.
function ArtCompare() {
return (
- <svg viewBox="0 0 320 168" className="w-full h-full" aria-hidden>
- <rect x="16" y="20" width="136" height="128" rx="12" className="nintro-card" />
- <rect x="168" y="20" width="136" height="128" rx="12" className="nintro-card nintro-card--accent" />
- <text x="32" y="42" className="nintro-label nintro-muted-text">BEFORE</text>
- <text x="184" y="42" className="nintro-label nintro-accent-text">AFTER</text>
- {[0, 1, 2, 3].map((i) => (
- <rect key={`b${i}`} x="32" y={58 + i * 18} width={[104, 92, 100, 60][i]} height="7" rx="3.5" className="nintro-line" style={{ animationDelay: `${i * 0.3}s` }} />
- ))}
- {[0, 1, 2, 3].map((i) => (
- <rect key={`a${i}`} x="184" y={58 + i * 18} width={[96, 104, 84, 70][i]} height="7" rx="3.5" className="nintro-line nintro-line--accent" style={{ animationDelay: `${1.3 + i * 0.3}s` }} />
- ))}
- </svg>
+ <div className="nintro-wipe" aria-hidden data-testid="neuron-intro-wipe">
+ <span className="nintro-wipe-tag nintro-wipe-tag--on">SLIDERS ON</span>
+ <span className="nintro-wipe-tag nintro-wipe-tag--off">SLIDERS OFF</span>
+ <p className="nintro-wipe-a nintro-wipe-a--before">It was fine. I answered a few questions, sorted some notes, and that is about all there is to say.</p>
+ <p className="nintro-wipe-a nintro-wipe-a--after">Wonderful! I got to help with so many curious questions, and every single one taught me something new.</p>
+ <i className="nintro-wipe-bar" />
+ </div>
)
}
diff --git a/src/components/neuron/__tests__/neurons-for-beginners.test.tsx b/src/components/neuron/__tests__/neurons-for-beginners.test.tsx
index fefcee49..2f767b48 100644
--- a/src/components/neuron/__tests__/neurons-for-beginners.test.tsx
+++ b/src/components/neuron/__tests__/neurons-for-beginners.test.tsx
@@ -199,7 +199,7 @@ describe('the introduction', () => {
const css = readFileSync(resolve(__dirname, '../../../index.css'), 'utf8')
const block = css.slice(css.indexOf('Neurons introduction (N2'))
const reduced = block.slice(block.indexOf('@media (prefers-reduced-motion: reduce)'))
- for (const cls of ['nintro-pulse', 'nintro-thumb', 'nintro-way', 'nintro-way-knob', 'nintro-knob', 'nintro-line', 'nintro-type']) {
+ for (const cls of ['nintro-pulse', 'nintro-thumb', 'nintro-way', 'nintro-way-knob', 'nintro-knob', 'nintro-wipe-bar', 'nintro-wipe-a--after', 'nintro-type']) {
expect(block).toMatch(new RegExp(`\\.${cls}[^{]*\\{[^}]*animation:`))
expect(reduced).toContain(`.neuron-intro .${cls}`)
}
@@ -211,6 +211,26 @@ describe('the introduction', () => {
for (const cls of ['nintro-type', 'nintro-glow', 'nintro-arrive', 'nintro-dash']) expect(rule).toContain(`.${cls}`)
expect(rule).toMatch(/opacity: 1/)
})
+
+ it('shows step 4 as one answer with a line across it, not two boxes of bars', async () => {
+ useSettingsStore.getState().updateSettings({ neuronsPluginEnabled: true })
+ const { NeuronIntro } = await import('../NeuronIntro')
+ render(<NeuronIntro open onClose={() => {}} />)
+ for (let n = 0; n < 3; n++) fireEvent.click(screen.getByTestId('neuron-intro-next'))
+ await waitFor(() => expect(screen.getByTestId('neuron-intro-step').textContent).toBe('Step 4 of 5'))
+ const wipe = await screen.findByTestId('neuron-intro-wipe')
+ expect(wipe.getAttribute('aria-hidden')).toBe('true')
+ expect(wipe.querySelectorAll('p.nintro-wipe-a')).toHaveLength(2)
+ expect(wipe.textContent).toContain('SLIDERS ON')
+ expect(wipe.textContent).toContain('SLIDERS OFF')
+ expect(wipe.querySelector('rect')).toBeNull()
+ // Standing still, the line is in the middle and both halves are readable.
+ const css = readFileSync(resolve(__dirname, '../../../index.css'), 'utf8')
+ const reduced = css.slice(css.lastIndexOf('.neuron-intro .nintro-wipe-bar { left: 50%; }'))
+ expect(reduced).toContain('.nintro-wipe-a--after { clip-path: inset(0 50% 0 0); }')
+ expect(reduced).toContain('.nintro-wipe-a--before { clip-path: inset(0 0 0 50%); }')
+ expect(css).not.toContain('nintro-line')
+ })
})
describe('coordinates', () => {
diff --git a/src/index.css b/src/index.css
index c9d71624..d82c35b6 100644
--- a/src/index.css
+++ b/src/index.css
@@ -2870,10 +2870,6 @@ html[data-computer-surface]:not([data-computer-surface='window']) #root {
.neuron-intro .nintro-card { fill: #ffffff; stroke: #e5e7eb; stroke-width: 1; }
.dark .neuron-intro .nintro-card { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.10); }
.neuron-intro .nintro-card--accent { fill: color-mix(in srgb, var(--color-lu-accent) 8%, transparent); stroke: color-mix(in srgb, var(--color-lu-accent) 45%, transparent); }
-.neuron-intro .nintro-line { fill: #d1d5db; transform-box: fill-box; transform-origin: left center; animation: lu-nintro-write 4.4s ease-out infinite; }
-.dark .neuron-intro .nintro-line { fill: rgba(255, 255, 255, 0.18); }
-.neuron-intro .nintro-line--accent,
-.dark .neuron-intro .nintro-line--accent { fill: var(--color-lu-accent); }
/* WebKit draws no clip-path on SVG groups: the code slides in instead of being typed. */
.neuron-intro .nintro-type { opacity: 0; animation: lu-nintro-type 5s ease-out infinite; }
.neuron-intro .nintro-glow { opacity: 0; animation: lu-nintro-glow 5s ease-in-out infinite; }
@@ -2884,11 +2880,6 @@ html[data-computer-surface]:not([data-computer-surface='window']) #root {
0%, 100% { transform: translateY(0); }
45%, 70% { transform: translateY(var(--nintro-to, 0px)); }
}
-@keyframes lu-nintro-write {
- 0% { transform: scaleX(0); }
- 30%, 85% { transform: scaleX(1); }
- 100% { transform: scaleX(1); opacity: 0; }
-}
@keyframes lu-nintro-type {
0% { opacity: 0; transform: translateX(-8px); }
25%, 100% { opacity: 1; transform: none; }
@@ -2910,7 +2901,6 @@ html[data-computer-surface]:not([data-computer-surface='window']) #root {
@media (prefers-reduced-motion: reduce) {
.neuron-intro .nintro-knob,
- .neuron-intro .nintro-line,
.neuron-intro .nintro-type,
.neuron-intro .nintro-glow,
.neuron-intro .nintro-dash,
@@ -3010,6 +3000,23 @@ html[data-computer-surface]:not([data-computer-surface='window']) #root {
88%, 100% { transform: translateX(34px); }
}
+/* Step 4: one answer, a line wipes across it. */
+.neuron-intro .nintro-wipe { position: relative; width: 100%; max-width: 400px; height: 100px; }
+.neuron-intro .nintro-wipe-a { position: absolute; left: 0; right: 0; top: 30px; margin: 0; font-size: 15px; line-height: 1.5; }
+.neuron-intro .nintro-wipe-a--before { color: #6b7280; clip-path: inset(0 0 0 30%); animation: lu-nintro-wipe-before 9s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
+.dark .neuron-intro .nintro-wipe-a--before { color: #8b919c; }
+.neuron-intro .nintro-wipe-a--after { color: #111827; clip-path: inset(0 70% 0 0); animation: lu-nintro-wipe-after 9s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
+.dark .neuron-intro .nintro-wipe-a--after { color: #f3f4f6; }
+.neuron-intro .nintro-wipe-bar { position: absolute; top: 22px; bottom: 0; left: 30%; width: 1.5px; margin-left: -0.75px; background: var(--color-lu-accent); animation: lu-nintro-wipe-bar 9s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
+.neuron-intro .nintro-wipe-bar::after { content: ''; position: absolute; left: -4px; top: 50%; width: 9.5px; height: 22px; margin-top: -11px; border-radius: 5px; background: var(--color-lu-accent); }
+.neuron-intro .nintro-wipe-tag { position: absolute; top: 0; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; }
+.neuron-intro .nintro-wipe-tag--on { left: 0; color: var(--color-lu-accent); }
+.neuron-intro .nintro-wipe-tag--off { right: 0; color: #6b7280; }
+.dark .neuron-intro .nintro-wipe-tag--off { color: #9ca3af; }
+@keyframes lu-nintro-wipe-bar { 0%, 8%, 100% { left: 6%; } 45%, 62% { left: 94%; } }
+@keyframes lu-nintro-wipe-after { 0%, 8%, 100% { clip-path: inset(0 94% 0 0); } 45%, 62% { clip-path: inset(0 6% 0 0); } }
+@keyframes lu-nintro-wipe-before { 0%, 8%, 100% { clip-path: inset(0 0 0 6%); } 45%, 62% { clip-path: inset(0 0 0 94%); } }
+
@media (prefers-reduced-motion: reduce) {
.neuron-intro .nintro-plane--hit,
.neuron-intro .nintro-wire--bent,
@@ -3021,7 +3028,10 @@ html[data-computer-surface]:not([data-computer-surface='window']) #root {
.neuron-intro .nintro-way,
.neuron-intro .nintro-way-run,
.neuron-intro .nintro-way-name,
- .neuron-intro .nintro-way-knob { animation: none; }
+ .neuron-intro .nintro-way-knob,
+ .neuron-intro .nintro-wipe-a--before,
+ .neuron-intro .nintro-wipe-a--after,
+ .neuron-intro .nintro-wipe-bar { animation: none; }
.neuron-intro .nintro-pulse,
.neuron-intro .nintro-way-run { opacity: 0; }
.neuron-intro .nintro-plane--hit { stroke: var(--color-lu-accent); }
@@ -3033,6 +3043,9 @@ html[data-computer-surface]:not([data-computer-surface='window']) #root {
.neuron-intro .nintro-thumb { transform: translateY(-22px); }
.neuron-intro .nintro-way-name--first { opacity: 1; }
.neuron-intro .nintro-way-knob { transform: translateX(-30px); }
+ .neuron-intro .nintro-wipe-bar { left: 50%; }
+ .neuron-intro .nintro-wipe-a--after { clip-path: inset(0 50% 0 0); }
+ .neuron-intro .nintro-wipe-a--before { clip-path: inset(0 0 0 50%); }
}
/* Neurons slider (N2): the house range (track and knob above), with a