PRD: Overview Tab Nested Navigation
Issue: #258 (Enhancement)
Status: Draft
Created: 2025-11-01
Author: AI Assistant
Overview
Restructure the page viewer tab navigation by nesting Explanation and Transcript tabs within the Overview tab, creating a more intuitive and organized user experience for viewing different types of page content.
Problem Statement
Current State
The page viewer has five root-level tabs:
- Overview - Page metadata, summary, and compliance summary
- Preview - PDF preview with annotations
- Compliance - Detailed compliance reports
- Details - AI-generated page explanation (issue #258)
- Raw Markdown - Raw page.md transcript
Current URL Pattern:
/projects/:planId/files/:fileId/pages/:pageNumber/:tab
Example:
https://test.m3.codeproof.app/projects/san-jose-multi-file3/files/1/pages/1/details
https://test.m3.codeproof.app/projects/san-jose-multi-file3/files/1/pages/1/raw-markdown
Problems
- Flat Navigation: All tabs at the same level creates cognitive overhead
- Unclear Relationships: Details and Raw Markdown are both "text views" of the page, but their relationship to Overview is unclear
- Tab Clutter: Five root-level tabs feels crowded
- Naming Confusion:
- "Details" doesn't clearly communicate its purpose (AI-generated explanation)
- "Raw Markdown" is too technical for non-developer users
- Navigation Friction: Users must switch between root-level tabs to see different representations of the same page content
Solution
Proposed Structure
Root-Level Tabs (non-closeable):
- Overview - Contains nested sub-tabs (see below)
- Preview - PDF preview (unchanged)
- Compliance - Detailed compliance reports (unchanged)
- Dynamic tabs (closeable) - Individual compliance section reports
Nested Tabs within Overview (non-closeable):
- Explanation (default) - AI-generated page explanation
- Transcript - Raw page.md content
- Compliance - Compliance summary (existing overview content)
New URL Pattern
/projects/:planId/files/:fileId/pages/:pageNumber/overview#subtab
Examples:
https://test.m3.codeproof.app/projects/san-jose-multi-file3/files/1/pages/1/overview#explanation
https://test.m3.codeproof.app/projects/san-jose-multi-file3/files/1/pages/1/overview#transcript
https://test.m3.codeproof.app/projects/san-jose-multi-file3/files/1/pages/1/overview#compliance
https://test.m3.codeproof.app/projects/san-jose-multi-file3/files/1/pages/1/overview (defaults to #explanation)
Why Fragments?
- Semantically correct (fragments are for page sections)
- Natural default behavior (no fragment = default tab)
- Simpler implementation (no nested routing)
- Browser history still works
- Cleaner, more intuitive URLs
Legacy root-level URLs redirect to fragment-based equivalents:
/pages/1/details→/pages/1/overview#explanation/pages/1/raw-markdown→/pages/1/overview#transcript/pages/1/overview→/pages/1/overview(defaults to #explanation)
Visual Hierarchy
┌─────────────────────────────────────────────────────────────┐
│ [Overview] [Preview] [Compliance] [Section 1234.5 ×] │
├─────────────────────────────────────────────────────────────┤
│ │
│ Page Title: Foundation Plan │
│ Page #: 1 Sheet ID: A-1.0 │
│ Summary: Shows foundation layout and structural details... │
│ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ [Explanation] [Transcript] [Compliance] │ │
│ ├───────────────────────────────────────────────────────┤ │
│ │ │ │
│ │ [Content based on selected sub-tab] │ │
│ │ │ │
│ │ Explanation: AI-generated educational content │ │
│ │ Transcript: Raw page.md text │ │
│ │ Compliance: Compliance summary (existing) │ │
│ │ │ │
│ └───────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
User Stories
Story 1: View Nested Tabs in Overview
As a project reviewer
I want to see Explanation, Transcript, and Compliance as nested tabs within Overview
So that I can easily navigate between different text representations of the page
Acceptance Criteria:
- Overview tab contains a nested tab group
- Nested tabs show: Explanation (default), Transcript, Compliance
- Nested tabs are non-closeable
- Explanation tab is selected by default when navigating to a page
- Tab selection persists in URL and browser history
- Back/forward navigation works correctly
Story 2: Renamed Tabs with Clear Purpose
As a non-technical user
I want to see clear, descriptive tab names
So that I understand what content each tab contains
Acceptance Criteria:
- "Details" is renamed to "Explanation"
- "Raw Markdown" is renamed to "Transcript"
- Tab names are visible and readable in the UI
- Tooltips (optional) provide additional context
Story 3: Updated URL Structure
As a user sharing links
I want to use URLs that reflect the nested structure
So that shared links navigate to the correct nested tab
Acceptance Criteria:
- URLs follow pattern:
/pages/:pageNumber/overview#subtab - Valid fragments:
explanation,transcript,compliance - Default behavior: no fragment or invalid fragment shows
explanationtab - Fragment changes update URL and browser history
- Legacy URLs redirect correctly:
/pages/1/details→/pages/1/overview#explanation/pages/1/raw-markdown→/pages/1/overview#transcript/pages/1/overview→/pages/1/overview(defaults to explanation)
Story 4: Migrate Compliance Summary Content
As a developer
I want to move the compliance summary section into the Compliance nested tab
So that the Overview tab structure is clean and organized
Acceptance Criteria:
- Existing compliance summary section removed from Overview root
- Compliance summary content rendered in Compliance nested tab
- Styling and formatting preserved
- Loading states preserved
- Error handling preserved
Story 5: Preserve Root-Level Tab Behavior
As a user
I want to see unchanged behavior for Preview and Compliance tabs
So that my existing workflows are not disrupted
Acceptance Criteria:
- Preview tab remains at root level (unchanged)
- Compliance tab remains at root level (unchanged)
- Dynamic compliance report tabs remain closeable
- Tab indices 0-2 remain non-closeable
Technical Scope
Components to Modify
-
TabService (
web-ng-m3/src/app/shared/tab.service.ts)- Remove Details and Raw Markdown from root tabs
- Keep only: Overview, Preview, Compliance
-
OverviewComponent (
web-ng-m3/src/app/components/project/pages/overview/)- Add nested
mat-tab-group - Create three nested tabs: Explanation, Transcript, Compliance
- Subscribe to
route.fragmentfor tab selection - Update URL fragment on tab change
- Migrate compliance summary content to Compliance nested tab
- Add nested
-
MainViewComponent (
web-ng-m3/src/app/components/project/main-view/)- Add legacy URL redirect logic (details → overview#explanation, etc.)
Components to Reuse
- DetailsComponent - Reused for Explanation nested tab
- RawMarkdownComponent - Reused for Transcript nested tab
- Existing compliance summary HTML - Moved to Compliance nested tab
Out of Scope
- Changes to Preview tab
- Changes to Compliance tab (root-level)
- Changes to dynamically added compliance report tabs
- Changes to drawer/navigation sidebar
- Backend API changes
- Mobile responsiveness (handled by Material Design)
- Nested routing configuration (using fragments instead)
Success Metrics
User Experience
- Reduced Navigation Clicks: Users can view all page text content within Overview tab
- Clearer Information Architecture: Nested tabs communicate content relationships
- Improved Discoverability: Default to Explanation tab highlights AI-generated content
Technical Quality
- URL Consistency: All URLs follow nested pattern
- Zero Broken Links: Legacy URLs redirect correctly
- Preserved Functionality: All existing features work as before
- Performance: No degradation in tab switching speed
Design Considerations
Tab Naming Rationale
| Old Name | New Name | Rationale |
|---|---|---|
| Details | Explanation | "Explanation" clearly communicates AI-generated educational content |
| Raw Markdown | Transcript | "Transcript" is more accessible and describes the content (extracted text) |
| (Compliance Summary Section) | Compliance | Nested tab name aligns with root-level Compliance tab |
Default Tab Selection
Explanation is the default nested tab because:
- It provides the most value to end users (AI-generated, beginner-friendly)
- Issue #258 positions it as a primary feature
- Compliance summary is still accessible, just one click away
- Transcript is for advanced/debugging use cases
URL Structure Philosophy
URL Fragments (/overview#explanation) are preferred over path segments (/overview/explanation) or query params (/overview?tab=explanation) because:
- Semantically correct: Fragments are designed for in-page navigation
- Simpler routing: No nested routes needed - single route handles all cases
- Natural defaults:
/overviewworks without fragment, defaults to first tab - Browser history: Fragment changes still create history entries
- Less code: ~80% less routing configuration code
- Cleaner URLs: Clearly indicates UI state within the same view
- Standard pattern: Common for tab navigation in web apps
Migration Plan
Phase 1: Frontend Updates (Week 1)
- Update TabService (remove Details and Raw Markdown tabs)
- Modify OverviewComponent with nested tabs and fragment handling
- Add legacy URL redirects in MainViewComponent
- Update tab naming (Details → Explanation, Raw Markdown → Transcript)
Phase 2: Testing (Week 1)
- Manual testing of all tab combinations
- Test URL navigation (direct, back/forward)
- Test legacy URL redirects
- Verify no regressions in Preview/Compliance tabs
- Cross-browser testing
Phase 3: Deployment (Week 2)
- Deploy to test environment
- User acceptance testing
- Fix any issues
- Deploy to production
- Monitor for errors
Risks and Mitigations
| Risk | Impact | Mitigation |
|---|---|---|
| Users bookmark legacy URLs | Medium | Add permanent redirects |
| Nested routing breaks existing functionality | High | Comprehensive testing, feature flags |
| URL structure confuses users | Low | URLs are transparent and semantic |
| Performance degradation | Low | Lazy-load tab content, use Angular best practices |
Open Questions
-
Q: Should the root-level Overview tab be renamed to something else (e.g., "Page Info")?
A: TBD - Gather user feedback during design review -
Q: Should we add tooltips to nested tabs?
A: Optional enhancement - implement if user testing shows confusion -
Q: What happens if user navigates to
/overviewwithout a fragment?
A: ✅ RESOLVED - Defaults to showing Explanation tab (no redirect needed)
Future Enhancements
- Collapsible Page Metadata: Make page metadata (title, number, summary) collapsible to save vertical space
- Tab Icons: Add icons to nested tabs for visual clarity
- Keyboard Shortcuts: Add keyboard shortcuts for tab navigation
- Tab State Persistence: Remember user's last selected nested tab per page
- Mobile Optimization: Optimize nested tab UX for mobile devices
References
- Issue #258: AI-Powered Plan Page Explanation with Agentic Workflow
- Issue #167: File structure reorganization (multi-file support)
- Material Design Tabs: https://material.angular.io/components/tabs/overview
- Angular Routing: https://angular.dev/guide/routing