Files
taskpile/frontend/node_modules/next/dist/esm/build/spinner.js
Alvis f1d51b8cc8 Add side panels, task selection, graph animation, and project docs
- Foldable left panel (user profile) and right panel (task details)
- Clicking a task in the list or graph node selects it and shows details
- Both views (task list + graph) always mounted via absolute inset-0 for
  correct canvas dimensions; tabs toggle visibility with opacity
- Graph node selection animation: other nodes repel outward (charge -600),
  then selected node smoothly slides to center (500ms cubic ease-out),
  then charge restores to -120 and graph stabilizes
- Graph re-fits on tab switch and panel resize via ResizeObserver
- Fix UUID string IDs throughout (backend returns UUIDs, not integers)
- Add TaskDetailPanel, UserPanel components
- Add CLAUDE.md project documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 11:23:06 +00:00

71 lines
2.3 KiB
JavaScript

import ora from "next/dist/compiled/ora";
import * as Log from "./output/log";
const dotsSpinner = {
frames: [
".",
"..",
"..."
],
interval: 200
};
export default function createSpinner(text, options = {}, logFn = console.log) {
let spinner;
let prefixText = ` ${Log.prefixes.info} ${text} `;
if (process.stdout.isTTY) {
spinner = ora({
text: undefined,
prefixText,
spinner: dotsSpinner,
stream: process.stdout,
...options
}).start();
// Add capturing of console.log/warn/error to allow pausing
// the spinner before logging and then restarting spinner after
const origLog = console.log;
const origWarn = console.warn;
const origError = console.error;
const origStop = spinner.stop.bind(spinner);
const origStopAndPersist = spinner.stopAndPersist.bind(spinner);
const logHandle = (method, args)=>{
origStop();
method(...args);
spinner.start();
};
console.log = (...args)=>logHandle(origLog, args);
console.warn = (...args)=>logHandle(origWarn, args);
console.error = (...args)=>logHandle(origError, args);
const resetLog = ()=>{
console.log = origLog;
console.warn = origWarn;
console.error = origError;
};
spinner.setText = (newText)=>{
text = newText;
prefixText = ` ${Log.prefixes.info} ${newText} `;
spinner.prefixText = prefixText;
return spinner;
};
spinner.stop = ()=>{
origStop();
resetLog();
return spinner;
};
spinner.stopAndPersist = ()=>{
// Add \r at beginning to reset the current line of loading status text
const suffixText = `\r ${Log.prefixes.event} ${text} `;
if (spinner) {
spinner.text = suffixText;
} else {
logFn(suffixText);
}
origStopAndPersist();
resetLog();
return spinner;
};
} else if (prefixText || text) {
logFn(prefixText ? prefixText + "..." : text);
}
return spinner;
}
//# sourceMappingURL=spinner.js.map