Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(kanban): a view is not 'modified' for naming a label or column that is gone

review44de6b42f783
diff --git a/src/renderer/components/kanban/KanbanView.tsx b/src/renderer/components/kanban/KanbanView.tsx
index 7d6638bbc..ef137d0a2 100644
--- a/src/renderer/components/kanban/KanbanView.tsx
+++ b/src/renderer/components/kanban/KanbanView.tsx
@@ -522,7 +522,19 @@ export const KanbanView = memo(function KanbanView({
() => viewQuery({ source, labels: activeFilter, assignees: assigneeFilter, columns: liveColumnFilter }),
[source, activeFilter, assigneeFilter, liveColumnFilter]
)
- const viewDirty = !!activeView && !sameViewQuery(currentQuery, activeView.query)
+ // Compared as the board can SHOW it: a stored query naming a label or column that no longer
+ // exists (or GitHub on a board without it) would otherwise read as "modified" forever.
+ const viewDirty = useMemo(() => {
+ if (!activeView) return false
+ const q = activeView.query
+ const shown = viewQuery({
+ source: board.github ? q.source ?? 'all' : 'all',
+ labels: (q.labels ?? []).filter((k) => localFilterKeys.has(k) || k.startsWith('github:')),
+ assignees: q.assignees ?? [],
+ columns: (q.columns ?? []).filter((id) => id === 'ungrouped' || board.columns.some((c) => c.id === id))
+ })
+ return !sameViewQuery(currentQuery, shown)
+ }, [activeView, board.github, board.columns, localFilterKeys, currentQuery])
const saveCurrentView = async (): Promise<void> => {
const name = await promptDialog({
message: 'Name this view. Views are saved with the board, so everyone who opens it gets them.',
diff --git a/src/renderer/components/kanban/KanbanView.views.test.tsx b/src/renderer/components/kanban/KanbanView.views.test.tsx
index 1dc285fec..5051f526a 100644
--- a/src/renderer/components/kanban/KanbanView.views.test.tsx
+++ b/src/renderer/components/kanban/KanbanView.views.test.tsx
@@ -190,6 +190,12 @@ describe('KanbanView — saved views', () => {
expect(next.views?.[0].query.assignees?.sort()).toEqual(['enes', 'sam'])
})
+ it('a view naming a column or label that no longer exists is not "modified" just for that', () => {
+ useKanbanDisplay.getState().setActiveViewId('p-views', 'v1')
+ mount(board({ views: [{ id: 'v1', name: 'Mine', query: { assignees: ['enes'], columns: ['gone'], labels: ['local:gone'] } }] }))
+ expect(document.querySelector('.kanban-views-btn')?.textContent).toBe('View: Mine')
+ })
+
it('deleting a view asks first — views are shared with everyone on the board', () => {
const { onChange } = mount(board({ views: [{ id: 'v1', name: 'Mine', query: {} }] }))
openViews()