Review: render note content inline on project detail page
Verdict: NEEDS_REFINEMENT
Template Completeness
- [x] Type -- Feature
- [x] Lineage -- Standalone, references 482e8e7
- [x] Repo -- ldraney/paldocs
- [x] User Story -- As a superadmin, I want to read note content directly on the project page
- [x] Context -- Explains page_note pattern extension, html_content from pal-e-docs
- [x] File Targets -- 3 targets + 1 exclusion
- [x] Feature Flag -- none (UI enhancement, appropriate)
- [x] Acceptance Criteria -- 5 criteria
- [x] Test Expectations -- integration + unit + run command
- [x] Constraints -- Turbo/Stimulus, sanitize, collapsed-by-default
- [x] Checklist -- standard 3-item
- [x] Related -- project-paldocs, issue #12
Traceability
- [x] story:project-pages label -- present on board item #1385
- [x] story note verified --
story-paldocs-project-pagesexists in pal-e-docs AND listed inproject-paldocsuser-stories section - [x] arch:rails-views label -- present on board item #1385
- [ ] arch note MISSING -- [SCOPE] No
arch-rails-viewsnote found in pal-e-docs. Create architecture notearch-rails-viewsfor the Rails views component. - [x] Forgejo issue -- ldraney/paldocs#24, state: open
File Targets
- [x]
app/views/projects/show.html.erb-- verified: exists (2.7k, 77 lines). Currently renders notes as title+slug links grouped by type (lines 36-54). No expand/collapse mechanism exists yet. - [x]
app/assets/stylesheets/-- verified: directory exists withapplication.css(20k). No inline-note-content styles exist yet. - [x]
app/controllers/projects_controller.rb-- verified: exists (14 lines). Already includes:notesin eager loading (line 7).html_contentis a text column on the notes table, so it loads automatically with the Note records -- no additional includes needed. - [x]
app/views/blocks/(exclusion) -- verified: directory exists with_block.html.erb. Exclusion is correct -- blocks partial is for structured block rendering of page_note only.
Repo Placement
OK. Issue filed on
ldraney/paldocs, all file targets are in paldocs. Single-repo change.Dependencies
- Board item #1343 (issue #12, "render project page note content on project show page") -- done. This is the prerequisite page_note rendering work. Completed. No blocker.
- Board item #1344 (issue #13, "add Postgres trigger to bump projects.updated_at") -- in_progress. Not a direct dependency for this ticket (it's about sorting, not rendering), but same story.
- Board item #1386 (issue #25, "collapsible accordion sections sorted by most recently modified") -- backlog. This is a sibling feature in the same story. The accordion/expand UI from #25 may overlap with the expand/collapse mechanism in this ticket. Not a blocker, but agents should be aware of potential UI pattern convergence.
- No dependencies documented in the issue scope. The Lineage section references 482e8e7 (link notes to pal-e-docs) which is merged.
Acceptance Criteria
5 criteria -- all are verifiable by an agent:
- AC1: Expand note to show html_content -- testable via integration test
- AC2: Collapsed shows title + slug -- testable (current behavior)
- AC3: Expanded renders HTML safely (sanitized) -- testable,
sanitizehelper already used in blocks partial - AC4: No-content placeholder -- testable with nil html_content
- AC5: External pal-e-docs link still available -- testable
Test commands are valid (
bundle exec rspec spec/). No existing specs exist beyond helpers -- agent will need to create specs from scratch.Blast Radius
html_contentis a text column that can contain arbitrary HTML from pal-e-docs. The ticket correctly requires sanitization. The existingsanitizepattern inapp/views/blocks/_block.html.erb(line 23) provides the reference pattern with allowed_tags and allowed_attributes.- No other views currently render
html_contentdirectly -- this is net-new rendering surface. - Turbo Frames / Stimulus: the app already uses Hotwire (turbo-rails + stimulus imported in application.js, kanban_controller.js exists). Adding a new Stimulus controller for expand/collapse is consistent with the existing architecture.
Decomposition Assessment
3 file targets in 1 repo. 5 acceptance criteria. Estimated agent work: ~3-4 minutes. No decomposition needed.
Recommendation
[SCOPE]Create architecture notearch-rails-viewsfor the Rails views component. This label is used by 3 board items (#1220, #1342, #1343 -- all done) plus this ticket. The component deserves a backing arch note documenting view conventions, partial structure, and Hotwire patterns.