Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.1] - 2026-11-05

### Changed

- Selecting another view, project, thread or assignee closes the task view.

## [1.0.0] - 2026-11-03

### Added
Expand All @@ -32,5 +38,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- A content security policy for the app's windows, and an absolute path required for the `tsk` binary in Settings.

[Unreleased]: https://github.com/s3rgiosan/tskdeck/compare/1.0.0...HEAD
[Unreleased]: https://github.com/s3rgiosan/tskdeck/compare/1.0.1...HEAD
[1.0.1]: https://github.com/s3rgiosan/tskdeck/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/s3rgiosan/tskdeck/releases/tag/1.0.0
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tskdeck",
"private": true,
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tskdeck"
version = "1.0.0"
version = "1.0.1"
description = "Unofficial desktop client for the tsk task board"
authors = ["Sérgio Santos"]
edition = "2024"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "tskdeck",
"version": "1.0.0",
"version": "1.0.1",
"identifier": "com.s3rgiosan.tskdeck",
"build": {
"beforeDevCommand": "npm run dev",
Expand Down
5 changes: 5 additions & 0 deletions src/board/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export function sidebarModel(allRows: TaskRow[], names: ProjectNames = {}): Side
}

/** The name the sidebar gives a scope; a project with no rows left is named by its given name or its folder. */
/** True when both scopes name the same view, project, thread or assignee. */
export function sameScope(a: Scope, b: Scope): boolean {
return JSON.stringify(a) === JSON.stringify(b);
}

export function scopeTitle(scope: Scope, model: SidebarModel, names: ProjectNames = {}): string {
switch (scope.kind) {
case "desk":
Expand Down
4 changes: 2 additions & 2 deletions src/components/Shell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,8 @@ describe("cursor across live changes", () => {
await userEvent.keyboard("{Enter}");
await screen.findByRole("complementary", { name: "Task" });
vi.mocked(api.listScope).mockResolvedValue([row({ number: 7, status: "started" })]);
await useDeck.getState().selectScope({ kind: "all" });
useDeck.setState({ cursor: 7 });
await useDeck.getState().refresh();
useDeck.setState({ cursor: 7, focus: "board" });
expect(useDeck.getState().openTask).toBe(3);
await userEvent.keyboard("{Control>}d{/Control}");
await vi.waitFor(() => expect(api.setStatus).toHaveBeenCalledWith(7, { kind: "done", clean: false }));
Expand Down
6 changes: 1 addition & 5 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
import { showPullDown } from "../api/client";
import type { Scope } from "../api/types";
import type { SidebarItem } from "../board/sidebar";
import { sidebarModel } from "../board/sidebar";
import { sameScope, sidebarModel } from "../board/sidebar";
import { resolveKeymap } from "../keys/keymap";
import type { Handler, Handlers } from "../keys/useKeymap";
import { useKeymap } from "../keys/useKeymap";
Expand All @@ -24,10 +24,6 @@ export const RENAME_PROJECT = "pane-rename-project";

const TITLES: Record<SectionName, string> = { projects: "Projects", threads: "Threads", assignees: "Assignees" };

function sameScope(a: Scope, b: Scope): boolean {
return JSON.stringify(a) === JSON.stringify(b);
}

function symbolFor(scope: Scope): SymbolName {
switch (scope.kind) {
case "desk":
Expand Down
18 changes: 18 additions & 0 deletions src/state/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,24 @@ describe("reading the open task", () => {
});
});

describe("changing scope", () => {
it("closes the open task when another scope is selected", async () => {
useDeck.setState({ scope: { kind: "project", path: "/home/test/alpha" }, openTask: 1, detail: detail({ number: 1 }) });
await useDeck.getState().selectScope({ kind: "project", path: "/home/test/beta" });
const state = useDeck.getState();
expect(state.openTask).toBeNull();
expect(state.detail).toBeNull();
expect(api.getTask).not.toHaveBeenCalled();
});

it("keeps the open task when the current scope is selected again", async () => {
vi.mocked(api.getTask).mockResolvedValue(detail({ number: 1 }));
useDeck.setState({ scope: { kind: "project", path: "/home/test/alpha" }, openTask: 1, detail: detail({ number: 1 }) });
await useDeck.getState().selectScope({ kind: "project", path: "/home/test/alpha" });
expect(useDeck.getState().openTask).toBe(1);
});
});

describe("marks", () => {
it("drops the mark of a task that leaves the board", async () => {
useDeck.setState({ scope: { kind: "all" } });
Expand Down
4 changes: 3 additions & 1 deletion src/state/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { groupChoices, sortChoices } from "../board/choices";
import { applyOptimistic } from "../board/optimistic";
import { buildBoard, liveNumbersOf } from "../board/sections";
import type { ProjectNames } from "../board/sidebar";
import { onDesk, projectLabelsOf, sortByProject } from "../board/sidebar";
import { onDesk, projectLabelsOf, sameScope, sortByProject } from "../board/sidebar";
import type { Change, Command, UndoEntry } from "../board/undo";
import { inverseOf } from "../board/undo";

Expand Down Expand Up @@ -459,6 +459,8 @@ export const useDeck = create<DeckState>()((set, get) => ({
},

async selectScope(scope) {
// The open task's pane belongs to the board it was opened from.
if (!sameScope(scope, get().scope)) get().close();
const current = get().options;
const group = groupChoices(scope).includes(current.group) ? current.group : "none";
const sort = sortChoices(scope).includes(current.sort) ? current.sort : "recent";
Expand Down
Loading