feat(media): Optimize Media Manager loading performance

Significant performance improvements to the 'Loading media...' phase:
- Reduced client-server round trips by consolidating the initial handshake (diagnostics + media fetch) into a single backend call: getMediaManagerInitialState.
- Implemented batched Google Drive metadata retrieval in GASDriveService using the Advanced Drive API, eliminating per-file property fetching calls.
- Switched to HtmlService templates in showMediaManager to pass initial SKU/Title data directly, enabling the UI shell to appear instantly upon opening.
- Updated documentation (ARCHITECTURE.md, MEMORY.md) to clarify Webpack global assignment requirements for GAS functions.
- Verified with comprehensive updates to unit and integration tests.
This commit is contained in:
Ben Miller
2025-12-31 09:46:56 -07:00
parent fc25e877f1
commit e39bc862cc
11 changed files with 314 additions and 150 deletions

View File

@ -127,4 +127,12 @@ export class MockDriveService implements IDriveService {
return {}
}
}
getFilesWithProperties(folderId: string): { file: GoogleAppsScript.Drive.File, properties: { [key: string]: string } }[] {
const files = this.getFiles(folderId)
return files.map(f => ({
file: f,
properties: (f as any)._properties || {}
}))
}
}