From 3f36ed529a878ca5c1b23447dea9eab6b6fa649e Mon Sep 17 00:00:00 2001 From: vickydotbat Date: Sat, 23 May 2026 20:10:01 +0200 Subject: [PATCH] Class skillls/list splitting --- .../plans/2026-05-23-wiki-list-columns.md | 47 ++++++ internal/topdata/wiki_data_providers.go | 81 ++++++++- internal/topdata/wiki_native_test.go | 158 ++++++++++++++++++ internal/topdata/wiki_template.go | 56 ++++++- 4 files changed, 335 insertions(+), 7 deletions(-) create mode 100644 docs/superpowers/plans/2026-05-23-wiki-list-columns.md diff --git a/docs/superpowers/plans/2026-05-23-wiki-list-columns.md b/docs/superpowers/plans/2026-05-23-wiki-list-columns.md new file mode 100644 index 0000000..2c1c0d5 --- /dev/null +++ b/docs/superpowers/plans/2026-05-23-wiki-list-columns.md @@ -0,0 +1,47 @@ +# Wiki List Columns Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Add a template-driven topdata wiki option for splitting provider-backed lists into configured columns with a fixed item count and optional forced empty columns. + +**Architecture:** The toolkit wiki renderer gains a generic `columns` data-provider source that wraps another provider and exposes one row per rendered column. Each column row exposes `Items`, `Index`, and count metadata so page templates own markup while YAML owns row selection and chunking behavior. The module class page uses this provider for `ClassSkills`. + +**Tech Stack:** Go `sow-toolkit`, YAML topdata wiki config, local HTML templates, Go tests. + +--- + +### Task 1: Renderer Provider + +**Files:** +- Modify: `toolkit/internal/topdata/wiki_data_providers.go` +- Modify: `toolkit/internal/topdata/wiki_template.go` +- Test: `toolkit/internal/topdata/wiki_native_test.go` + +- [ ] Write failing tests for a `columns` provider that chunks `ClassSkills` into rows with nested `Items`, including forced empty columns. +- [ ] Run `go test ./internal/topdata -run 'TestWikiTemplate.*Column|TestBuildNativeWikiRendersClassSkillColumns'` and confirm the new assertions fail because `columns` is not supported. +- [ ] Add `provider`, `columns`, `items_per_column`, and `force_columns` fields to `wikiDataProviderDefinition`. +- [ ] Validate that `columns` providers name an existing provider, use positive integer `columns` and `items_per_column`, and do not point at themselves. +- [ ] Allow nested `{{#each Items}}` loops by teaching template `#each` to iterate an array field from the current row before falling back to named providers. +- [ ] Implement deterministic chunking: each column receives up to `items_per_column`; extra source items continue into additional overflow columns; `force_columns: true` emits empty configured columns when there are fewer items. + +### Task 2: Module Template + +**Files:** +- Modify: `module/topdata/wiki/data.yaml` +- Modify: `module/topdata/wiki/templates/pages/classes.html` +- Modify: `module/topdata/wiki/README.md` + +- [ ] Add `ClassSkillColumns` using `source: columns`, `provider: ClassSkills`, `columns: 3`, `items_per_column: 12`, and `force_columns: true`. +- [ ] Replace the flat class skill `