User Interface Overview
This document provides a comprehensive overview of the PermitProof web application user experience, navigation flows, and key UI elements.
Application Architecture
The PermitProof web application is built with Angular Material 3 and provides a modern, responsive interface for architectural plan review and building code compliance analysis.
Key Technologies:
- Angular 17 - Frontend framework
- Angular Material 3 - UI component library
- gRPC-Web - API communication
- Firebase Authentication - User authentication
- PDF.js - PDF rendering
Landing Page Experience
Initial Load
When users first visit the application (/), they experience:
- Authentication Check: The app automatically checks Firebase authentication status
- Loading State: Shows "Loading your projects..." with a Material Design spinner
- Auto-Routing: Once authenticated, users are automatically routed to:
- Their most recently accessed project, OR
- A project selection dialog if they have multiple projects
Error States
The landing page handles several error scenarios:
- Unauthorized: User not in the access control list → Redirects to
/no-access - Server Error: Backend connectivity issues → Shows error message with retry button
- Development Mode: Mock user without permissions → Shows helpful development message
Top App Bar
The top app bar is present on all pages and provides consistent navigation and user controls.
Common Elements (All Pages)
-
CodeProof Logo (left side)
- Clickable, always returns to landing page
- Consistent branding across all views
-
Account Balance Display (right side)
- Shows current account balance (e.g., "$300.00")
- Clickable, navigates to billing page
- Icon:
account_balance_wallet
-
User Profile Menu (far right)
- User avatar (photo or default icon)
- Dropdown menu with:
- User name and email
- "Billing & Account" option
- "Admin Console" (only for users with admin role)
- "Sign Out" option
Project-Specific Elements
When viewing a project, the top app bar adds:
-
Hamburger Menu (left of logo)
- Toggles the left navigation drawer
- Shows/hides table of contents
-
Project Title (center-left)
- Displays current project name
- Two-line layout: title on top, menu bar below
-
Menu Bar (below project title)
- Project Menu:
- New - Create new project
- Open - Open existing project
- Share - Share with other users
- Make a copy - Duplicate project
- Delete Project - Remove project (with safety confirmations)
- Settings - Project configuration
- View Menu:
- Tasks - View background task status
- Project Menu:
-
Share Button (right side, before balance)
- Quick access to share dialog
- Icon:
person_add
-
Task Counter Badge (right side, before balance)
- Shows number of active background tasks
- Clickable, navigates to tasks page
- Updates in real-time
Creating a New Project (End-to-End Journey)
Step 1: Initiate Project Creation
Users can create a new project from multiple entry points:
Option A: From Landing Page
- Click "Create New Project" button (if no projects exist)
Option B: From Project Menu
- Click Project → New in the menu bar
Option C: From Project Selection Dialog
- Click "Create New Project" button in the dialog
Step 2: New Project Dialog
The "Create New Project" dialog appears with the following fields:
-
PDF File Selection (required)
- Click to select file or drag-and-drop
- Shows file name and size (in MB)
- Only accepts
.pdffiles - Can remove and reselect file
-
Project ID (required)
- Text input for unique project identifier
- Used for project URL and storage
- Hint: "This will be used to identify your project"
-
Pages Selection (required)
- Dropdown with two options:
- All Pages - Process entire PDF
- Custom Pages - Select specific pages
- Dropdown with two options:
-
Page Numbers (if Custom Pages selected)
- Text input for page ranges
- Format:
1,2,3,5-7,10(comma-separated or ranges) - Validated with regex pattern
- Hint: "Enter comma-separated page numbers or ranges"
Step 3: Project Creation Process
When user clicks "Create Project":
- Validation: Checks all required fields are filled correctly
- Project Creation: Creates project via gRPC call
- File Upload: Uploads PDF to Google Cloud Storage
- Page Ingestion: Starts async task to process selected pages
- Navigation: Automatically navigates to new project
- Background Processing: Pages are ingested in the background
- Task Monitoring: User can view progress in Tasks page
Step 4: Arrival at Project View
User lands on the project page with:
- Left drawer showing table of contents (initially empty until pages are ingested)
- Main viewport with 3 default tabs: Overview, Preview, Compliance
- Top app bar with project menu and actions
Project View UI Elements
Left Navigation Drawer (Table of Contents)
The left drawer displays the project's page structure:
Header:
- Title: "Table of Contents"
- Progress bar (shown while loading)
Page List:
- Each page shows:
- Page Number - Numeric identifier
- Page Title - Extracted from PDF or auto-generated
- Sheet ID - Material chip showing page identifier (if available)
- Checkbox - For multi-page selection
- Active Page: Highlighted with distinct styling
- Checked Pages: Visual indicator for selected pages
- Empty State: "No pages ingested" message if no pages processed yet
Selected Pages Toolbar (floating):
- Appears when one or more pages are checked
- Shows count of selected pages
- Provides bulk actions:
- Run code applicability analysis
- Generate compliance reports
- Other batch operations
Interaction:
- Click page to navigate to that page
- Check/uncheck for multi-selection
- Drawer can be toggled via hamburger menu
Main Viewport Tabs
The main viewport uses Material Tabs with 3 default tabs plus dynamic tabs:
Tab 1: Overview
Purpose: High-level project information and quick actions
Content:
- Project metadata summary
- Quick statistics (pages ingested, analyses run, etc.)
- Recent activity
- Quick action buttons
Tab 2: Preview
Purpose: PDF page preview and visual inspection
Content:
- PDF page rendering using PDF.js
- Zoom controls
- Page navigation
- Annotation tools (if implemented)
- Side-by-side view options
Tab 3: Compliance
Purpose: Code applicability analysis and compliance checking
Content:
- Building code selection
- Code section browser
- Applicability analysis results
- Compliance status indicators
- Section-specific analysis
Features:
- Expandable code sections
- Filtering and search
- Section selection for detailed analysis
- Rationale dialogs for AI decisions
Dynamic Tabs (4+)
Additional tabs can be opened dynamically:
- Compliance Report Tabs: Generated compliance reports for specific pages
- Code Section Details: Deep-dive into specific building code sections
- Custom Analysis Views: User-initiated analysis results
Tab Behavior:
- First 3 tabs are permanent (cannot be closed)
- Dynamic tabs (4+) have close buttons
- Tabs persist during navigation within project
- Active tab is highlighted
Special Views (Replace Tabs)
Project Settings View
Accessed via Project → Settings or clicking "Project Settings" in the left drawer, this view uses a tabbed interface:
Navigation:
- URL:
/projects/:projectId/settings/overviewor/settings/files - Drawer stays open (smooth SPA navigation - Issue #243)
- Two tabs: Overview and Files
Overview Tab (/settings/overview):
-
Legacy Project Banner (Issue #227)
- Shows for projects without
project-metadata.json - "Set Up Metadata" button opens creation dialog
- Dismissible but reappears until metadata created
- Shows for projects without
-
Project Information Card (Issue #227 - Editable Metadata)
- Project ID (read-only)
- Project Name (editable inline)
- Description (editable inline multi-line)
- Address (editable inline with Google Places autocomplete - Issue #236)
- Street address field with autocomplete suggestions
- City, State, Zip fields (responsive layout)
- Country field (defaults to USA)
- Created By (read-only)
- Created At timestamp (read-only)
- Status chip (active/archived)
- Edit button - Enables inline editing for all fields
- Save/Cancel buttons - Appear during edit mode
-
Project Location Map (Issue #236)
- Interactive Google Map showing project location
- Red marker at geocoded address
- Street-level zoom (16)
- Full-screen toggle button
- Auto-geocodes address if coordinates missing
- Updates in real-time when address is edited
Files Tab (/settings/files):
- Project Files Table
- Uploaded PDF files list
- Columns: File name, Size, Page count, Actions
- Row actions:
- Process pages - Opens page ingestion dialog
- View properties - File metadata details
- Delete file - Remove file (with confirmation)
- Upload button to add new files
- Empty state: "No files uploaded yet" with upload prompt
- Clicking file row opens page ingestion dialog
File Upload Dialog:
- Drag-and-drop or click to select
- File size validation
- Upload progress indicator
- Success/error feedback
Page Ingestion Dialog:
- Select pages to process (all or custom range)
- Shows already ingested page count
- Starts async background task
- Redirects to tasks page to monitor progress
Tasks View
Accessed via View → Tasks, this view shows background task monitoring:
Layout:
- Two-tab interface:
- Active Tasks - Currently running tasks
- Recent Tasks - Completed/failed tasks
Task Card Information:
- Task type (Plan Ingestion, Code Applicability, Compliance Report)
- Progress percentage
- Current step description
- Step history (expandable)
- Cost analysis (tokens used, estimated cost)
- Actions: Retry, Cancel
- Status indicators (running, complete, failed)
Features:
- Real-time progress updates via Firestore
- Detailed step-by-step history
- Cost breakdown per task
- Clear completed tasks button
- Auto-refresh on task completion
Sharing Settings Features
Share Dialog
Accessed via Project → Share or the share button (person_add icon):
Sections:
-
People with Access
- List of current project members
- Shows for each member:
- Avatar (photo or default)
- Name and email
- Current role (Owner, Editor, Prompter, Reader)
- Role dropdown (only for owners):
- Change member permissions
- Remove member access
-
Add New Members
- Email input field with validation
- Email chip display (shows validated email)
- Role selector dropdown:
- Reader - Can view project content
- Prompter - Can use AI prompts
- Editor - Can edit project content
- Owner - Full access to project settings and billing
- "Share" button to send invitation
-
Actions
- Copy link - Copy project URL to clipboard
- Cancel - Close dialog without changes
- Done - Close dialog after changes
Permission Requirements:
- Only project Owners can:
- Invite new members
- Change member roles
- Remove members
- Other roles see read-only member list
Features:
- Real-time email validation
- Duplicate email detection
- Role descriptions on hover
- Async validation with progress indicator
- Permission refresh after changes
Billing Page
Accessed via Billing & Account in user menu or by clicking balance display.
URL: /billing
Sections
-
Account Overview Card
- Available Balance - Current account balance
- Subscription - Tier chip (Free, Pro, Enterprise)
- Total Spent - Lifetime spending
- Tasks Executed - Total task count
- Action Buttons:
- "Add Funds" - Top up account balance
- "Manage Subscription" - Change subscription tier
-
Transaction History
- Table of recent transactions
- Columns:
- Date & Time
- Description
- Amount (debit/credit)
- Balance after transaction
- Pagination controls
- Filter and search options
-
Usage Statistics
- Charts and graphs showing:
- Spending over time
- Task execution trends
- Cost per task type
- Downloadable reports
- Charts and graphs showing:
Error Handling:
- Shows "Unable to Load Billing Information" if service unavailable
- Retry button for failed requests
- Graceful degradation if billing service not configured
Admin Page
Accessed via Admin Console in user menu (only visible to users with root admin role).
URL: /admin
Access Control: Protected by adminGuard - only users with ROOT_ADMIN role can access
Layout
Left Navigation Panel:
- Fixed sidebar with admin sections
- Currently available:
- Role Authorizations - Manage user permissions
Main Content Area:
- Section-specific content based on left nav selection
Role Authorizations Section
Purpose: Manage global user permissions and access levels across all projects
Tabs:
-
Raw YAML Tab
- Direct YAML editor for RBAC configuration
- Features:
- User count indicator
- Unsaved changes indicator
- Refresh button - Fetch latest from backend
- Discard button - Revert unsaved changes
- Save & Apply button - Persist changes to Firebase
- Syntax highlighting and validation
- Real-time YAML validation with error messages
- 25-row textarea for editing
-
YAML Schema Tab
- Documentation for RBAC YAML structure
- Field descriptions and examples
- Role definitions and permissions
- Best practices for configuration
Workflow:
- View current RBAC configuration
- Edit YAML directly in textarea
- Validate changes (automatic)
- Save and apply to Firebase
- Changes propagate to all users
Version Page
Accessed via direct URL: /version
Purpose: Display detailed version and deployment information for debugging and verification
Sections
-
Frontend (Angular App)
- Version number
- Git Commit - Clickable link to GitHub commit
- Git Branch - Clickable link to GitHub branch
- Build timestamp
- Environment (dev/test/demo/prod)
- Node environment
-
Backend (gRPC Server)
- Health Status - SERVING/HEALTHY indicator with color coding
- Git Commit - Clickable link to GitHub commit
- Git Branch - Clickable link to GitHub branch
- Build timestamp
- App version
- JVM version
- Uptime (formatted as human-readable duration)
- Container Image - Clickable link to Google Artifact Registry
-
Version Source Details (expandable sections)
📦 Build-time Git Info (from git-commit-id-plugin):
- Detailed commit information
- Build metadata
- All clickable links to GitHub
☁️ Cloud Run Deployment Info:
- Service name (clickable link to Cloud Run console)
- Revision ID (clickable link to Cloud Run console)
- Region and configuration
🔧 Environment Variables:
- Key environment settings
- Configuration values
💻 System Information:
- OS and runtime details
- System properties
Actions:
- Refresh button - Reload version information
- All Git commits/branches are clickable GitHub links
- Cloud Run services/revisions are clickable console links
Use Cases:
- Verify deployment version
- Debug environment-specific issues
- Confirm Git commit in production
- Check backend health status
- Validate container image
Common User Journeys
Journey 1: Create and Analyze a New Project
- Start: User lands on home page
- Authenticate: Firebase authentication (automatic)
- Create Project: Click Project → New
- Fill Form:
- Select PDF file
- Enter project ID
- Choose pages (all or custom)
- Submit: Click "Create Project"
- Wait: Background tasks start (upload, ingestion)
- Navigate: Auto-routed to new project
- Monitor: View progress in Tasks page
- Review: Once ingested, pages appear in left drawer
- Analyze: Select pages, run code applicability
- Report: Generate compliance report
- Download: Export results
Journey 2: Share a Project with Colleague
- Open Project: Navigate to project to share
- Open Share Dialog: Click share button or Project → Share
- Enter Email: Type colleague's email address
- Select Role: Choose permission level (Reader/Editor/Owner)
- Send Invitation: Click "Share"
- Confirmation: Success message appears
- Colleague Access: Colleague receives access immediately
Journey 3: Monitor Background Tasks
- Start Operation: Initiate page ingestion or analysis
- Navigate to Tasks: Click View → Tasks or task counter badge
- View Active Tasks: See real-time progress
- Expand Details: Click to see step-by-step history
- Check Costs: View token usage and estimated cost
- Wait for Completion: Tasks update automatically
- View Results: Navigate back to project to see results
Journey 4: Manage Account Billing
- Check Balance: View balance in top app bar
- Navigate to Billing: Click balance or user menu → Billing & Account
- View Overview: See balance, subscription, total spent
- Check Transactions: Review transaction history
- Add Funds: Click "Add Funds" (if needed)
- Manage Subscription: Upgrade/downgrade tier
Journey 5: Copy an Existing Project
- Open Source Project: Navigate to project to copy
- Open Copy Dialog: Click Project → Make a copy
- Configure Copy:
- Enter new project ID
- Choose whether to copy sharing settings
- Select what to copy (files, analyses, etc.)
- Submit: Click "Copy Project"
- Wait: Background task copies all data
- Navigate: Auto-routed to new project copy
Key UI Patterns
Material Design Principles
The application follows Material Design 3 guidelines:
- Elevation: Cards and dialogs use appropriate elevation
- Color System: Primary (blue), accent (green), warn (red)
- Typography: Roboto font family with proper hierarchy
- Spacing: 8px grid system
- Animations: Smooth transitions and micro-interactions
- Accessibility: ARIA labels, keyboard navigation, screen reader support
Responsive Design
- Desktop: Full-width layout with side drawer
- Tablet: Collapsible drawer, optimized spacing
- Mobile: Bottom navigation, stacked layouts
Loading States
Consistent loading indicators across the app:
- Spinner: For initial page loads
- Progress Bar: For determinate progress (file uploads, tasks)
- Skeleton Screens: For content loading
- Inline Spinners: For button actions
Error Handling
User-friendly error messages with:
- Clear error description
- Actionable retry buttons
- Helpful hints for resolution
- Graceful degradation
Real-Time Updates
- Task Progress: Updates via Firestore listeners
- Balance: Updates after transactions
- Permissions: Refreshes after sharing changes
- Project Data: Invalidates cache on modifications
Navigation Patterns
URL Structure
Updated October 2025 (Issue #243) - Hierarchical parent-child routes for smooth SPA navigation:
/ # Landing page (auto-routes)
/projects/:projectId # Project parent route
/projects/:projectId/pages/:pageNum/:tab # Project page view with tab
/projects/:projectId/settings # Project settings (redirects to /overview)
/projects/:projectId/settings/overview # Settings overview tab
/projects/:projectId/settings/files # Settings files tab
/projects/:projectId/tasks # Task monitoring
/billing # Billing and account
/admin # Admin console (admin only)
/version # Version information
/unauthorized # Auth error page
/no-access # Access denied page
/error # Server error page
Parent-Child Architecture Benefits:
- MainViewComponent persists during all
/projects/:projectId/*navigation - Drawer state maintained across page/settings/tasks switches
- Smooth transitions without component recreation
- True Single Page Application experience
Navigation Methods
- Direct URL: Users can bookmark and share project URLs
- Menu Navigation: Project and View menus for common actions
- Click Navigation: Interactive elements (cards, buttons, links)
- Auto-Routing: Intelligent routing based on user state
- Breadcrumbs: (Future enhancement) For deep navigation
Related Documentation
- Angular Material M3 Setup - Technical setup and configuration
- UI Best Practices - Design patterns and coding standards
- Cold Start Detection - Performance optimization
- Progress Tracking - User feedback during operations
- Firebase RBAC Integration - Authentication and authorization
- Sharing Settings Implementation - Multi-user collaboration
- UI Testing with Cypress - End-to-end UI testing