feat: extractBoardContext slug extraction utility #107

Open
opened 2026-04-13 00:12:51 +00:00 by forgejo_admin · 0 comments
Contributor

Type

Feature

Lineage

Subtask of #104 (enriched board renderer for board note HTML rendering).

Repo

forgejo_admin/pal-e-app

User Story

As a board renderer
I want to extract architecture and user story slugs from board note content
So that I can enrich the kanban view with linked note context

Context

The enriched board renderer needs to identify which architecture notes and user story notes are referenced in a board note's content blocks. The extractBoardContext function is a pure utility that scans the block array for "Architecture" and "User Stories" heading sections, then extracts all arch-* and story-* slugs from the content within those sections.

This is foundational work for the board renderer feature (#104).

File Targets

  • src/lib/board-context.ts -- create with extractBoardContext function and BoardContextData interface

Acceptance Criteria

  • Function compiles with no TypeScript errors
  • extractBoardContext parses "Architecture" section correctly
  • extractBoardContext parses "User Stories" section correctly
  • arch-* slugs extracted from inline code and note links
  • story-* slugs extracted from table cells
  • No duplicate slugs in output arrays

Test Expectations

  • Unit test: verify extraction from architecture section with code and links
  • Unit test: verify extraction from user stories section with table cells
  • Unit test: verify section boundary detection (stops at same-level heading)
  • Unit test: verify deduplication works

Constraints

  • Pure function with no side effects
  • Operates on Block[] type from api-client.ts
  • Returns BoardContextData interface
  • arch-* slug pattern: arch-[a-z0-9-]+
  • story-* slug pattern: story-[a-z0-9-]+

Checklist

  • File created
  • TypeScript validation passes
  • Commit created
  • PR opened
  • pal-e-app -- project
  • #104 -- parent feature (enriched board renderer)
### Type Feature ### Lineage Subtask of #104 (enriched board renderer for board note HTML rendering). ### Repo `forgejo_admin/pal-e-app` ### User Story As a board renderer I want to extract architecture and user story slugs from board note content So that I can enrich the kanban view with linked note context ### Context The enriched board renderer needs to identify which architecture notes and user story notes are referenced in a board note's content blocks. The extractBoardContext function is a pure utility that scans the block array for "Architecture" and "User Stories" heading sections, then extracts all `arch-*` and `story-*` slugs from the content within those sections. This is foundational work for the board renderer feature (#104). ### File Targets - `src/lib/board-context.ts` -- create with extractBoardContext function and BoardContextData interface ### Acceptance Criteria - [ ] Function compiles with no TypeScript errors - [ ] extractBoardContext parses "Architecture" section correctly - [ ] extractBoardContext parses "User Stories" section correctly - [ ] arch-* slugs extracted from inline code and note links - [ ] story-* slugs extracted from table cells - [ ] No duplicate slugs in output arrays ### Test Expectations - [ ] Unit test: verify extraction from architecture section with code and links - [ ] Unit test: verify extraction from user stories section with table cells - [ ] Unit test: verify section boundary detection (stops at same-level heading) - [ ] Unit test: verify deduplication works ### Constraints - Pure function with no side effects - Operates on Block[] type from api-client.ts - Returns BoardContextData interface - arch-* slug pattern: `arch-[a-z0-9-]+` - story-* slug pattern: `story-[a-z0-9-]+` ### Checklist - [ ] File created - [ ] TypeScript validation passes - [ ] Commit created - [ ] PR opened ### Related - `pal-e-app` -- project - #104 -- parent feature (enriched board renderer)
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/pal-e-app#107
No description provided.