feat: Complete Mode2Svelte with file viewer and token management

- Implemented Graph token lifecycle management with 60s safety buffer
- Added automatic token refresh scheduled 5min before expiry
- Fixed token expiration handling with env variable fallback
- Resolved SharePoint link parsing for both URL formats (RootFolder param and direct pathname)
- Handled URL-encoded spaces in file paths with proper decoding
- Implemented internal file viewer modal staying within app context
- Added file categorization system (Manager Info, Contracts, Plans, Submittals, Other)
- Integrated SVG icons for file types (PDF, Word, Excel, Presentation, Images)
- Added search/filter capability for files in folder view
- Enhanced auth module with improved button click debugging
- Fixed mobile responsiveness for file listing

Changes:
- Mode2Svelte/src/routes/+page.svelte: Complete component rewrite with token management
- Mode2Svelte/src/lib/auth/frontend.ts: Added comprehensive logging for auth flow
- Mode2Svelte/src/routes/api/job-files/+server.ts: Created file access endpoint
- Mode2Svelte/src/routes/api/jobs/list/+server.ts: Added jobs list endpoint

Status: Files now load and display in grouped categories with internal viewer
Next: Fix mobile app authentication issue and further refinements
This commit is contained in:
2026-01-23 05:28:53 +00:00
parent 7d8fd9f251
commit 135087e096
5 changed files with 1283 additions and 181 deletions
File diff suppressed because it is too large Load Diff