docs: progressive complexity guide and feature documentation#221
docs: progressive complexity guide and feature documentation#221
Conversation
- Rewrite README "Why" section to highlight inference → declaration → control gradient instead of generic "start simple, add power" - Replace README "What You Can Build" example with Tier 1 markdown-native approach (no HTML), then show HTML as the "more control" option - Add computed source to data sources table (9 sources now) - New guide: docs/guides/progressive-complexity.md — covers all 5 tiers with examples, source matching, computed sources, and a decision table - New source doc: docs/sources/computed.md — full reference for group_by, aggregate, filter, limitations - Update auto-rendering guide with auto-tables (inference-based) section - Update data-sources guide with computed source entry - Update frontmatter reference with auto_bind, group_by, aggregate, filter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds/updates documentation to explain Tinkerdown’s “progressive complexity” approach and to document the new computed source type, while refreshing several reference pages and the README to use more markdown-native examples.
Changes:
- Adds a new Progressive Complexity guide describing tiers 0–4 and how to “graduate” to more explicit UI/rendering approaches.
- Introduces
computedsource documentation (config, functions, filtering, behavior/limitations) and links it from existing reference pages. - Updates README and auto-rendering/data-sources/frontmatter docs to reflect the new guidance and source type.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/sources/computed.md | New reference for the computed source type (config, functions, filtering, behavior/limitations). |
| docs/reference/frontmatter.md | Adds computed to frontmatter source type examples and options. |
| docs/guides/progressive-complexity.md | New “tiers” guide explaining incremental adoption from markdown to HTML, templates, and WASM. |
| docs/guides/data-sources.md | Adds computed to the supported source types list. |
| docs/guides/auto-rendering.md | Clarifies the two auto-rendering modes (inference via markdown tables vs HTML attributes). |
| README.md | Updates positioning, examples, and source list to include computed + progressive complexity narrative. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/reference/frontmatter.md
Outdated
| | `exec` | `type: exec`<br>`command: uname -a` | | ||
| | `markdown` | `type: markdown`<br>`path: ./_data/posts/` | | ||
| | `wasm` | `type: wasm`<br>`module: ./custom.wasm` | | ||
| | `computed` | `type: computed`<br>`from: expenses`<br>`group_by: category`<br>`aggregate:`<br>` total: sum(amount)` | |
There was a problem hiding this comment.
In this frontmatter reference, the source type examples table still uses legacy sqlite fields (path/query) above. The current configuration uses db + table for sqlite, so readers copying from this section will end up with non-working config. Consider updating the sqlite example in the same table while you’re already editing this section to add computed.
| sources: | ||
| tasks: | ||
| type: sqlite | ||
| path: ./tasks.db | ||
| query: SELECT * FROM tasks | ||
| db: ./tasks.db | ||
| table: tasks | ||
| readonly: false |
There was a problem hiding this comment.
The README now uses db/table for sqlite in the primary example, but later in the same README there’s still a YAML snippet using legacy path/query (and path for JSON) which don’t match the current config keys. For consistency and copy/paste correctness, update the remaining snippets to use db/table (sqlite) and file (json/csv/markdown), etc.
| - **AI gets it right.** A single declarative file with no component tree or state management means less surface area for LLMs to misconfigure. | ||
| - **8 data sources out of the box.** SQLite, PostgreSQL, REST APIs, JSON, CSV, shell commands, markdown, and WASM. Point at existing infrastructure and get a working UI. | ||
| - **Start simple, add power as needed.** Plain markdown tables become editable grids. Add YAML frontmatter for databases, or drop to HTML + Go templates for full control. | ||
| - **9 data sources out of the box.** SQLite, PostgreSQL, REST APIs, JSON, CSV, shell commands, markdown, WASM, and computed/derived sources. Point at existing infrastructure and get a working UI. |
There was a problem hiding this comment.
The README claims “9 data sources out of the box” but the codebase also supports a graphql source type (and the docs include it). Either include GraphQL in the list and update the count, or adjust the wording to avoid an incorrect/fragile count.
| - **9 data sources out of the box.** SQLite, PostgreSQL, REST APIs, JSON, CSV, shell commands, markdown, WASM, and computed/derived sources. Point at existing infrastructure and get a working UI. | |
| - **10 data sources out of the box.** SQLite, PostgreSQL, REST APIs, GraphQL, JSON, CSV, shell commands, markdown, WASM, and computed/derived sources. Point at existing infrastructure and get a working UI. |
| - **Single-file apps**: Everything in one markdown file with frontmatter | ||
| - **8 data sources**: SQLite, JSON, CSV, REST APIs, PostgreSQL, exec scripts, markdown, WASM | ||
| - **9 data sources**: SQLite, JSON, CSV, REST APIs, PostgreSQL, exec scripts, markdown, WASM, computed | ||
| - **Auto-rendering**: Tables, selects, and lists generated from data |
There was a problem hiding this comment.
The “9 data sources” feature list omits the graphql source type that’s supported in code and documented elsewhere. Consider including GraphQL here (and updating the count), or removing the numeric count to avoid it getting out of sync as source types evolve.
| | `<=` | Less than or equal | | ||
| | `>=` | Greater than or equal | |
There was a problem hiding this comment.
The filter operator list includes <= and >=, but the current filter parser regex matches </> before <=/>=, so expressions like points >= 10 will be parsed incorrectly (operator becomes > and value becomes = 10). Either update the docs to omit <=/>= for now, or fix the parser to prioritize <=/>= in the operator match (and add tests for these operators).
| | `<=` | Less than or equal | | |
| | `>=` | Greater than or equal | |
|
|
||
| ## Behavior | ||
|
|
||
| - **Auto-refresh:** When the parent source is modified (add, update, delete), all computed sources that depend on it are automatically refreshed. |
There was a problem hiding this comment.
Auto-refresh currently triggers for write-mutating actions including toggle (in addition to add/update/delete). The behavior description should include toggle or describe this more generally as “write operations” to match runtime behavior.
| - **Auto-refresh:** When the parent source is modified (add, update, delete), all computed sources that depend on it are automatically refreshed. | |
| - **Auto-refresh:** When the parent source is modified by a write operation (add, update, delete, toggle), all computed sources that depend on it are automatically refreshed. |
| func Fetch() []map[string]interface{} { | ||
| // Custom data fetching logic | ||
| return []map[string]interface{}{ | ||
| {"name": "Custom Item", "value": 42}, | ||
| } | ||
| } |
There was a problem hiding this comment.
The Tier 4 WASM code example uses a plain func Fetch() []map[string]interface{} signature, but the runtime expects specific WASM exports (e.g., fetch, get_result_len, etc.). Update this example to match the actual WASM source interface so it’s copy/pasteable and works with the current loader.
| func Fetch() []map[string]interface{} { | |
| // Custom data fetching logic | |
| return []map[string]interface{}{ | |
| {"name": "Custom Item", "value": 42}, | |
| } | |
| } | |
| import "encoding/json" | |
| var result []byte | |
| //export fetch | |
| func fetch() { | |
| // Custom data fetching logic | |
| data := []map[string]interface{}{ | |
| {"name": "Custom Item", "value": 42}, | |
| } | |
| // Marshal to JSON so the host can read a single contiguous buffer. | |
| b, err := json.Marshal(data) | |
| if err != nil { | |
| // On error, return an empty JSON array. | |
| result = []byte("[]") | |
| return | |
| } | |
| result = b | |
| } | |
| //export get_result_ptr | |
| func get_result_ptr() *byte { | |
| if len(result) == 0 { | |
| return nil | |
| } | |
| return &result[0] | |
| } | |
| //export get_result_len | |
| func get_result_len() int { | |
| return len(result) | |
| } | |
| func main() {} |
| | [csv](../sources/csv.md) | CSV files | Spreadsheet data, imports | | ||
| | [markdown](../sources/markdown.md) | Markdown files | Content management | | ||
| | [wasm](../sources/wasm.md) | WebAssembly modules | Custom sources | | ||
| | [computed](../sources/computed.md) | Derived/aggregated data | Dashboards, summaries | |
There was a problem hiding this comment.
This guide still shows legacy sqlite configuration keys (path/query) elsewhere in the file, but the current config struct expects db + table for sqlite sources. Since this PR adds a new source type row, it’s a good opportunity to update the existing sqlite examples on this page to the correct keys (and similarly align other source examples if they use outdated field names).
PR Review — docs: progressive complexity guide and feature documentationOverall this is a well-structured docs-only PR. The new guide is accurate against the implementation and the cross-linking between documents is solid. A few things worth addressing. Bugs / Inaccuracies
The filter operators table documents Suggested fix:
The computed source example in the table uses Minor Issues
The guide says heading "My Monthly Expenses" matches source
The docs correctly show Verified Correct
The Generated with Claude Code |
- Document != as case-insensitive (matches code behavior) - Note that computed source filter requires field-operator-value form - Simplify computed source example in frontmatter table - Clarify word containment matching uses slugified heading - Add screenshot placeholder for "What You Can Build" section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review: docs: progressive complexity guide and feature documentationGood overall — the progressive complexity framing is a clear improvement over the previous README, and the computed source docs are well-structured. A few issues worth addressing before merge. Bug: SQLite config syntax mismatchThe PR introduces a new sqlite shorthand ( sources:
tasks:
type: sqlite
db: ./tasks.db
table: tasks
readonly: falseBut sources:
tasks:
type: sqlite
path: ./tasks.db
query: SELECT * FROM tasksIf this is a new simplified syntax that was added to the engine, the sqlite source docs need updating too. If it's not yet implemented, the new examples will silently fail. Either way, the docs are now inconsistent — this should be resolved. TODO comment left in README<!-- TODO: Add screenshot of rendered auto-table with CRUD controls -->This should either be resolved before merge or tracked as a follow-up issue and removed from the PR. Source matching rule 3 is surprisingly broadThe "word containment" matching rule in progressive-complexity.md:
This seems like it could cause unexpected auto-binds in real apps with generic source names like Minor:
|
- Note that exact matches take precedence over containment - Mention auto_bind: false as escape hatch for generic source names - Add YAML quoting note for filter expressions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR Review: Progressive Complexity Guide and Feature DocumentationOverall this is a solid docs addition — the progressive complexity framing is intuitive, and the computed source is well-documented. A few issues to fix before merging. Bugs / Inaccuracies1. Tier 4 WASM example uses the wrong function signature (blocker)
func Fetch() []map[string]interface{} {
return []map[string]interface{}{
{"name": "Custom Item", "value": 42},
}
}But //export fetch
func fetch(configPtr *byte, configLen int) (dataPtr *byte, dataLen int) { ... }The simplified signature doesn't compile or work with TinyGo + the Tinkerdown WASM ABI. Either fix the example to match the actual interface, or add a note like "see the WASM source docs for the full interface" without showing pseudocode as real code. 2. Unresolved TODO comment in README (blocker) <!-- TODO: Add screenshot of rendered auto-table with CRUD controls -->This shouldn't be merged as-is. Either add the screenshot, or remove the comment and do it in a follow-up. 3. The configuration table says:
But the code examples throughout the file show it unquoted: filter: status = active # optionalPick one convention and apply it consistently. Since the docs themselves recommend quoting, the examples should show quotes. Inconsistency with Existing Docs4. README and progressive-complexity.md use The new examples use: type: sqlite
db: ./tasks.db
table: tasksThe canonical sqlite source doc uses: type: sqlite
path: ./tasks.db
query: SELECT * FROM tasksThe examples directory confirms Missing Information5. Since 6. The docs show only single-field grouping ( Minor
What's Working Well
|
- Replace incorrect WASM function signature with accurate description and template scaffold recommendation - Replace TODO screenshot placeholder with text description Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ReviewDocs-only PR with solid structure. The progressive complexity framing is clear and the computed source reference is thorough. A few issues to address:
|
Headless Chrome screenshot showing the rendered expense tracker with data table, edit/delete buttons, and add form — all generated from a markdown table + YAML source definition. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review: docs: progressive complexity guide and feature documentationThis is a well-written docs PR overall — the progressive complexity framing is clear and the new computed source reference is thorough. A few issues worth fixing before merge. Bug / Inaccuracy
The configuration block shows: filter: status = active # optionalBut the
These contradict each other. Every filter example in the file uses the unquoted form, but the table warns to quote it. Pick one and apply it consistently — if quoting is needed to avoid YAML misparse, the examples should show it: filter: "status = active" # optionalCLAUDE.md CompliancePer project CLAUDE.md: "check if a lvt-* attribute is already implemented in the livetemplate/client repository before reimplementing it" This PR documents several
Can you confirm these are already implemented in Minor Issues
The new README example switches the SQLite source from: path: ./tasks.db
query: SELECT * FROM tasksto: db: ./tasks.db
table: tasksIf
The Tier 1 section covers computed sources but doesn't mention that a computed source cannot reference another computed source as its parent. Users following the guide naturally try to build up analysis pipelines. A single sentence under "Computed Sources" would prevent a confusing startup error. Looks Good
|
…e config - Quote all filter examples consistently in computed.md - Remove redundant quoting warning from table description - Add computed source chaining limitation note in progressive guide - Update frontmatter sqlite example to use db: + table: (current form) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR Review: Progressive Complexity Guide and Feature DocumentationOverall this is a solid docs PR. The progressive complexity framing is well-structured and the examples are consistent with what is in the codebase. A few issues worth addressing before merge. Issues1. SQLite API inconsistency (medium) The PR updates README and the progressive-complexity guide to use the new 2. In But 3. Filter value syntax is underspecified (minor) The filter syntax uses bare unquoted values (e.g. 4. Word containment matching could surprise users (minor) The "My Monthly Expenses" matches 5. No-chaining constraint not surfaced near The constraint that computed sources cannot reference other computed sources is only in the Limitations section at the bottom of Nits
What is good
Reviewed with Claude Code |
Summary
Test plan
🤖 Generated with Claude Code