Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/nightly-sky.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Changes
- **Stroke Nightly looks like Nightly** - Its title bar has a night sky behind it: a violet glow from the left, stars that twinkle out of step, and now and then a shooting star. A 1px violet to amber line runs along the top of the window. Light themes keep the glow and the line without the stars. Stable looks as before, and the sky holds still with reduced motion turned on.
2 changes: 2 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { onMount } from 'svelte'
import { Toaster } from '$lib/components/ui/sonner/index.js'
import ZoomIndicator from '$lib/components/ZoomIndicator.svelte'
import NightlyEdge from '$lib/components/NightlyEdge.svelte'
import StudioShell from './lib/components/StudioShell.svelte'


Expand Down Expand Up @@ -94,6 +95,7 @@
<!-- The corner is a setting (Appearance → Notifications). Top corners clear
the titlebar, bottom ones the status bar. -->
<ZoomIndicator />
<NightlyEdge />
<Toaster
position={$toastPosition}
offset={{ top: '42px', bottom: '32px', left: '12px', right: '12px' }}
Expand Down
58 changes: 58 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1879,3 +1879,61 @@ html[data-os="linux"]:has([role="dialog"][data-state="open"], [role="alertdialog
[data-slot="dialog-content"] > .flex-1 {
flex-basis: auto;
}

/* Stroke Nightly: a violet to amber accent and a night sky behind the title
bar, only on Nightly builds (NightlyEdge.svelte, NightlySky.svelte). */
:root {
--nightly-a: oklch(0.62 0.19 295);
--nightly-b: oklch(0.76 0.15 65);
--nightly-glow: oklch(0.62 0.19 295 / 0.2);
--nightly-glow-2: oklch(0.6 0.16 255 / 0.12);
--nightly-star: oklch(0.55 0.17 295 / 0.75);
}
.dark {
--nightly-a: oklch(0.7 0.17 295);
--nightly-b: oklch(0.8 0.14 65);
--nightly-glow: oklch(0.5 0.2 295 / 0.32);
--nightly-glow-2: oklch(0.45 0.16 260 / 0.24);
--nightly-star: oklch(0.97 0.02 290 / 0.9);
}
.nightly-edge {
background: linear-gradient(90deg, transparent, var(--nightly-a) 30%, var(--nightly-b) 70%, transparent);
opacity: 0.85;
}
.nightly-sky {
background:
radial-gradient(120% 160% at 0% 0%, var(--nightly-glow), transparent 55%),
radial-gradient(80% 140% at 28% 120%, var(--nightly-glow-2), transparent 60%);
}
.nightly-star {
background: var(--nightly-star);
box-shadow: 0 0 3px var(--nightly-star);
animation: nightly-twinkle 5.5s ease-in-out infinite;
}
@keyframes nightly-twinkle {
0%, 100% { opacity: 0.25; }
50% { opacity: 1; }
}
/* One streak, mostly idle: crosses the left of the bar for ~0.8s every 18s. */
.nightly-shooting-star {
left: 6%;
top: 10%;
width: 56px;
height: 1px;
background: linear-gradient(90deg, transparent, var(--nightly-star));
opacity: 0;
transform: rotate(11deg);
animation: nightly-shoot 18s ease-out 4s infinite;
}
@keyframes nightly-shoot {
0%, 95% { opacity: 0; transform: translate(0, 0) rotate(11deg); }
96% { opacity: 1; }
100% { opacity: 0; transform: translate(160px, 32px) rotate(11deg); }
}
/* A light bar is a daytime sky: the glow stays, stars on it read as dust. */
:root:not(.dark) .nightly-star,
:root:not(.dark) .nightly-shooting-star { display: none; }
@media (prefers-reduced-motion: reduce) {
.nightly-star { animation: none; opacity: 0.7; }
.nightly-shooting-star { display: none; }
}
23 changes: 23 additions & 0 deletions src/lib/build-track.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Which app this is: Stroke or Stroke Nightly. Nightly's version carries a
* build stamp, `3.7.7-nightly.202611240456`; Stable's is plain `3.7.7`.
*/
import { derived, writable } from 'svelte/store'

/** The running app's version, '' until Tauri answers (and in browser dev). */
export const appVersion = writable('')

if (typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window) {
void import('@tauri-apps/api/app')
.then((m) => m.getVersion())
.then((v) => appVersion.set(v))
.catch(() => {})
}

/** @param {string} version */
export function isNightlyVersion(version) {
return /-nightly\.\d+/.test(version)
}

export const isNightly = derived(appVersion, (v) => isNightlyVersion(v))

10 changes: 10 additions & 0 deletions src/lib/build-track.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { describe, it, expect } from 'vitest'
import { isNightlyVersion } from './build-track.js'

describe('build track', () => {
it('tells Nightly from Stable by the version', () => {
expect(isNightlyVersion('3.7.7-nightly.202611240456')).toBe(true)
expect(isNightlyVersion('3.7.7')).toBe(false)
expect(isNightlyVersion('')).toBe(false)
})
})
11 changes: 11 additions & 0 deletions src/lib/components/NightlyEdge.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script>
/**
* A 1px line across the top of the window in Stroke Nightly, so it is told
* apart from Stable at a glance even side by side. Takes no room and no clicks.
*/
import { isNightly } from '$lib/build-track.js'
</script>

{#if $isNightly}
<div class="nightly-edge pointer-events-none fixed inset-x-0 top-0 z-[200] h-px" aria-hidden="true"></div>
{/if}
35 changes: 35 additions & 0 deletions src/lib/components/NightlySky.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<script>
/**
* Stroke Nightly's title bar: a night sky behind it, so Nightly is told
* apart from Stable at a glance, even side by side. A violet glow from the
* left edge, a scatter of stars that twinkle out of step, and every so often
* one shooting star across the left of the bar. Painted under the bar's
* content, takes no clicks, and holds still with reduced motion.
*/
import { isNightly } from '$lib/build-track.js'

// Fixed, hand-placed: x and y in % of the bar, size in px, twinkle delay in s.
// Thick on the left where the glow is, thinning out towards the middle.
const STARS = [
[3, 30, 1.5, 0], [7, 70, 1, 1.7], [11, 22, 1, 3.1], [14, 58, 2, 0.6],
[18, 36, 1, 2.4], [22, 78, 1.5, 4.2], [26, 18, 1, 1.1], [30, 52, 1, 3.6],
[35, 28, 1.5, 2.0], [40, 66, 1, 0.3], [46, 40, 1, 4.8], [53, 20, 1, 2.8],
[61, 72, 1, 1.4], [72, 34, 1, 3.9],
]
</script>

{#if $isNightly}
<div class="nightly-sky pointer-events-none absolute inset-0 -z-10 overflow-hidden" aria-hidden="true">
{#each STARS as [x, y, size, delay]}
<span
class="nightly-star absolute rounded-full"
style:left="{x}%"
style:top="{y}%"
style:width="{size}px"
style:height="{size}px"
style:animation-delay="{delay}s"
></span>
{/each}
<span class="nightly-shooting-star absolute"></span>
</div>
{/if}
14 changes: 5 additions & 9 deletions src/lib/components/SettingsDialog.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { errorText } from '$lib/utils.js'
import { appVersion as runningVersion, isNightlyVersion } from '$lib/build-track.js';
import { tick, untrack } from "svelte";
import { toastPosition, TOAST_POSITIONS } from '$lib/stores/toast-position.js'
import ThemeBuilder from './ThemeBuilder.svelte';
Expand Down Expand Up @@ -656,14 +657,9 @@
// Stable and Nightly are separate apps (own name and data), so the track is
// which app runs: switching installs the other one if needed, opens it and
// quits this one.
let appVersion = $state('')
const onNightly = $derived(/-nightly\./.test(appVersion))
$effect(() => {
void import('@tauri-apps/api/app')
.then((m) => m.getVersion())
.then((v) => { appVersion = v })
.catch(() => {})
})
// The one copy of the version (build-track.js), shared with the Nightly sky.
const appVersion = $derived($runningVersion)
const onNightly = $derived(isNightlyVersion(appVersion))

/** A check asked for from here came back with nothing: say so on the button. */
let upToDate = $state(false)
Expand Down Expand Up @@ -1400,7 +1396,7 @@
<div class="min-w-0">
<p class="text-ui-sm font-medium text-foreground">Update track</p>
<p class="mt-0.5 text-ui-xs leading-relaxed text-muted-foreground">
Nightly is built every night from the newest code. Each track is its own app with its own settings, so switching leaves the other as it is.
Nightly is built every night from the newest code. Each track is its own app with its own settings, so switching leaves the other as it is. Saved connections are shared by both.
</p>
</div>
<div class="shrink-0">
Expand Down
6 changes: 5 additions & 1 deletion src/lib/components/TitleBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import WindowControls from './WindowControls.svelte'
import TitleBarMenu from './TitleBarMenu.svelte'
import WorkspaceSwitcher from './WorkspaceSwitcher.svelte'
import NightlySky from './NightlySky.svelte'
import PanelLeft from '@lucide/svelte/icons/panel-left'
import { tabDisplayTitle } from '$lib/studio-tabs.js'
import { bindNativeMenu, syncNativeMenuState, watchFullscreen } from '$lib/native-menu.js'
Expand Down Expand Up @@ -111,7 +112,7 @@
style) floating over this bar, so it only reserves space for them here.
-->
<div
class="studio-chrome relative flex shrink-0 items-center border-b border-border/50 bg-panel h-(--app-titlebar-h) {isMac ? 'pr-[calc(10px*var(--app-scale))]' : 'pl-[calc(10px*var(--app-scale))] pr-0'} select-none"
class="studio-chrome relative isolate flex shrink-0 items-center border-b border-border/50 bg-panel h-(--app-titlebar-h) {isMac ? 'pr-[calc(10px*var(--app-scale))]' : 'pl-[calc(10px*var(--app-scale))] pr-0'} select-none"
data-studio-chrome
style:--spacing="calc(4px * var(--app-scale, 1))"
data-studio-region="titlebar"
Expand All @@ -121,6 +122,9 @@
aria-label="Window title bar"
tabindex="-1"
>
<!-- Stroke Nightly only: a night sky behind the bar, so it is told from Stable
at a glance. Painted under the bar's content (the bar is `isolate`). -->
<NightlySky />

{#if isMac}
<!-- Room for the native traffic lights (inset set in mac_chrome.rs: they end
Expand Down
Loading