Compare commits
8 Commits
9fa714ff17
...
v0.1.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a586357a34 | ||
|
|
5707f97089 | ||
|
|
9b3e630b6b | ||
|
|
efcef5d501 | ||
|
|
f15b38e2ff | ||
|
|
840af3e922 | ||
|
|
6d2e3ba8bb | ||
|
|
4a94380b5f |
@@ -5,10 +5,10 @@ current_phase: 15
|
||||
current_phase_name: Journal plugin
|
||||
status: executing
|
||||
stopped_at: Completed 15-04-PLAN.md
|
||||
last_updated: "2026-10-06T20:31:44.211Z"
|
||||
last_updated: "2026-10-06T21:58:51.425Z"
|
||||
last_activity: 2026-10-06
|
||||
last_activity_desc: Completed quick task 261006-s0v (remove ML copy-from locale UI)
|
||||
state_head: c05ad09dc23c07be76f69c22e58c4ef2eb34f4b4
|
||||
state_head: 4a94380b5fe947b657dadd250e1960865ca3285e
|
||||
progress:
|
||||
total_phases: 26
|
||||
completed_phases: 12
|
||||
@@ -650,6 +650,7 @@ Recent decisions affecting current work:
|
||||
| 261006-t5r | Make SPA slug preset follow mltext source fields | 2026-10-06 | b5d8506 | [261006-t5r-make-spa-slug-preset-follow-mltext-sourc](./quick/261006-t5r-make-spa-slug-preset-follow-mltext-sourc/) |
|
||||
| 261006-tnp | Add mltextarea field type | 2026-10-06 | 3596df4 | [261006-tnp-add-mltextarea-field-type](./quick/261006-tnp-add-mltextarea-field-type/) |
|
||||
| 15 | Commit accumulated planning documents properly | 2026-10-06 | c05ad09 | — |
|
||||
| 16 | Default icon shouldn't be a square but a sun. | 2026-10-06 | 4a94380 | — |
|
||||
|
||||
## Deferred Items
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
date: "2026-10-07 01:03"
|
||||
promoted: false
|
||||
---
|
||||
|
||||
Release rule: before creating or pushing any SummerCMS version tag that includes changes under `admin/`, rebuild the embedded SPA with `npm --prefix admin run build`, commit the resulting `modules/boardwalk/dist` changes, and run `./scripts/check-admin-dist.sh`. Do not tag until the drift check passes and the tag commit contains the generated bundle, because consuming Go binaries serve the embedded `modules/boardwalk/dist`, not `admin/src`.
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta name="summer-admin-base" content="__SUMMER_ADMIN_BASE__" />
|
||||
<link rel="icon" href="./favicon.ico" sizes="48x48" />
|
||||
<title>SummerCMS</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
BIN
admin/public/favicon.ico
Normal file
BIN
admin/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -1,10 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { computed, watchEffect } from 'vue'
|
||||
import { RouterView, useRoute } from 'vue-router'
|
||||
import { documentTitleForRoute } from './app/pageTitle'
|
||||
import AppShell from './components/shell/AppShell.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const inShell = computed(() => route.meta.shell === true)
|
||||
|
||||
watchEffect(() => {
|
||||
document.title = documentTitleForRoute(route)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -85,7 +85,6 @@ import {
|
||||
Settings,
|
||||
ShieldCheck,
|
||||
ShoppingCart,
|
||||
Square,
|
||||
Star,
|
||||
Sun,
|
||||
Table,
|
||||
@@ -300,8 +299,8 @@ export const winterIcons: Readonly<Record<string, string>> = {
|
||||
'icon-wrench': 'wrench',
|
||||
}
|
||||
|
||||
/** Neutral icon for names neither lucide map knows. */
|
||||
export const fallbackIcon: Component = Square
|
||||
/** Brand icon for names neither lucide map knows. */
|
||||
export const fallbackIcon: Component = Sun
|
||||
|
||||
/** An own entry of a map: names come from the server, so inherited object
|
||||
* members such as "constructor" or "toString" never count as icons. */
|
||||
|
||||
42
admin/src/app/pageTitle.ts
Normal file
42
admin/src/app/pageTitle.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
import { controllerIdFromPath } from './controllerRoutes'
|
||||
import { t } from './i18n'
|
||||
import { recordCrumb } from '../state/useBreadcrumbs'
|
||||
import { activeEntry } from '../state/useNavigation'
|
||||
import { settingsEntry } from '../state/useSettings'
|
||||
|
||||
const PRODUCT_TITLE = 'SummerCMS'
|
||||
|
||||
/** The visible page indicator used before the SummerCMS product name. */
|
||||
export function pageIndicator(route: RouteLocationNormalizedLoaded): string {
|
||||
if (route.name === 'login') {
|
||||
return t('backend::lang.auth.title')
|
||||
}
|
||||
if (route.name === 'settings') {
|
||||
return t('backend::lang.settings.title')
|
||||
}
|
||||
if (route.name === 'settings-form') {
|
||||
return settingsEntry(String(route.params.code ?? ''))?.label ?? String(route.params.code ?? '')
|
||||
}
|
||||
if (route.name === 'home') {
|
||||
return t('backend::lang.nav.empty')
|
||||
}
|
||||
if (route.name === 'not-found') {
|
||||
return t('backend::lang.page.not_found')
|
||||
}
|
||||
|
||||
const plugin = activeEntry(String(route.params.vendor ?? ''), String(route.params.plugin ?? ''))
|
||||
const controller = controllerIdFromPath(route.path)
|
||||
const section = plugin?.sideMenu.find((item) => item.controller === controller)
|
||||
const controllerLabel = section?.label ?? plugin?.label ?? ''
|
||||
if (route.name === 'create' || route.name === 'record' || route.name === 'preview') {
|
||||
return recordCrumb.value || controllerLabel
|
||||
}
|
||||
return controllerLabel
|
||||
}
|
||||
|
||||
/** Browser title matching WinterCMS's "Current page | Product" pattern. */
|
||||
export function documentTitleForRoute(route: RouteLocationNormalizedLoaded): string {
|
||||
const indicator = pageIndicator(route).trim()
|
||||
return indicator === '' ? PRODUCT_TITLE : `${indicator} | ${PRODUCT_TITLE}`
|
||||
}
|
||||
@@ -158,7 +158,7 @@ onBeforeUnmount(cancelClose)
|
||||
:aria-expanded="collapsed ? (openCode === item.entry.code ? 'true' : 'false') : undefined"
|
||||
:aria-controls="collapsed && openCode === item.entry.code ? flyoutId(item.entry.code) : undefined"
|
||||
:class="item.current ? 'bg-accent-soft font-bold text-accent' : 'text-side-text hover:bg-side-hover hover:text-white'"
|
||||
class="flex w-[68px] flex-col items-center gap-1 rounded-inner px-1.5 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"
|
||||
class="flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"
|
||||
@mouseenter="openFlyout(item.entry.code)"
|
||||
@mouseleave="scheduleClose"
|
||||
@focus="onItemFocus(item.entry.code)"
|
||||
@@ -166,7 +166,7 @@ onBeforeUnmount(cancelClose)
|
||||
@keydown="onItemKeydown($event, item.entry.code)"
|
||||
>
|
||||
<component :is="item.icon" :size="20" aria-hidden="true" />
|
||||
<span>{{ item.entry.label }}</span>
|
||||
<span class="max-w-full [overflow-wrap:anywhere]">{{ item.entry.label }}</span>
|
||||
</RouterLink>
|
||||
<SectionFlyout
|
||||
v-if="collapsed && openEntry"
|
||||
@@ -199,10 +199,10 @@ onBeforeUnmount(cancelClose)
|
||||
data-rail-settings
|
||||
:aria-current="inSettings ? 'page' : undefined"
|
||||
:class="inSettings ? 'bg-accent-soft font-bold text-accent' : 'text-side-text hover:bg-side-hover hover:text-white'"
|
||||
class="flex w-[68px] flex-col items-center gap-1 rounded-inner px-1.5 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"
|
||||
class="flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"
|
||||
>
|
||||
<Settings :size="20" aria-hidden="true" />
|
||||
<span>{{ t('backend::lang.nav.settings') }}</span>
|
||||
<span class="max-w-full [overflow-wrap:anywhere]">{{ t('backend::lang.nav.settings') }}</span>
|
||||
</RouterLink>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
--spacing-row: 54px;
|
||||
--spacing-row-head: 44px;
|
||||
--spacing-pager: 34px;
|
||||
--spacing-rail: 80px;
|
||||
--spacing-rail: 96px;
|
||||
--spacing-panel: 224px;
|
||||
|
||||
--shadow-card: var(--c-shadow-card);
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
Network,
|
||||
Pencil,
|
||||
Settings,
|
||||
Square,
|
||||
Sun,
|
||||
Tags,
|
||||
WandSparkles,
|
||||
} from '@lucide/vue'
|
||||
@@ -59,16 +59,16 @@ describe('iconFor', () => {
|
||||
expect(iconFor('icon-edit')).toBe(Pencil)
|
||||
})
|
||||
|
||||
it('falls back to the neutral square for unknown, empty or missing names', () => {
|
||||
expect(fallbackIcon).toBe(Square)
|
||||
expect(iconFor('unknown-icon-name')).toBe(Square)
|
||||
expect(iconFor('icon-unknown')).toBe(Square)
|
||||
expect(iconFor('')).toBe(Square)
|
||||
expect(iconFor(null)).toBe(Square)
|
||||
expect(iconFor(undefined)).toBe(Square)
|
||||
expect(iconFor('constructor')).toBe(Square)
|
||||
expect(iconFor('toString')).toBe(Square)
|
||||
expect(iconFor('__proto__')).toBe(Square)
|
||||
it('falls back to the sun for unknown, empty or missing names', () => {
|
||||
expect(fallbackIcon).toBe(Sun)
|
||||
expect(iconFor('unknown-icon-name')).toBe(Sun)
|
||||
expect(iconFor('icon-unknown')).toBe(Sun)
|
||||
expect(iconFor('')).toBe(Sun)
|
||||
expect(iconFor(null)).toBe(Sun)
|
||||
expect(iconFor(undefined)).toBe(Sun)
|
||||
expect(iconFor('constructor')).toBe(Sun)
|
||||
expect(iconFor('toString')).toBe(Sun)
|
||||
expect(iconFor('__proto__')).toBe(Sun)
|
||||
})
|
||||
|
||||
it('maps every Winter alias onto a registered lucide icon', () => {
|
||||
|
||||
42
admin/tests/app/pageTitle.test.ts
Normal file
42
admin/tests/app/pageTitle.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { beforeEach, describe, expect, it } from 'vitest'
|
||||
import { documentTitleForRoute } from '../../src/app/pageTitle'
|
||||
import { setRecordCrumb } from '../../src/state/useBreadcrumbs'
|
||||
import { setNavigation } from '../../src/state/useNavigation'
|
||||
import { setSettings } from '../../src/state/useSettings'
|
||||
import { navigationFixture, settingsFixture } from '../fixtures/typed'
|
||||
import { resetState, routerAt, signIn } from '../helpers'
|
||||
|
||||
beforeEach(resetState)
|
||||
|
||||
describe('documentTitleForRoute', () => {
|
||||
it('uses the active controller label on list pages', async () => {
|
||||
await signIn()
|
||||
setNavigation(navigationFixture.data)
|
||||
const router = await routerAt('/acme/demo/widgets')
|
||||
expect(documentTitleForRoute(router.currentRoute.value)).toBe('Widgets | SummerCMS')
|
||||
})
|
||||
|
||||
it('uses the loaded record name on create, update and preview pages', async () => {
|
||||
await signIn()
|
||||
setNavigation(navigationFixture.data)
|
||||
setRecordCrumb('Blue widget')
|
||||
for (const path of ['/acme/demo/widgets/create', '/acme/demo/widgets/12', '/acme/demo/widgets/12/preview']) {
|
||||
const router = await routerAt(path)
|
||||
expect(documentTitleForRoute(router.currentRoute.value), path).toBe('Blue widget | SummerCMS')
|
||||
}
|
||||
})
|
||||
|
||||
it('uses the settings page label', async () => {
|
||||
await signIn()
|
||||
setSettings(settingsFixture.list.data)
|
||||
expect(documentTitleForRoute((await routerAt('/settings')).currentRoute.value)).toBe('Ustawienia | SummerCMS')
|
||||
expect(documentTitleForRoute((await routerAt('/settings/mail')).currentRoute.value)).toBe('Mail | SummerCMS')
|
||||
})
|
||||
|
||||
it('uses translated indicators for login, the empty home and not found', async () => {
|
||||
expect(documentTitleForRoute((await routerAt('/login')).currentRoute.value)).toBe('Witaj ponownie | SummerCMS')
|
||||
await signIn()
|
||||
expect(documentTitleForRoute((await routerAt('/')).currentRoute.value)).toBe('Brak dostępnych sekcji. | SummerCMS')
|
||||
expect(documentTitleForRoute((await routerAt('/nowhere')).currentRoute.value)).toBe('Nie znaleziono strony. | SummerCMS')
|
||||
})
|
||||
})
|
||||
@@ -19,6 +19,7 @@ beforeEach(() => {
|
||||
|
||||
afterEach(() => {
|
||||
document.body.innerHTML = ''
|
||||
document.title = ''
|
||||
})
|
||||
|
||||
enableAutoUnmount(afterEach)
|
||||
@@ -28,6 +29,7 @@ describe('app root', () => {
|
||||
const { wrapper } = await mountAt('/login')
|
||||
expect(wrapper.find('nav[aria-label="Wtyczki"]').exists()).toBe(false)
|
||||
expect(wrapper.find('form').exists()).toBe(true)
|
||||
expect(document.title).toBe('Witaj ponownie | SummerCMS')
|
||||
})
|
||||
|
||||
it('renders shell routes inside the shell and an unknown path as not found', async () => {
|
||||
@@ -37,6 +39,7 @@ describe('app root', () => {
|
||||
expect(wrapper.find('nav[aria-label="Wtyczki"]').exists()).toBe(true)
|
||||
expect(wrapper.findComponent(NotFoundView).exists()).toBe(true)
|
||||
expect(wrapper.find('main h1').text()).toBe('Nie znaleziono strony.')
|
||||
expect(document.title).toBe('Nie znaleziono strony. | SummerCMS')
|
||||
})
|
||||
|
||||
it('says so when the admin may open no plugin', async () => {
|
||||
|
||||
@@ -36,6 +36,7 @@ var contentTypes = map[string]string{
|
||||
".mjs": "text/javascript; charset=utf-8",
|
||||
".css": "text/css; charset=utf-8",
|
||||
".html": "text/html; charset=utf-8",
|
||||
".ico": "image/x-icon",
|
||||
".woff2": "font/woff2",
|
||||
".woff": "font/woff",
|
||||
".svg": "image/svg+xml",
|
||||
|
||||
@@ -165,7 +165,7 @@ func TestAPIPathsAreDelegated(t *testing.T) {
|
||||
|
||||
func TestMissingFileWithExtensionIs404(t *testing.T) {
|
||||
h, _ := newTestHandler(t)
|
||||
for _, target := range []string{testPrefix + "/assets/missing.js", testPrefix + "/favicon.ico", testPrefix + "/golem/missing.css"} {
|
||||
for _, target := range []string{testPrefix + "/assets/missing.js", testPrefix + "/missing.ico", testPrefix + "/golem/missing.css"} {
|
||||
rec := get(h, target)
|
||||
if rec.Code != http.StatusNotFound || strings.Contains(rec.Body.String(), "summer-admin-base") {
|
||||
t.Fatalf("%s status=%d body=%s", target, rec.Code, rec.Body.String())
|
||||
@@ -276,6 +276,10 @@ func TestContentTypesAndCaching(t *testing.T) {
|
||||
if got := ContentType("x.svg"); got != "image/svg+xml" {
|
||||
t.Fatalf("svg type %q", got)
|
||||
}
|
||||
favicon := get(h, testPrefix+"/favicon.ico")
|
||||
if favicon.Code != http.StatusOK || favicon.Header().Get("Content-Type") != "image/x-icon" || favicon.Header().Get("Cache-Control") != "no-cache" {
|
||||
t.Fatalf("favicon headers = status %d, %v", favicon.Code, favicon.Header())
|
||||
}
|
||||
if got := ContentType("x.json"); got != "application/json" {
|
||||
t.Fatalf("json type %q", got)
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
modules/boardwalk/dist/favicon.ico
vendored
Normal file
BIN
modules/boardwalk/dist/favicon.ico
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
5
modules/boardwalk/dist/index.html
vendored
5
modules/boardwalk/dist/index.html
vendored
@@ -5,9 +5,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<meta name="summer-admin-base" content="__SUMMER_ADMIN_BASE__" />
|
||||
<link rel="icon" href="./favicon.ico" sizes="48x48" />
|
||||
<title>SummerCMS</title>
|
||||
<script type="module" crossorigin src="./assets/index-BonWcpEU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-BUCXRqcT.css">
|
||||
<script type="module" crossorigin src="./assets/index-CE_etpB7.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-X2xCWuiY.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in New Issue
Block a user