mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 15:03:57 +08:00
feat: add tests and implementation for issue discovery and queue pages
- Implemented `DiscoveryPage` with session management and findings display. - Added tests for `DiscoveryPage` to ensure proper rendering and functionality. - Created `QueuePage` for managing issue execution queues with stats and actions. - Added tests for `QueuePage` to verify UI elements and translations. - Introduced `useIssues` hooks for fetching and managing issue data. - Added loading skeletons and error handling for better user experience. - Created `vite-env.d.ts` for TypeScript support in Vite environment.
This commit is contained in:
@@ -9,6 +9,7 @@ interface ViewOptions {
|
||||
path?: string;
|
||||
host?: string;
|
||||
browser?: boolean;
|
||||
frontend?: 'js' | 'react' | 'both';
|
||||
}
|
||||
|
||||
interface SwitchWorkspaceResult {
|
||||
@@ -72,9 +73,10 @@ export async function viewCommand(options: ViewOptions): Promise<void> {
|
||||
// Check for updates (fire-and-forget, non-blocking)
|
||||
checkForUpdates().catch(() => { /* ignore errors */ });
|
||||
|
||||
const port = options.port || 3456;
|
||||
const port = Number(options.port) || 3456;
|
||||
const host = options.host || '127.0.0.1';
|
||||
const browserHost = host === '0.0.0.0' || host === '::' ? 'localhost' : host;
|
||||
const frontend = options.frontend || 'both';
|
||||
|
||||
// Resolve workspace path
|
||||
let workspacePath = process.cwd();
|
||||
@@ -101,8 +103,12 @@ export async function viewCommand(options: ViewOptions): Promise<void> {
|
||||
if (result.success) {
|
||||
console.log(chalk.green(` Workspace switched successfully`));
|
||||
|
||||
// Open browser with the new path
|
||||
const url = `http://${browserHost}:${port}/?path=${encodeURIComponent(result.path!)}`;
|
||||
// Determine URL based on frontend type
|
||||
let urlPath = '';
|
||||
if (frontend === 'react') {
|
||||
urlPath = '/react';
|
||||
}
|
||||
const url = `http://${browserHost}:${port}${urlPath}/?path=${encodeURIComponent(result.path!)}`;
|
||||
|
||||
if (options.browser !== false) {
|
||||
console.log(chalk.cyan(' Opening in browser...'));
|
||||
@@ -127,7 +133,8 @@ export async function viewCommand(options: ViewOptions): Promise<void> {
|
||||
path: workspacePath,
|
||||
port: port,
|
||||
host,
|
||||
browser: options.browser
|
||||
browser: options.browser,
|
||||
frontend: frontend
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user