mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-17 22:13:08 +00:00
Make memory and context views mobile-friendly (#813)
* Changes from fix/memory-and-context-mobile-friendly * fix: Improve file extension detection and add path traversal protection * refactor: Extract file extension utilities and add path traversal guards Code review improvements: - Extract isMarkdownFilename and isImageFilename to shared image-utils.ts - Remove duplicated code from context-view.tsx and memory-view.tsx - Add path traversal guard for context fixture utilities (matching memory) - Add 7 new tests for context fixture path traversal protection - Total 61 tests pass Addresses code review feedback from PR #813 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: Add e2e tests for profiles crud and board background persistence * Update apps/ui/playwright.config.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: Add robust test navigation handling and file filtering * fix: Format NODE_OPTIONS configuration on single line * test: Update profiles and board background persistence tests * test: Replace iPhone 13 Pro with Pixel 5 for mobile test consistency --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -84,6 +84,9 @@ export async function setupWelcomeView(
|
||||
setupComplete: true,
|
||||
isFirstRun: false,
|
||||
projects: opts?.recentProjects || [],
|
||||
// Explicitly set currentProjectId to null so the fast-hydrate path
|
||||
// does not restore a stale project from a previous test.
|
||||
currentProjectId: null,
|
||||
theme: 'dark',
|
||||
sidebarOpen: true,
|
||||
maxConcurrency: 3,
|
||||
@@ -103,7 +106,7 @@ export async function setupWelcomeView(
|
||||
}
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
|
||||
// Set up a mechanism to keep currentProject null even after settings hydration
|
||||
// Settings API might restore a project, so we override it after hydration
|
||||
@@ -226,7 +229,7 @@ export async function setupRealProject(
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
},
|
||||
{ path: projectPath, name: projectName, opts: options, versions: STORE_VERSIONS }
|
||||
);
|
||||
@@ -291,7 +294,7 @@ export async function setupMockProject(page: Page): Promise<void> {
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
}, STORE_VERSIONS);
|
||||
}
|
||||
|
||||
@@ -423,7 +426,7 @@ export async function setupMockProjectAtConcurrencyLimit(
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
},
|
||||
{ maxConcurrency, runningTasks, versions: STORE_VERSIONS }
|
||||
);
|
||||
@@ -505,7 +508,7 @@ export async function setupMockProjectWithFeatures(
|
||||
(window as { __mockFeatures?: unknown[] }).__mockFeatures = mockFeatures;
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
},
|
||||
{ opts: options, versions: STORE_VERSIONS }
|
||||
);
|
||||
@@ -577,7 +580,7 @@ export async function setupMockProjectWithContextFile(
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
|
||||
// Set up mock file system with a context file for the feature
|
||||
// This will be used by the mock electron API
|
||||
@@ -769,7 +772,7 @@ export async function setupEmptyLocalStorage(page: Page): Promise<void> {
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
}, STORE_VERSIONS);
|
||||
}
|
||||
|
||||
@@ -832,7 +835,7 @@ export async function setupMockProjectsWithoutCurrent(page: Page): Promise<void>
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
}, STORE_VERSIONS);
|
||||
}
|
||||
|
||||
@@ -910,7 +913,7 @@ export async function setupMockProjectWithSkipTestsFeatures(
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
},
|
||||
{ opts: options, versions: STORE_VERSIONS }
|
||||
);
|
||||
@@ -985,7 +988,7 @@ export async function setupMockMultipleProjects(
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
},
|
||||
{ count: projectCount, versions: STORE_VERSIONS }
|
||||
);
|
||||
@@ -1056,7 +1059,7 @@ export async function setupMockProjectWithAgentOutput(
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
|
||||
// Set up mock file system with output content for the feature
|
||||
// Now uses features/{id}/agent-output.md path
|
||||
@@ -1215,7 +1218,7 @@ export async function setupFirstRun(page: Page): Promise<void> {
|
||||
localStorage.setItem('automaker-settings-cache', JSON.stringify(settingsCache));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
}, STORE_VERSIONS);
|
||||
}
|
||||
|
||||
@@ -1238,6 +1241,6 @@ export async function setupComplete(page: Page): Promise<void> {
|
||||
localStorage.setItem('automaker-setup', JSON.stringify(setupState));
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
localStorage.setItem('automaker-disable-splash', 'true');
|
||||
}, STORE_VERSIONS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user