Files
taskpile/frontend/node_modules/next/dist/esm/server/stream-utils/uint8array-helpers.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

51 lines
1.7 KiB
JavaScript

/**
* Find the starting index of Uint8Array `b` within Uint8Array `a`.
*/ export function indexOfUint8Array(a, b) {
if (b.length === 0) return 0;
if (a.length === 0 || b.length > a.length) return -1;
// start iterating through `a`
for(let i = 0; i <= a.length - b.length; i++){
let completeMatch = true;
// from index `i`, iterate through `b` and check for mismatch
for(let j = 0; j < b.length; j++){
// if the values do not match, then this isn't a complete match, exit `b` iteration early and iterate to next index of `a`.
if (a[i + j] !== b[j]) {
completeMatch = false;
break;
}
}
if (completeMatch) {
return i;
}
}
return -1;
}
/**
* Check if two Uint8Arrays are strictly equivalent.
*/ export function isEquivalentUint8Arrays(a, b) {
if (a.length !== b.length) return false;
for(let i = 0; i < a.length; i++){
if (a[i] !== b[i]) return false;
}
return true;
}
/**
* Remove Uint8Array `b` from Uint8Array `a`.
*
* If `b` is not in `a`, `a` is returned unchanged.
*
* Otherwise, the function returns a new Uint8Array instance with size `a.length - b.length`
*/ export function removeFromUint8Array(a, b) {
const tagIndex = indexOfUint8Array(a, b);
if (tagIndex === 0) return a.subarray(b.length);
if (tagIndex > -1) {
const removed = new Uint8Array(a.length - b.length);
removed.set(a.slice(0, tagIndex));
removed.set(a.slice(tagIndex + b.length), tagIndex);
return removed;
} else {
return a;
}
}
//# sourceMappingURL=uint8array-helpers.js.map