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:
@ -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 || {}
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user