Skip to content

Build your personal knowledge base with Trilium Notes

refactor(views/board): unnecessary imports

Elian Doran06d98f6fcfe5
diff --git a/apps/client/src/widgets/view_widgets/board_view/differential_renderer.ts b/apps/client/src/widgets/view_widgets/board_view/differential_renderer.ts
index a5ab3c9a80..6b55a560c5 100644
--- a/apps/client/src/widgets/view_widgets/board_view/differential_renderer.ts
+++ b/apps/client/src/widgets/view_widgets/board_view/differential_renderer.ts
@@ -1,4 +1,4 @@
-import { BoardDragHandler, DragContext } from "./drag_handler";
+import { BoardDragHandler } from "./drag_handler";
import BoardApi from "./api";
import appContext from "../../../components/app_context";
import FNote from "../../../entities/fnote";
@@ -135,7 +135,7 @@ export class DifferentialBoardRenderer {
private updateColumns(oldState: BoardState, newState: BoardState): void {
// Check if column order has changed
const orderChanged = !this.arraysEqual(oldState.columnOrder, newState.columnOrder);
-
+
if (orderChanged) {
// If order changed, we need to reorder the columns in the DOM
this.reorderColumns(newState.columnOrder);
@@ -177,7 +177,7 @@ export class DifferentialBoardRenderer {
// Get all existing column elements
const $columns = this.$container.find('.board-column');
const $addColumnButton = this.$container.find('.board-add-column');
-
+
// Create a map of column elements by their data-column attribute
const columnElements = new Map<string, JQuery<HTMLElement>>();
$columns.each((_, el) => {
@@ -190,7 +190,7 @@ export class DifferentialBoardRenderer {
// Remove all columns from DOM (but keep references)
$columns.detach();
-
+
// Re-insert columns in the new order
let $insertAfter: JQuery<HTMLElement> | null = null;
for (const columnValue of newOrder) {
@@ -205,7 +205,7 @@ export class DifferentialBoardRenderer {
$insertAfter = $columnEl;
}
}
-
+
// Ensure add column button is at the end
if ($addColumnButton.length) {
this.$container.append($addColumnButton);
@@ -294,7 +294,7 @@ export class DifferentialBoardRenderer {
// Create header with drag handle
const $titleEl = $("<h3>").attr("data-column-value", column);
-
+
// Create drag handle
const $dragHandle = $("<span>")
.addClass("column-drag-handle icon bx bx-menu")
@@ -302,7 +302,7 @@ export class DifferentialBoardRenderer {
// Create title text
const $titleText = $("<span>").text(column);
-
+
// Create title content container
const $titleContent = $("<div>")
.addClass("column-title-content")
diff --git a/apps/client/src/widgets/view_widgets/board_view/index.ts b/apps/client/src/widgets/view_widgets/board_view/index.ts
index 1bdf7d21ef..23b70e2217 100644
--- a/apps/client/src/widgets/view_widgets/board_view/index.ts
+++ b/apps/client/src/widgets/view_widgets/board_view/index.ts
@@ -1,8 +1,7 @@
import { setupHorizontalScrollViaWheel } from "../../widget_utils";
import ViewMode, { ViewModeArgs } from "../view_mode";
-import attributeService from "../../../services/attributes";
import noteCreateService from "../../../services/note_create";
-import appContext, { EventData } from "../../../components/app_context";
+import { EventData } from "../../../components/app_context";
import { BoardData } from "./config";
import SpacedUpdate from "../../../services/spaced_update";
import { setupContextMenu } from "./context_menu";
@@ -388,11 +387,11 @@ export default class BoardView extends ViewMode<BoardData> {
// Also handle clicks on the h3 element itself (but not on the drag handle)
this.$container.on('click', 'h3[data-column-value]', (e) => {
// Only proceed if the click wasn't on the drag handle or edit icon
- if (!$(e.target).hasClass('column-drag-handle') &&
- !$(e.target).hasClass('edit-icon') &&
+ if (!$(e.target).hasClass('column-drag-handle') &&
+ !$(e.target).hasClass('edit-icon') &&
!$(e.target).hasClass('bx-menu') &&
!$(e.target).hasClass('bx-edit-alt')) {
-
+
e.stopPropagation();
const $titleEl = $(e.currentTarget);
const columnValue = $titleEl.attr('data-column-value');
@@ -416,7 +415,7 @@ export default class BoardView extends ViewMode<BoardData> {
.attr("title", "Drag to reorder column");
const $titleText = $("<span>").text(title);
-
+
const $titleContent = $("<div>")
.addClass("column-title-content")
.append($dragHandle, $titleText);