Skip to content

Add debug context viewer and document/framework popups#29

Merged
neyec merged 4 commits into
mainfrom
feature/debug-context-viewer
May 27, 2026
Merged

Add debug context viewer and document/framework popups#29
neyec merged 4 commits into
mainfrom
feature/debug-context-viewer

Conversation

@neyec

@neyec neyec commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Debug context viewer: red "Debug" button (visible when NORMA_DEBUG=true) on each page header, showing only the context that page contributes to Norma's system prompt. Full system prompt shown on the chat page.
  • Document popups: clicking an uploaded document opens a full-screen modal with its markdown summary. Added delete button for uploaded framework documents and custom documents.
  • Framework popups: clicking a framework card opens a full-screen viewer with the full framework content rendered as markdown, with word count and page estimate.
  • Unified overview section: description and risk classification pages share a combined debug output with "EU AI Act Risk Classification" subsection.
  • Evidence grouping: reporting debug output groups evidence by framework (EU AI Act, UNDP, Environmental) with answer counts and human-readable labels.
  • UNDP framework content: loaded the full UNDP Human Rights Assessment toolkit summary as framework knowledge.
  • Bug fixes: document upload 422 (route ordering), nginx upload size limit, api.delete 204 handling, markdown separator stripping.
  • i18n: all new UI text translated to en/es/fr/de.

Test plan

  • Enable NORMA_DEBUG=true and verify the debug button appears on all pages
  • Click Debug on each page and verify only the relevant context section is shown
  • Upload a PDF to additional documents and verify it appears in the list
  • Click an uploaded document and verify the summary popup renders markdown
  • Delete an uploaded document (both framework and custom) and verify it's removed
  • Click each framework card and verify the content viewer opens with markdown
  • Verify UNDP framework shows full content instead of "no content available"
  • Check the reporting debug output groups evidence by framework with counts
  • Verify no horizontal scrolling in document tables

🤖 Generated with Claude Code

neyec and others added 4 commits May 27, 2026 12:03
- Per-page debug button showing relevant Norma context section
- Clickable document rows with full markdown summary popup
- Clickable framework cards with full content viewer popup
- Delete button for uploaded documents (framework + custom)
- Unified overview section for description and risk classification pages
- Evidence questions data with human-readable labels and framework grouping
- UNDP Human Rights Assessment framework content
- Fix document upload route ordering (422 bug)
- Fix nginx upload size limit (client_max_body_size 50m)
- Fix api.delete handling of 204 responses
- Enforce summary section ordering in pipeline prompt
- Strip markdown separators from LLM-generated output
- Word count and page estimate in viewer dialogs
- i18n translations for all new UI text (en/es/fr/de)

Closes #28

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restructure debug-context-dialog to avoid synchronous setState in
useEffect by wrapping in Promise chain. Fix mermaid cleanLabel to
unwrap parenthesised node definitions before stripping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neyec neyec merged commit 634a313 into main May 27, 2026
4 checks passed
@neyec neyec deleted the feature/debug-context-viewer branch May 27, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant