# View Architecture & Reference **Version:** 1.0 **Status:** PRODUCTION **Last Updated:** January 2026 --- ## Overview This document defines the professional view architecture for Job Info. All UI should follow these patterns for consistency, maintainability, and professional appearance. --- ## View Hierarchy ``` JobInfo Application ├── AuthView │ └── Sign In Form ├── LandingView │ ├── Header │ ├── JobCardView │ │ ├── Search & Filters │ │ └── Job Cards (Grid) │ └── Footer ├── ManagerInfoView │ ├── Job Header │ ├── Job Info Panel │ ├── FileListView │ │ ├── File Search │ │ ├── File Categories │ │ │ ├── Manager Info │ │ │ ├── Contracts / Estimates │ │ │ ├── Submittals │ │ │ ├── Plans │ │ │ └── Other │ │ └── File Actions │ ├── NotesSection │ └── Footer ├── NotesView │ ├── Notes Header │ ├── Notes Content (Read-only) │ └── Back to Job Detail └── FilePreviewModal ├── PDF Viewer ├── Image Viewer └── Word Document Handler ``` --- ## 1. AuthView (Sign In Page) **Purpose:** Authenticate user via PocketBase **Components:** - Logo/Header - Email input - Password input - Sign In button - Error messages - Remember Me checkbox (optional) **State:** - `isLoading`: boolean - `errorMessage`: string | null - `email`: string - `password`: string **Key Functions:** ```javascript async function handleSignIn(email, password) { // 1. Show loading state // 2. Call pb.collection('users').authWithPassword() // 3. Store token in localStorage // 4. Redirect to index.html (LandingView) // 5. Handle errors gracefully } ``` **HTML Structure:** ```html
Logo

Job Info

``` **CSS Classes:** ```css .auth-container { /* Full screen container */ } .auth-card { /* Centered white card */ } .auth-header { /* Logo + title */ } .auth-form { /* Form styling */ } .form-group { /* Input group */ } .form-input { /* Input field */ } .error-message { /* Red error text */ } .btn { /* Button base */ } .btn-primary { /* Blue button */ } .btn-lg { /* Large button */ } ``` --- ## 2. LandingView (Home / Jobs List) **Purpose:** Display list of jobs with search and filters **Components:** - Header (with user info & sign out) - Search input - Filter controls (status, date range) - Job cards in grid - Pagination - Loading skeleton - Empty state **State:** ```javascript const landingState = { jobs: [], // Job list page: 1, perPage: 10, total: 0, sort: '-Job_Number', // Default sort searchTerm: '', filters: { status: '', dateRange: { start: null, end: null } }, isLoading: false, error: null, cache: {} // For pagination memory }; ``` **Key Functions:** ```javascript async function loadJobs(page = 1, searchTerm = '', filters = {}) { // 1. Show loading skeleton // 2. Build cache key // 3. Check Redis cache // 4. If miss, fetch from /api/jobs // 5. Display jobs // 6. Handle pagination } function handleSearch(term) { // 1. Debounce (300ms) // 2. Update state.searchTerm // 3. Reset to page 1 // 4. Call loadJobs() } function handleFilterChange(filter) { // 1. Update state.filters // 2. Reset to page 1 // 3. Call loadJobs() } async function handleJobClick(job) { // 1. Navigate to ManagerInfoView // 2. Store current job in state // 3. Fetch job files } ``` **HTML Structure:** ```html

Job Info

John Doe
``` **JobCard Component:** ```html

Job# 4757

Active

Construction Project Name

Manager: John Smith
Start Date: Jan 15, 2025
Files: 42
``` **CSS Tailwind Classes:** ```css .landing-container /* Full page layout */ .landing-header /* Sticky header with logo */ .header-left /* Logo + title */ .header-right /* User info + sign out */ .search-filters-bar /* Search + filter controls */ .search-group /* Search input + button */ .filters-group /* Filter dropdowns */ .jobs-grid /* Grid of cards (responsive) */ .job-card /* Individual card */ .card-header /* Card title + badge */ .card-body /* Card content */ .card-details /* Key-value details */ .pagination /* Page navigation */ .skeleton-grid /* Loading placeholders */ .empty-state /* No results message */ ``` --- ## 3. ManagerInfoView (Job Detail) **Purpose:** Display job details, files, and notes **Components:** - Job header with info - File list (categorized) - Notes section - Back button **State:** ```javascript const managerInfoState = { job: null, // Current job object files: [], // Files for this job fileFilter: '', // Search within files notes: [], // Sticky notes isLoadingFiles: false, error: null }; ``` **HTML Structure:** ```html

Job# 4757

Construction Project Name

Active 42 Files

John Smith

john@example.com

Jan 15, 2025

Active

Files

Notes

``` **FileGroup Component:** ```html

Manager Info (5)

📄

manager_info.pdf

1.2 MB · Jan 20, 2025

Download
``` **StickyNote Component:** ```html

Project kickoff meeting scheduled for Monday

Jan 20, 2025
``` --- ## 4. NotesView (Expanded Notes) **Purpose:** Full-screen view of job notes **Components:** - Notes list (full content) - Back button **HTML Structure:** ```html

Job# 4757 - Notes

``` --- ## 5. FilePreviewModal **Purpose:** Preview files (PDF, images, documents) **Components:** - Modal overlay - Viewer (PDF, image, or iframe for documents) - File info - Close button **HTML Structure:** ```html ``` --- ## 6. Component Standards ### Button Styles ```html ``` ### Card Styles ```html

Title

Content

``` ### Badge Styles ```html Active Pending Completed ``` ### Input Styles ```html ``` --- ## 7. Responsive Design ### Breakpoints (Tailwind) ``` Mobile: < 640px (sm: 640px) Tablet: 768px (md: 768px) Desktop: 1024px (lg: 1024px) Wide: 1280px (xl: 1280px) ``` ### Grid Layouts ```html
``` --- ## 8. Accessibility Standards ### WCAG 2.1 Level AA - ✅ Color contrast ≥ 4.5:1 for text - ✅ Semantic HTML (use `
``` --- ## 9. Internationalization (i18n) ### Labels & Messages All user-facing text should be: - English - Professional tone - Clear and concise - Consistent across views **Example:** ```javascript const LABELS = { SIGN_IN: 'Sign In', SEARCH_JOBS: 'Search jobs by name or number...', NO_FILES_FOUND: 'No files found', LOADING: 'Loading...', ERROR: 'An error occurred. Please try again.' }; ``` --- ## Summary | View | Purpose | Key Components | |------|---------|-----------------| | AuthView | User login | Form, inputs, validation | | LandingView | Job list | Cards, search, filters, pagination | | ManagerInfoView | Job detail | Header, files, notes, actions | | NotesView | Expanded notes | Full-screen notes display | | FilePreviewModal | File preview | Viewer (PDF/image/document) | **All UI must follow these patterns for consistency and professionalism.**