project-compass 4.1.0 → 4.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +38 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-compass",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Futuristic project navigator and runner for Node, Python, Rust, and Go",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -153,6 +153,7 @@ function Compass({rootPath, initialView = 'navigator'}) {
153
153
  const [activeTaskId, setActiveTaskId] = useState(null);
154
154
  const [logOffset, setLogOffset] = useState(0);
155
155
  const [customMode, setCustomMode] = useState(false);
156
+ const [portConfigMode, setPortConfigMode] = useState(false);
156
157
  const [customInput, setCustomInput] = useState('');
157
158
  const [customCursor, setCustomCursor] = useState(0);
158
159
  const [renameMode, setRenameMode] = useState(false);
@@ -301,7 +302,37 @@ function Compass({rootPath, initialView = 'navigator'}) {
301
302
 
302
303
  const isCtrlC = (key.ctrl && input === 'c') || input === '\u0003';
303
304
 
304
- if (customMode) {
305
+
306
+ if (portConfigMode) {
307
+ if (key.return) {
308
+ const portVal = customInput.trim();
309
+ if (selectedProject && portVal) {
310
+ setConfig((prev) => {
311
+ const projectKey = selectedProject.path;
312
+ const existingMeta = prev.projectMeta?.[projectKey] || {};
313
+ const nextConfig = { ...prev, projectMeta: { ...prev.projectMeta, [projectKey]: { ...existingMeta, port: portVal } } };
314
+ saveConfig(nextConfig);
315
+ return nextConfig;
316
+ });
317
+ }
318
+ setPortConfigMode(false); setCustomInput(''); setCustomCursor(0);
319
+ return;
320
+ }
321
+ if (key.escape) { setPortConfigMode(false); setCustomInput(''); setCustomCursor(0); return; }
322
+ if (key.backspace || key.delete) {
323
+ if (customCursor > 0) {
324
+ setCustomInput((prev) => prev.slice(0, customCursor - 1) + prev.slice(customCursor));
325
+ setCustomCursor(c => Math.max(0, c - 1));
326
+ }
327
+ return;
328
+ }
329
+ if (input && /[0-9]/.test(input)) {
330
+ setCustomInput((prev) => prev.slice(0, customCursor) + input + prev.slice(customCursor));
331
+ setCustomCursor(c => c + input.length);
332
+ }
333
+ return;
334
+ }
335
+ if (customMode) {
305
336
  if (key.return) {
306
337
  const raw = customInput.trim();
307
338
  const selProj = selectedProject;
@@ -495,7 +526,12 @@ function Compass({rootPath, initialView = 'navigator'}) {
495
526
  return;
496
527
  }
497
528
 
498
- if (shiftCombo('c') && viewMode === 'detail' && selectedProject) { setCustomMode(true); setCustomInput(''); setCustomCursor(0); return; }
529
+
530
+ if (shiftCombo('r') && viewMode === 'detail' && selectedProject) {
531
+ setPortConfigMode(true); setCustomInput(selectedProject.metadata?.port || '3000'); setCustomCursor(String(selectedProject.metadata?.port || '3000').length);
532
+ return;
533
+ }
534
+ if (shiftCombo('c') && viewMode === 'detail' && selectedProject) { setCustomMode(true); setCustomInput(''); setCustomCursor(0); return; }
499
535
 
500
536
  const actionKey = normalizedInput && ACTION_MAP[normalizedInput];
501
537
  if (actionKey) {