Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

merge: inherit owner-scoped description queue behavior

Tin336102665969
diff --cc apps/web/src/components/task/task-description.tsx
index 4204cf8e6,c1439c087..5be910389
--- a/apps/web/src/components/task/task-description.tsx
+++ b/apps/web/src/components/task/task-description.tsx
@@@ -41,6 -48,8 +42,7 @@@ import
useSyncExternalStore,
} from "react";
import { useTranslation } from "react-i18next";
-import type { Highlighter } from "shiki";
+ import { AuthContext } from "@/components/providers/auth-provider";
import { Button } from "@/components/ui/button";
import { Dialog, DialogPopup } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
@@@ -427,9 -581,39 +429,13 @@@ export default function TaskDescription
[openImagePicker, t],
);
- useEffect(() => {
- let isDisposed = false;
-
- void Promise.all([
- import("@/lib/shiki-highlighter").then(({ getSharedShikiHighlighter }) =>
- getSharedShikiHighlighter(),
- ),
- import("shiki"),
- ])
- .then(([nextHighlighter, { bundledLanguages: languages }]) => {
- shikiHighlighterRef.current = nextHighlighter;
- if (!isDisposed) {
- setShikiHighlighter(nextHighlighter);
- setShikiSupportedLanguages(
- new Set([...Object.keys(languages), "text"]),
- );
- }
- })
- .catch((error) => {
- console.error("Failed to initialize Shiki highlighter:", error);
- });
-
- return () => {
- isDisposed = true;
- };
- }, []);
-
+ const ownerId = useContext(AuthContext).user?.id ?? "";
+ const ownerIdRef = useRef(ownerId);
+ ownerIdRef.current = ownerId;
++
const saveState = useSyncExternalStore(
descriptionSaveQueue.subscribe,
- () => descriptionSaveQueue.get(taskId)?.state ?? "saved",
+ () => descriptionSaveQueue.get(taskId, ownerId)?.state ?? "saved",
);
const scheduleDescriptionSave = useCallback((markdown: string) => {
if (!canEditRef.current) return;