@industry-theme/backlogmd-kanban-panel 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panels.bundle.js +68 -65
- package/dist/panels.bundle.js.map +1 -1
- package/dist/src/hooks/useBacklogCore.d.ts +3 -0
- package/dist/src/hooks/useBacklogCore.d.ts.map +1 -1
- package/dist/src/panels/KanbanPanel.d.ts.map +1 -1
- package/dist/src/panels/kanban/hooks/useKanbanData.d.ts +3 -0
- package/dist/src/panels/kanban/hooks/useKanbanData.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -8483,7 +8483,7 @@ class Core {
|
|
|
8483
8483
|
throw new Error("Core not initialized. Call initialize() or initializeLazy() first.");
|
|
8484
8484
|
}
|
|
8485
8485
|
}
|
|
8486
|
-
const version = "1.2.
|
|
8486
|
+
const version = "1.2.7";
|
|
8487
8487
|
const packageJson = {
|
|
8488
8488
|
version
|
|
8489
8489
|
};
|
|
@@ -8505,7 +8505,8 @@ function useKanbanData(options) {
|
|
|
8505
8505
|
const {
|
|
8506
8506
|
core: core2,
|
|
8507
8507
|
tasksLimit = DEFAULT_TASKS_LIMIT,
|
|
8508
|
-
events: events2
|
|
8508
|
+
events: events2,
|
|
8509
|
+
parentSpan
|
|
8509
8510
|
} = options;
|
|
8510
8511
|
const [tasks, setTasks] = useState([]);
|
|
8511
8512
|
const [isLoading, setIsLoading] = useState(true);
|
|
@@ -8543,9 +8544,12 @@ function useKanbanData(options) {
|
|
|
8543
8544
|
return;
|
|
8544
8545
|
}
|
|
8545
8546
|
const tracer = getTracer();
|
|
8546
|
-
|
|
8547
|
+
const parentContext = parentSpan ? trace.setSpan(context.active(), parentSpan) : context.active();
|
|
8548
|
+
return context.with(parentContext, () => tracer.startActiveSpan("kanban.load", async (span) => {
|
|
8547
8549
|
const startTime = Date.now();
|
|
8548
|
-
span.addEvent("kanban.loading"
|
|
8550
|
+
span.addEvent("kanban.loading", {
|
|
8551
|
+
"is.backlog.project": true
|
|
8552
|
+
});
|
|
8549
8553
|
setIsLoading(true);
|
|
8550
8554
|
setError(null);
|
|
8551
8555
|
try {
|
|
@@ -8568,7 +8572,7 @@ function useKanbanData(options) {
|
|
|
8568
8572
|
"tasks.count": allTasks.length,
|
|
8569
8573
|
"columns.count": newColumnStates.size,
|
|
8570
8574
|
"tasks.total": total,
|
|
8571
|
-
"
|
|
8575
|
+
"has.more": paginatedResult.hasMore
|
|
8572
8576
|
});
|
|
8573
8577
|
span.setAttributes({
|
|
8574
8578
|
"output.tasksLoaded": allTasks.length,
|
|
@@ -8599,8 +8603,8 @@ function useKanbanData(options) {
|
|
|
8599
8603
|
setIsLoading(false);
|
|
8600
8604
|
span.end();
|
|
8601
8605
|
}
|
|
8602
|
-
});
|
|
8603
|
-
}, [core2, tasksLimit, buildColumnStates]);
|
|
8606
|
+
}));
|
|
8607
|
+
}, [core2, tasksLimit, buildColumnStates, parentSpan]);
|
|
8604
8608
|
useEffect(() => {
|
|
8605
8609
|
loadTasks();
|
|
8606
8610
|
}, [loadTasks]);
|
|
@@ -8654,7 +8658,8 @@ function useKanbanData(options) {
|
|
|
8654
8658
|
span.addEvent("kanban.loaded", {
|
|
8655
8659
|
"tasks.count": newTasks.length,
|
|
8656
8660
|
"columns.count": newColumnStates.size,
|
|
8657
|
-
"tasks.newlyLoaded": result.items.length
|
|
8661
|
+
"tasks.newlyLoaded": result.items.length,
|
|
8662
|
+
"has.more": result.hasMore
|
|
8658
8663
|
});
|
|
8659
8664
|
span.setAttributes({
|
|
8660
8665
|
"output.tasksLoaded": result.items.length,
|
|
@@ -10393,8 +10398,9 @@ class PanelFileSystemAdapter {
|
|
|
10393
10398
|
}
|
|
10394
10399
|
function useBacklogCore(options) {
|
|
10395
10400
|
const {
|
|
10396
|
-
context:
|
|
10397
|
-
actions
|
|
10401
|
+
context: context$1,
|
|
10402
|
+
actions,
|
|
10403
|
+
parentSpan
|
|
10398
10404
|
} = options || {};
|
|
10399
10405
|
const [core2, setCore] = useState(null);
|
|
10400
10406
|
const [isInitializing, setIsInitializing] = useState(true);
|
|
@@ -10403,12 +10409,12 @@ function useBacklogCore(options) {
|
|
|
10403
10409
|
const [canWrite, setCanWrite] = useState(false);
|
|
10404
10410
|
const [filePaths, setFilePaths] = useState([]);
|
|
10405
10411
|
const fileTreeVersionRef = useRef(null);
|
|
10406
|
-
const contextRef = useRef(
|
|
10412
|
+
const contextRef = useRef(context$1);
|
|
10407
10413
|
const actionsRef = useRef(actions);
|
|
10408
10414
|
useEffect(() => {
|
|
10409
|
-
contextRef.current =
|
|
10415
|
+
contextRef.current = context$1;
|
|
10410
10416
|
actionsRef.current = actions;
|
|
10411
|
-
}, [
|
|
10417
|
+
}, [context$1, actions]);
|
|
10412
10418
|
const fetchFileContent = useCallback(async (path2) => {
|
|
10413
10419
|
const currentActions = actionsRef.current;
|
|
10414
10420
|
if (!(currentActions == null ? void 0 : currentActions.readFile)) {
|
|
@@ -10418,35 +10424,34 @@ function useBacklogCore(options) {
|
|
|
10418
10424
|
}, []);
|
|
10419
10425
|
const initializeCore = useCallback(async () => {
|
|
10420
10426
|
const tracer = getTracer();
|
|
10421
|
-
|
|
10427
|
+
const parentContext = parentSpan ? trace.setSpan(context.active(), parentSpan) : context.active();
|
|
10428
|
+
return context.with(parentContext, () => tracer.startActiveSpan("backlog.core.init", async (span) => {
|
|
10422
10429
|
var _a, _b;
|
|
10423
10430
|
const startTime = Date.now();
|
|
10424
10431
|
try {
|
|
10425
10432
|
span.addEvent("backlog.core.init.started");
|
|
10426
|
-
if (!
|
|
10433
|
+
if (!context$1 || !actions) {
|
|
10427
10434
|
console.log("[useBacklogCore] No context provided");
|
|
10428
10435
|
setIsBacklogProject(false);
|
|
10429
10436
|
setCore(null);
|
|
10430
10437
|
setIsInitializing(false);
|
|
10431
10438
|
setFilePaths([]);
|
|
10432
|
-
span.
|
|
10433
|
-
"
|
|
10434
|
-
"output.reason": "no_context"
|
|
10439
|
+
span.addEvent("backlog.core.init.skipped", {
|
|
10440
|
+
reason: "no_context"
|
|
10435
10441
|
});
|
|
10436
10442
|
span.setStatus({
|
|
10437
10443
|
code: SpanStatusCode.OK
|
|
10438
10444
|
});
|
|
10439
10445
|
return;
|
|
10440
10446
|
}
|
|
10441
|
-
const fileTreeSlice =
|
|
10447
|
+
const fileTreeSlice = context$1.fileTree;
|
|
10442
10448
|
if (!((_a = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _a.allFiles)) {
|
|
10443
10449
|
console.log("[useBacklogCore] FileTree not available");
|
|
10444
10450
|
setIsBacklogProject(false);
|
|
10445
10451
|
setCore(null);
|
|
10446
10452
|
setFilePaths([]);
|
|
10447
|
-
span.
|
|
10448
|
-
"
|
|
10449
|
-
"output.reason": "no_filetree"
|
|
10453
|
+
span.addEvent("backlog.core.init.skipped", {
|
|
10454
|
+
reason: "no_filetree"
|
|
10450
10455
|
});
|
|
10451
10456
|
span.setStatus({
|
|
10452
10457
|
code: SpanStatusCode.OK
|
|
@@ -10457,9 +10462,8 @@ function useBacklogCore(options) {
|
|
|
10457
10462
|
if (core2 && fileTreeVersionRef.current === currentVersion) {
|
|
10458
10463
|
console.log("[useBacklogCore] Already initialized for this version");
|
|
10459
10464
|
setIsInitializing(false);
|
|
10460
|
-
span.
|
|
10461
|
-
"
|
|
10462
|
-
"output.reason": "already_initialized"
|
|
10465
|
+
span.addEvent("backlog.core.init.skipped", {
|
|
10466
|
+
reason: "already_initialized"
|
|
10463
10467
|
});
|
|
10464
10468
|
span.setStatus({
|
|
10465
10469
|
code: SpanStatusCode.OK
|
|
@@ -10491,8 +10495,8 @@ function useBacklogCore(options) {
|
|
|
10491
10495
|
console.log("[useBacklogCore] Not a Backlog.md project");
|
|
10492
10496
|
setIsBacklogProject(false);
|
|
10493
10497
|
setCore(null);
|
|
10494
|
-
span.
|
|
10495
|
-
"
|
|
10498
|
+
span.addEvent("backlog.core.init.skipped", {
|
|
10499
|
+
reason: "not_backlog_project"
|
|
10496
10500
|
});
|
|
10497
10501
|
span.setStatus({
|
|
10498
10502
|
code: SpanStatusCode.OK
|
|
@@ -10538,8 +10542,8 @@ function useBacklogCore(options) {
|
|
|
10538
10542
|
setIsInitializing(false);
|
|
10539
10543
|
span.end();
|
|
10540
10544
|
}
|
|
10541
|
-
});
|
|
10542
|
-
}, [
|
|
10545
|
+
}));
|
|
10546
|
+
}, [context$1, actions, core2, fetchFileContent, parentSpan]);
|
|
10543
10547
|
useEffect(() => {
|
|
10544
10548
|
initializeCore();
|
|
10545
10549
|
}, [initializeCore]);
|
|
@@ -10838,23 +10842,27 @@ const KanbanPanel = ({
|
|
|
10838
10842
|
const [searchQuery, setSearchQuery] = useState("");
|
|
10839
10843
|
const [isSearchVisible, setIsSearchVisible] = useState(false);
|
|
10840
10844
|
const searchDebounceRef = useRef(null);
|
|
10841
|
-
|
|
10842
|
-
|
|
10845
|
+
const boardSessionSpanRef = useRef(null);
|
|
10846
|
+
const boardSessionStartedRef = useRef(false);
|
|
10847
|
+
if (!boardSessionStartedRef.current) {
|
|
10848
|
+
boardSessionStartedRef.current = true;
|
|
10843
10849
|
const tracer = getTracer();
|
|
10844
|
-
|
|
10850
|
+
boardSessionSpanRef.current = tracer.startSpan("board.session", {
|
|
10845
10851
|
attributes: {
|
|
10846
10852
|
"panel.id": "kanban-panel"
|
|
10847
10853
|
}
|
|
10848
10854
|
});
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10855
|
+
boardSessionSpanRef.current.addEvent("board.session.started");
|
|
10856
|
+
}
|
|
10857
|
+
useEffect(() => {
|
|
10858
|
+
var _a2;
|
|
10859
|
+
if (boardSessionSpanRef.current) {
|
|
10860
|
+
boardSessionSpanRef.current.addEvent("panel.initialized", {
|
|
10861
|
+
"panel.id": "kanban-panel",
|
|
10862
|
+
"has.file.tree": Boolean((_a2 = context2 == null ? void 0 : context2.fileTree) == null ? void 0 : _a2.data),
|
|
10863
|
+
"has.file.system": Boolean(actions == null ? void 0 : actions.writeFile)
|
|
10864
|
+
});
|
|
10865
|
+
}
|
|
10858
10866
|
}, []);
|
|
10859
10867
|
const handleSearchChange = useCallback((value) => {
|
|
10860
10868
|
setSearchQuery(value);
|
|
@@ -10941,7 +10949,8 @@ const KanbanPanel = ({
|
|
|
10941
10949
|
canWrite
|
|
10942
10950
|
} = useBacklogCore({
|
|
10943
10951
|
context: context2,
|
|
10944
|
-
actions
|
|
10952
|
+
actions,
|
|
10953
|
+
parentSpan: boardSessionSpanRef.current ?? void 0
|
|
10945
10954
|
});
|
|
10946
10955
|
const {
|
|
10947
10956
|
statusColumns,
|
|
@@ -10956,9 +10965,25 @@ const KanbanPanel = ({
|
|
|
10956
10965
|
} = useKanbanData({
|
|
10957
10966
|
core: core2,
|
|
10958
10967
|
events: events2,
|
|
10959
|
-
tasksLimit: 20
|
|
10968
|
+
tasksLimit: 20,
|
|
10969
|
+
parentSpan: boardSessionSpanRef.current ?? void 0
|
|
10960
10970
|
});
|
|
10961
10971
|
const isLoading = isCoreInitializing || isKanbanLoading;
|
|
10972
|
+
const boardSessionEndedRef = useRef(false);
|
|
10973
|
+
useEffect(() => {
|
|
10974
|
+
if (!isLoading && boardSessionSpanRef.current && !boardSessionEndedRef.current) {
|
|
10975
|
+
boardSessionEndedRef.current = true;
|
|
10976
|
+
const span = boardSessionSpanRef.current;
|
|
10977
|
+
span.addEvent("board.session.complete", {
|
|
10978
|
+
"is.backlog.project": isBacklogProject,
|
|
10979
|
+
"has.error": Boolean(error)
|
|
10980
|
+
});
|
|
10981
|
+
span.setStatus({
|
|
10982
|
+
code: error ? SpanStatusCode.ERROR : SpanStatusCode.OK
|
|
10983
|
+
});
|
|
10984
|
+
span.end();
|
|
10985
|
+
}
|
|
10986
|
+
}, [isLoading, isBacklogProject, error]);
|
|
10962
10987
|
const {
|
|
10963
10988
|
milestones,
|
|
10964
10989
|
isLoading: isMilestonesLoading,
|
|
@@ -10967,28 +10992,6 @@ const KanbanPanel = ({
|
|
|
10967
10992
|
} = useMilestoneData({
|
|
10968
10993
|
core: core2
|
|
10969
10994
|
});
|
|
10970
|
-
const hasEmittedSkipped = useRef(false);
|
|
10971
|
-
useEffect(() => {
|
|
10972
|
-
if (!isLoading && !isBacklogProject && !hasEmittedSkipped.current) {
|
|
10973
|
-
hasEmittedSkipped.current = true;
|
|
10974
|
-
const tracer = getTracer();
|
|
10975
|
-
const span = tracer.startSpan("board.interaction", {
|
|
10976
|
-
attributes: {
|
|
10977
|
-
"is.backlog.project": false
|
|
10978
|
-
}
|
|
10979
|
-
});
|
|
10980
|
-
span.addEvent("kanban.skipped", {
|
|
10981
|
-
"reason": "not_backlog_project"
|
|
10982
|
-
});
|
|
10983
|
-
span.setStatus({
|
|
10984
|
-
code: SpanStatusCode.OK
|
|
10985
|
-
});
|
|
10986
|
-
span.end();
|
|
10987
|
-
}
|
|
10988
|
-
if (isBacklogProject) {
|
|
10989
|
-
hasEmittedSkipped.current = false;
|
|
10990
|
-
}
|
|
10991
|
-
}, [isLoading, isBacklogProject]);
|
|
10992
10995
|
const filteredTasksByStatus = useMemo(() => {
|
|
10993
10996
|
if (!searchQuery.trim()) {
|
|
10994
10997
|
return tasksByStatus;
|