rename: the sign-in screen shows Inkwell's mark, and every tab says Inkwell
Android / Build, or is the channel already serving this? (push) Successful in 4s
Android / Kotlin + Rust (APK) (push) Skipped
CI & Build / Build now, or wait for Android? (push) Successful in 3s
CI & Build / TypeScript typecheck (push) Successful in 12s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 12s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / integration (push) Successful in 43s
CI & Build / Build & push image (push) Successful in 1m0s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m28s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 6m22s
Desktop (Tauri) / Update manifest (push) Successful in 10s
Android / Build, or is the channel already serving this? (push) Successful in 4s
Android / Kotlin + Rust (APK) (push) Skipped
CI & Build / Build now, or wait for Android? (push) Successful in 3s
CI & Build / TypeScript typecheck (push) Successful in 12s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 12s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / integration (push) Successful in 43s
CI & Build / Build & push image (push) Successful in 1m0s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m28s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 6m22s
Desktop (Tauri) / Update manifest (push) Successful in 10s
The login and register screens still drew a hard-coded "TS" tile. They now use /icon.svg, the same mark the shell's header shows. Browser tabs took index.html's static <title> and never changed it, so every tab read the same, and some browsers showed the URL instead. usePageTitle, mounted once in App.vue, sets "<page> · <site name>". Routes outside the shell name themselves with meta.title. Board lenses use the lens name the header already shows, now in useLensName so the tab and the header read from one place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { computed, type ComputedRef } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useLabelsStore } from "../stores/labels";
|
||||
|
||||
/**
|
||||
* What to call the lens currently in view.
|
||||
*
|
||||
* Keyed off the route name rather than each view declaring its own title, so the
|
||||
* label sits in one place and can't go missing (the board never had one)
|
||||
* or drift in styling (timeline and reminders each had their own h1). The shell's
|
||||
* header and the browser tab both read it, so the two can't disagree either.
|
||||
*
|
||||
* A label lens is named by the label itself — "Groceries" is what the user came
|
||||
* looking for; "Label" would tell them nothing they didn't already know.
|
||||
*/
|
||||
export function useLensName(): ComputedRef<string> {
|
||||
const route = useRoute();
|
||||
const labels = useLabelsStore();
|
||||
return computed<string>(() => {
|
||||
switch (route.name) {
|
||||
case "archive":
|
||||
return "Archive";
|
||||
case "trash":
|
||||
return "Trash";
|
||||
case "timeline":
|
||||
return "Timeline";
|
||||
case "reminders":
|
||||
return "Reminders";
|
||||
case "label":
|
||||
// The store may not have loaded yet on a deep link; fall back rather than
|
||||
// flashing an empty slot.
|
||||
return labels.items.find((l) => l.id === String(route.params.id))?.name ?? "Label";
|
||||
default:
|
||||
return "Notes";
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { computed, watchEffect } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useConfigStore } from "../stores/config";
|
||||
import { useLensName } from "./useLensName";
|
||||
|
||||
/**
|
||||
* Keep the browser tab titled "<page> · <site name>".
|
||||
*
|
||||
* index.html's static <title> only names the app, and nothing updated it after
|
||||
* that, so every tab read the same — or, where the browser preferred the URL, no
|
||||
* name at all. One writer, mounted once in App.vue: a route outside the shell names
|
||||
* itself with `meta.title`, and a board lens takes the name the shell's header
|
||||
* already shows.
|
||||
*/
|
||||
export function usePageTitle(): void {
|
||||
const route = useRoute();
|
||||
const config = useConfigStore();
|
||||
const lensName = useLensName();
|
||||
|
||||
const page = computed(() => (route.meta.title as string | undefined) ?? lensName.value);
|
||||
|
||||
watchEffect(() => {
|
||||
document.title = `${page.value} · ${config.siteName}`;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user