Compare commits

..
3 Commits
Author SHA1 Message Date
terminarandClaude Opus 5.5 8964cec3e2 Sidebar: no container without NavItems
A page that clears NavItems (yasta's login page) still got the empty
nav container, which the modern style draws as a card: an empty frame
where the sidebar would be. The container is now left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 12:23:20 +01:00
terminarandClaude Opus 5.5 3e99ada77b README: migration status with each consumer's version; yasta on v0.5.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 11:56:13 +01:00
terminarandClaude Opus 5.5 04ea1db1ab Modern style: navbar buttons stay on one line
A consumer's long left-hand navbar extra (yasta's config path) pushed
the right-hand buttons into two lines under the modern style's wider
button padding. The buttons now keep white-space: nowrap and the left
group may shrink, so the extra wraps instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 11:33:44 +01:00
4 changed files with 43 additions and 14 deletions

No files matched your search

+14 -12
View File
@@ -239,19 +239,21 @@ h = httpsec.Headers(httpsec.Gate(http.NewCrossOriginProtection().Handler(h), hos
## Migration status ## Migration status
Eight projects use it, all on `v0.3.0` (2026-10-31): the built-in theme Nine projects use it (as of 2026-11-28). From v0.5.0 on, a bump brings
menu, `httpsec` and the flash helpers. the modern style as the default; the consumer then gives its
`NavItems` a `Group` and an `Icon` (yasta is the reference).
| Project | Meta-repo | Status | | Project | Meta-repo | Version | Status |
|---|---|---| |---|---|---|---|
| `yasta` | yetano | migrated (pilot) | | `yasta` | yetano | v0.5.1 | migrated (pilot); sidebar with groups and icons |
| `yasl` | yetano | migrated | | `yasl` | yetano | v0.3.0 | migrated |
| `yaiam` | yetano | migrated (`yaiam-web` and the `yaiam-authd` login pages) | | `yaiam` | yetano | v0.3.1 | migrated (`yaiam-web` and the `yaiam-authd` login pages) |
| `yakwui` | yak | migrated | | `yakwui` | yak | v0.3.1 | migrated |
| `yamase-web` | yamase | migrated | | `yamase-web` | yamase | v0.3.1 | migrated |
| `yamocir` | yetano | migrated | | `yamocir` | yetano | v0.3.1 | migrated |
| `yet` (`yet serve`) | yetano | built on it (a server-rendered shell whose content area a small JS app fills) | | `yet` (`yet serve`) | yetano | v0.3.0 | built on it (a server-rendered shell whose content area a small JS app fills) |
| `yareco` | yetano | built on it (reference consumer for themes) | | `yareco` | yetano | v0.3.0 | built on it (reference consumer for themes) |
| `yashatra` | yetano | v0.4.0 | built on it (web UI over the YAPL bus, `busweb`) |
`yaais` was evaluated too and deliberately NOT migrated: it's a `yaais` was evaluated too and deliberately NOT migrated: it's a
client-rendered SPA (static `index.html` + vanilla JS), not a client-rendered SPA (static `index.html` + vanilla JS), not a
+11
View File
@@ -695,6 +695,17 @@ body.no-sidebar main {
padding: .35rem .8rem; padding: .35rem .8rem;
} }
/* Navbar buttons and the menu toggle stay on one line; a consumer's
long left-hand extra (yasta's config path) wraps instead. */
[data-style="modern"] .navbar .btn,
[data-style="modern"] .yw-user {
white-space: nowrap;
}
[data-style="modern"] .navbar > .container-fluid > div:first-child {
min-width: 0;
}
[data-style="modern"] .navbar .btn-outline-secondary { [data-style="modern"] .navbar .btn-outline-secondary {
--bs-btn-color: var(--yw-text); --bs-btn-color: var(--yw-text);
--bs-btn-border-color: var(--yw-border); --bs-btn-border-color: var(--yw-border);
+16
View File
@@ -103,3 +103,19 @@ func TestSidebarGroupsAndIcons(t *testing.T) {
} }
} }
} }
// A page without NavItems (a login page) renders no sidebar container:
// the modern style draws it as a card, which would show up empty.
func TestSidebarWithoutItems(t *testing.T) {
r, err := NewRenderer(testPagesFS(), "pages", []string{"dashboard"}, ".html.tmpl", testFuncs())
if err != nil {
t.Fatalf("NewRenderer: %v", err)
}
var buf bytes.Buffer
if err := r.Page(&buf, "dashboard", PageHeader{Title: "Log in"}); err != nil {
t.Fatal(err)
}
if strings.Contains(buf.String(), `class="nav flex-column`) {
t.Errorf("empty sidebar container rendered\n---\n%s", buf.String())
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
{{define "sidebar"}} {{define "sidebar"}}
<div class="nav flex-column pt-2"> {{if .NavItems}}<div class="nav flex-column pt-2">
{{range .SidebarEntries}}{{if .GroupHead}}<div class="yw-nav-group">{{.GroupHead}}</div> {{range .SidebarEntries}}{{if .GroupHead}}<div class="yw-nav-group">{{.GroupHead}}</div>
{{end}}<a class="nav-link{{if .Active}} active{{end}}" href="{{$.BasePath}}{{.Href}}"{{if .Active}} aria-current="page"{{end}}>{{if .IconSVG}}<span class="yw-nav-icon" aria-hidden="true">{{.IconSVG}}</span>{{end}}{{.Label}}</a> {{end}}<a class="nav-link{{if .Active}} active{{end}}" href="{{$.BasePath}}{{.Href}}"{{if .Active}} aria-current="page"{{end}}>{{if .IconSVG}}<span class="yw-nav-icon" aria-hidden="true">{{.IconSVG}}</span>{{end}}{{.Label}}</a>
{{end}} {{end}}
</div> </div>{{end}}
{{end}} {{end}}