Security Remediation: All Phases Complete (84 fixes) #348
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect, useCallback } from "react";
|
||||
import { useState, useEffect, useCallback, useRef } from "react";
|
||||
import { TaskStatus, TaskPriority } from "@mosaic/shared";
|
||||
|
||||
export interface FilterValues {
|
||||
@@ -29,19 +29,28 @@ export function FilterBar({
|
||||
const [showStatusDropdown, setShowStatusDropdown] = useState(false);
|
||||
const [showPriorityDropdown, setShowPriorityDropdown] = useState(false);
|
||||
|
||||
// Stable ref for onFilterChange to avoid re-triggering the debounce effect
|
||||
const onFilterChangeRef = useRef(onFilterChange);
|
||||
useEffect(() => {
|
||||
onFilterChangeRef.current = onFilterChange;
|
||||
}, [onFilterChange]);
|
||||
|
||||
// Debounced search
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
if (searchValue !== filters.search) {
|
||||
const newFilters = { ...filters };
|
||||
if (searchValue) {
|
||||
newFilters.search = searchValue;
|
||||
} else {
|
||||
delete newFilters.search;
|
||||
setFilters((prevFilters) => {
|
||||
if (searchValue !== prevFilters.search) {
|
||||
const newFilters = { ...prevFilters };
|
||||
if (searchValue) {
|
||||
newFilters.search = searchValue;
|
||||
} else {
|
||||
delete newFilters.search;
|
||||
}
|
||||
onFilterChangeRef.current(newFilters);
|
||||
return newFilters;
|
||||
}
|
||||
setFilters(newFilters);
|
||||
onFilterChange(newFilters);
|
||||
}
|
||||
return prevFilters;
|
||||
});
|
||||
}, debounceMs);
|
||||
|
||||
return (): void => {
|
||||
|
||||
@@ -38,6 +38,12 @@ The orchestrator **cold-starts** with just a review report location and minimal
|
||||
**If you find yourself about to edit source code, STOP.**
|
||||
Spawn a worker instead. No exceptions. No "quick fixes."
|
||||
|
||||
**Worker Limits:**
|
||||
|
||||
- Maximum **2 parallel workers** at any time
|
||||
- Wait for at least one worker to complete before spawning more
|
||||
- This optimizes token usage and reduces context pressure
|
||||
|
||||
---
|
||||
|
||||
## Bootstrap Templates
|
||||
|
||||
Reference in New Issue
Block a user