@pixelbyte-software/pixcode 1.47.0 → 1.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-BBdWwJi6.css +32 -0
- package/dist/assets/{index-UgtuipzF.js → index-yVh5W0e7.js} +193 -193
- package/dist/index.html +2 -2
- package/dist-server/server/projects.js +65 -0
- package/dist-server/server/projects.js.map +1 -1
- package/package.json +1 -1
- package/scripts/smoke/vscode-workbench-polish.mjs +101 -0
- package/server/projects.js +72 -0
- package/dist/assets/index-CFPtm6sP.css +0 -32
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
|
|
4
|
+
const read = (path) => fs.readFileSync(path, 'utf8');
|
|
5
|
+
|
|
6
|
+
const workbench = read('src/components/vscode-workbench/view/VSCodeWorkbench.tsx');
|
|
7
|
+
const projectType = read('src/types/app.ts');
|
|
8
|
+
const projectsServer = read('server/projects.js');
|
|
9
|
+
const mainState = read('src/components/main-content/view/subcomponents/MainContentStateView.tsx');
|
|
10
|
+
const chatInterface = read('src/components/chat/view/ChatInterface.tsx');
|
|
11
|
+
const chatComposer = read('src/components/chat/view/subcomponents/ChatComposer.tsx');
|
|
12
|
+
const workerSlots = read('src/components/chat/view/subcomponents/WorkerSlotsControl.tsx');
|
|
13
|
+
const wizard = read('src/components/project-creation-wizard/ProjectCreationWizard.tsx');
|
|
14
|
+
const sidebar = read('src/components/sidebar/view/Sidebar.tsx');
|
|
15
|
+
|
|
16
|
+
assert.match(
|
|
17
|
+
workbench,
|
|
18
|
+
/function WorkbenchMenuBar/,
|
|
19
|
+
'VS Code workbench should render a top menu bar.',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
for (const item of ['File', 'Edit', 'Selection', 'View', 'Go', 'Run', 'Terminal', 'Help']) {
|
|
23
|
+
assert.match(workbench, new RegExp(`label: '${item}'`), `Workbench menu should include ${item}.`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
assert.match(
|
|
27
|
+
workbench,
|
|
28
|
+
/type:\s*'existing'/,
|
|
29
|
+
'File > Open Project should dispatch the existing-folder project wizard flow.',
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
assert.match(
|
|
33
|
+
workbench,
|
|
34
|
+
/type:\s*'new'/,
|
|
35
|
+
'File > Clone From GitHub should dispatch the GitHub clone project wizard flow.',
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
assert.match(
|
|
39
|
+
workbench,
|
|
40
|
+
/function WorkbenchProjectsPanel/,
|
|
41
|
+
'Projects activity should use a dedicated project-directory panel.',
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
assert.doesNotMatch(
|
|
45
|
+
workbench,
|
|
46
|
+
/return <Sidebar \{\.\.\.sidebarProps\} isMobile=\{false\} \/>/,
|
|
47
|
+
'Projects activity should not render the chat-history sidebar.',
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
assert.match(
|
|
51
|
+
workbench,
|
|
52
|
+
/formatProjectPath/,
|
|
53
|
+
'Projects panel should render a shortened path instead of dumping the full directory.',
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
assert.match(
|
|
57
|
+
workbench,
|
|
58
|
+
/formatFileCount/,
|
|
59
|
+
'Projects panel should show file counts.',
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
assert.match(projectType, /fileCount\?: number/, 'Project type should expose optional fileCount metadata.');
|
|
63
|
+
assert.match(projectsServer, /async function countProjectFiles/, 'Backend should count project files for the workbench project list.');
|
|
64
|
+
|
|
65
|
+
assert.match(
|
|
66
|
+
mainState,
|
|
67
|
+
/repeat\(auto-fit,\s*minmax\(min\(100%,\s*11rem\),\s*1fr\)\)/,
|
|
68
|
+
'Start workspace cards should auto-fit instead of forcing cramped fixed columns.',
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
assert.doesNotMatch(
|
|
72
|
+
workbench,
|
|
73
|
+
/<main className="min-w-\[360px\]/,
|
|
74
|
+
'Workbench center panel should be allowed to shrink with narrow three-pane layouts.',
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
assert.match(
|
|
78
|
+
workbench,
|
|
79
|
+
/compactComposer/,
|
|
80
|
+
'Workbench should request compact composer behavior in the right CLI pane.',
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
assert.match(chatInterface, /compactComposer\?: boolean/, 'ChatInterface should expose compactComposer for narrow workbench panes.');
|
|
84
|
+
assert.match(chatComposer, /compact\?: boolean/, 'ChatComposer should expose a compact prop.');
|
|
85
|
+
assert.match(chatComposer, /flex-wrap/, 'ChatComposer footer should wrap controls in narrow panes.');
|
|
86
|
+
assert.match(workerSlots, /panelClassName\?: string/, 'WorkerSlotsControl should allow a compact panel width override.');
|
|
87
|
+
assert.match(chatComposer, /panelClassName=\{compact/, 'Compact composer should constrain the worker-slot panel.');
|
|
88
|
+
|
|
89
|
+
assert.match(
|
|
90
|
+
wizard,
|
|
91
|
+
/initialWorkspaceType\?: WorkspaceType/,
|
|
92
|
+
'Project wizard should accept an initial workspace type from the workbench File menu.',
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
assert.match(
|
|
96
|
+
sidebar,
|
|
97
|
+
/event as CustomEvent<\{ workspaceType\?: WorkspaceType \}>/,
|
|
98
|
+
'Sidebar create-project event should forward the requested workspace type into the wizard.',
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
console.log('vscode workbench polish smoke passed');
|
package/server/projects.js
CHANGED
|
@@ -68,6 +68,74 @@ import Database from 'better-sqlite3';
|
|
|
68
68
|
import sessionManager from './sessionManager.js';
|
|
69
69
|
import { applyCustomSessionNames } from './database/db.js';
|
|
70
70
|
|
|
71
|
+
const FILE_COUNT_LIMIT = 20000;
|
|
72
|
+
const FILE_COUNT_IGNORED_DIRECTORIES = new Set([
|
|
73
|
+
'.cache',
|
|
74
|
+
'.git',
|
|
75
|
+
'.hg',
|
|
76
|
+
'.next',
|
|
77
|
+
'.npm',
|
|
78
|
+
'.pnpm-store',
|
|
79
|
+
'.svn',
|
|
80
|
+
'.turbo',
|
|
81
|
+
'.vite',
|
|
82
|
+
'build',
|
|
83
|
+
'coverage',
|
|
84
|
+
'dist',
|
|
85
|
+
'dist-server',
|
|
86
|
+
'node_modules',
|
|
87
|
+
'out',
|
|
88
|
+
'target',
|
|
89
|
+
'vendor'
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
async function countProjectFiles(projectPath, maxFiles = FILE_COUNT_LIMIT) {
|
|
93
|
+
if (!projectPath || typeof projectPath !== 'string') {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const stats = await fs.stat(projectPath);
|
|
99
|
+
if (!stats.isDirectory()) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let count = 0;
|
|
107
|
+
const pendingDirectories = [projectPath];
|
|
108
|
+
|
|
109
|
+
while (pendingDirectories.length > 0) {
|
|
110
|
+
const currentDirectory = pendingDirectories.pop();
|
|
111
|
+
let entries = [];
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
entries = await fs.readdir(currentDirectory, { withFileTypes: true });
|
|
115
|
+
} catch {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
for (const entry of entries) {
|
|
120
|
+
if (entry.isDirectory()) {
|
|
121
|
+
if (!FILE_COUNT_IGNORED_DIRECTORIES.has(entry.name)) {
|
|
122
|
+
pendingDirectories.push(path.join(currentDirectory, entry.name));
|
|
123
|
+
}
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (entry.isFile() || entry.isSymbolicLink()) {
|
|
128
|
+
count += 1;
|
|
129
|
+
if (count >= maxFiles) {
|
|
130
|
+
return count;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return count;
|
|
137
|
+
}
|
|
138
|
+
|
|
71
139
|
// Import TaskMaster detection functions
|
|
72
140
|
async function detectTaskMasterFolder(projectPath) {
|
|
73
141
|
try {
|
|
@@ -691,6 +759,7 @@ async function getProjects(progressCallback = null) {
|
|
|
691
759
|
path: actualProjectDir,
|
|
692
760
|
displayName: customName || autoDisplayName,
|
|
693
761
|
fullPath: actualProjectDir,
|
|
762
|
+
fileCount: await countProjectFiles(actualProjectDir),
|
|
694
763
|
isCustomName: !!customName,
|
|
695
764
|
isManuallyAdded,
|
|
696
765
|
autoDiscovered: isAutoDiscovered,
|
|
@@ -832,6 +901,7 @@ async function getProjects(progressCallback = null) {
|
|
|
832
901
|
path: actualProjectDir,
|
|
833
902
|
displayName: projectConfig.displayName || await generateDisplayName(projectName, actualProjectDir),
|
|
834
903
|
fullPath: actualProjectDir,
|
|
904
|
+
fileCount: await countProjectFiles(actualProjectDir),
|
|
835
905
|
isCustomName: !!projectConfig.displayName,
|
|
836
906
|
isManuallyAdded,
|
|
837
907
|
autoDiscovered: isAutoDiscovered,
|
|
@@ -1557,6 +1627,7 @@ async function addProjectManually(projectPath, displayName = null) {
|
|
|
1557
1627
|
path: absolutePath,
|
|
1558
1628
|
fullPath: absolutePath,
|
|
1559
1629
|
displayName: displayName || await generateDisplayName(projectName, absolutePath),
|
|
1630
|
+
fileCount: await countProjectFiles(absolutePath),
|
|
1560
1631
|
isManuallyAdded: true,
|
|
1561
1632
|
sessions: [],
|
|
1562
1633
|
cursorSessions: []
|
|
@@ -1584,6 +1655,7 @@ async function addProjectManually(projectPath, displayName = null) {
|
|
|
1584
1655
|
path: absolutePath,
|
|
1585
1656
|
fullPath: absolutePath,
|
|
1586
1657
|
displayName: displayName || await generateDisplayName(projectName, absolutePath),
|
|
1658
|
+
fileCount: await countProjectFiles(absolutePath),
|
|
1587
1659
|
isManuallyAdded: true,
|
|
1588
1660
|
sessions: [],
|
|
1589
1661
|
cursorSessions: []
|