Files
taskpile/frontend/node_modules/next/dist/experimental/testmode/proxy/server.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

85 lines
2.3 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createProxyServer", {
enumerable: true,
get: function() {
return createProxyServer;
}
});
const _http = /*#__PURE__*/ _interop_require_default(require("http"));
const _types = require("./types");
const _fetchapi = require("./fetch-api");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
async function readBody(req) {
const acc = [];
for await (const chunk of req){
acc.push(chunk);
}
return Buffer.concat(acc);
}
async function createProxyServer({ onFetch }) {
const server = _http.default.createServer(async (req, res)=>{
if (req.url !== "/") {
res.writeHead(404);
res.end();
return;
}
let json;
try {
json = JSON.parse((await readBody(req)).toString("utf-8"));
} catch (e) {
res.writeHead(400);
res.end();
return;
}
const { api } = json;
let response;
switch(api){
case "fetch":
if (onFetch) {
response = await (0, _fetchapi.handleFetch)(json, onFetch);
}
break;
default:
break;
}
if (!response) {
response = _types.UNHANDLED;
}
res.writeHead(200, {
"Content-Type": "application/json"
});
res.write(JSON.stringify(response));
res.end();
});
await new Promise((resolve)=>{
server.listen(0, "localhost", ()=>{
resolve(undefined);
});
});
const address = server.address();
if (!address || typeof address !== "object") {
server.close();
throw new Error("Failed to create a proxy server");
}
const port = address.port;
const fetchWith = (input, init, testData)=>{
const request = new Request(input, init);
request.headers.set("Next-Test-Proxy-Port", String(port));
request.headers.set("Next-Test-Data", testData ?? "");
return fetch(request);
};
return {
port,
close: ()=>server.close(),
fetchWith
};
}
//# sourceMappingURL=server.js.map