feat: composition rendering — parent notes render child notes inline #62
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan
plan-2026-03-01-note-decomposition-- Phase 4 (Browse Frontend — Composition Rendering)Repo
forgejo_admin/pal-e-docsUser Story
As a human browsing pal-e-docs,
I want plan pages to render their child phase notes inline as one scrollable page,
So that decomposed plans look identical to monolithic plans — same UX, better data structure.
Context
Phase 2 (PR #61) added
note_type,status,parent_note_id,positioncolumns to the notes table. Phase 3 (PR #6 on pal-e-docs-mcp) exposed these in MCP tools. The schema supports parent-child note relationships, but the browse frontend still renders each note independently. A plan with child phases currently shows only the parent'shtml_content— the children are invisible on the parent page.This phase makes the browse frontend compose child notes into the parent page at render time. The
Notemodel already has achildrenrelationship (models.py:90-95) ordered byposition. The rendering pipeline (sanitize_html → autolink_slugs → wrap_tables) must run on each child independently.Key decisions from the plan:
is_publicfor unauthenticated usersFile Targets
Files to modify:
src/pal_e_docs/routes/frontend.py—browse_note()route: eager-load children, apply rendering pipeline to each, pass rendered children to template. Also: when viewing a child note directly, include parent link in context.src/pal_e_docs/templates/note.html— add child rendering section after parent content. When viewing a child, show "Part of: {parent title}" breadcrumb.src/pal_e_docs/templates/base.html— add CSS for.child-notesection styling (border-left accent, spacing)Files to create:
tests/test_composition_rendering.py— composition rendering test scenariosFiles NOT to touch:
sanitize.py,autolink.py,wrap_tables.py— used as-is, no changesmodels.py—childrenrelationship already exists (line 90-95, ordered by position)schemas.py— no API changes in this phaseroutes/notes.py— API routes unchangedlanding.html,project_notes.html, etc.) — unchangedAcceptance Criteria
position<h2>headingis_public)parent_note_idTest Expectations
.child-notedivs)is_public=Falsenot rendered when no session<code>known-slug</code>gets auto-linked, child with<table>gets wrappedPALDOCS_DATABASE_PATH=:memory: python -m pytest tests/test_composition_rendering.py -vConstraints
routes/frontend.py— usejoinedloadfor eager loading,_apply_public_filterhelper for privacyNote.childrenrelationship (models.py:90-95) is already ordered byNote.position— use it directlysanitize_html → autolink_slugs → wrap_tablesget_known_slugs(db)for auto-linking (cached, same call for parent and all children)test_browse_ux.py— useTestingSessionLocalfor direct DB setup,clientfixture for HTTP assertions.child-noteclass with a left border accent (e.g.border-left: 3px solid #0366d6) to visually distinguish child sections from parent contentruff check src/ tests/andruff format --check src/ tests/before PRChecklist
Related
project-pal-e-docs— project this affectsget_noteMCP tool and dogfood the full flow