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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install tsk
run: |
curl -fsSL https://gettsk.sh/install.sh | TSK_VERSION=v0.13.0 sh
curl -fsSL https://gettsk.sh/install.sh | TSK_VERSION=v0.14.1 sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: tsk --version
- run: cargo test --manifest-path src-tauri/Cargo.toml --test contract -- --ignored
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- With tsk 0.14.0 or later, Rename… sets the tsk project title, and tskdeck shows the titles that tsk keeps, including ones set from the terminal board or by an agent. A refused name stays in the Rename Project sheet with tsk's reason. At launch, tskdeck moves the names it kept in its settings into tsk; a name that tsk refuses stays in the settings, and an alert lists it. With older tsk, tskdeck keeps the names in its settings as before.

## [1.1.1] - 2026-11-06

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ tskdeck shows the board next to an always-visible sidebar of views, projects, th

## Requirements

- [tsk 0.13.0 or later](https://gettsk.sh/docs/install/)
- [tsk 0.13.0 or later](https://gettsk.sh/docs/install/). Project titles need tsk 0.14.0 or later.

tskdeck finds `tsk` from the path set in settings, then the login shell's `PATH`, then the default install locations. It respects `TSK_STATE_DIR`.

## What works

- Sidebar with Views (Desk, All projects), Projects, Threads and Assignees, each with a live task count.
- Project names: right-click a project in the sidebar and choose Rename… to give it a name tskdeck shows wherever the project appears. tsk keeps the project's path.
- Project names: right-click a project in the sidebar and choose Rename… to give it a name shown wherever the project appears. On tsk 0.14.0 or later the name is the tsk project title, so the terminal board and `tsk -p` use it too, and the names tskdeck kept in its settings move into tsk at launch. On older tsk, tskdeck keeps the name in its own settings.
- Board with the NEEDS YOU, IN MOTION and ON DECK sections, plus group and sort controls.
- Task view beside the board or as an overlay: title and notes edited in place, status, assignee and "runs after", steps, activity, and Done, Reply and Archive actions.
- The blocked and review workflow: block and review cards, options, replies, approve and send back, and changing who a task waits on. Review checks are shown read-only.
Expand Down Expand Up @@ -60,7 +60,7 @@ xattr -dr com.apple.quarantine /Applications/tskdeck.app

## Settings

tskdeck keeps its settings (open-task mode, keymap, path to `tsk`, update checks) in `settings.json` inside the app config directory for the identifier `com.s3rgiosan.tskdeck`:
tskdeck keeps its settings (open-task mode, keymap, path to `tsk`, update checks, and the project names not yet moved into tsk) in `settings.json` inside the app config directory for the identifier `com.s3rgiosan.tskdeck`:

- macOS: `~/Library/Application Support/com.s3rgiosan.tskdeck/settings.json`
- Linux: `$XDG_CONFIG_HOME/com.s3rgiosan.tskdeck/settings.json`, or `~/.config/com.s3rgiosan.tskdeck/settings.json` when `XDG_CONFIG_HOME` is unset
Expand Down Expand Up @@ -89,7 +89,7 @@ npm test
cargo test --manifest-path src-tauri/Cargo.toml
```

The contract test runs the real `tsk` binary against a temporary store. It needs tsk 0.13.0 on `PATH`:
The contract test runs the real `tsk` binary against a temporary store. It needs tsk 0.14.0 or later on `PATH`:

```sh
cargo test --manifest-path src-tauri/Cargo.toml --test contract -- --ignored
Expand Down
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.1.1",
"version": "1.2.0",
"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.1.1"
version = "1.2.0"
description = "Unofficial desktop client for the tsk task board"
authors = ["Sérgio Santos"]
edition = "2024"
Expand Down
19 changes: 18 additions & 1 deletion src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::tsk::args::{self, CaptureInput, EditInput, ListOptions, Scope, Status
use crate::tsk::locate;
use crate::tsk::model::{AddResult, TaskDetail, TaskRow};
use crate::tsk::runner::{Tsk, TskError};
use crate::tsk::version::{MIN_TSK, parse_version};
use crate::tsk::version::{MIN_TSK, PROJECT_TITLES_TSK, parse_version};
use crate::updates::{UPDATE_PROGRESS_EVENT, UpdateInfo, UpdateManager};
use crate::watch::StoreWatcher;

Expand All @@ -33,6 +33,8 @@ pub struct TskInfo {
pub version: String,
pub supported: bool,
pub minimum: String,
/// Whether this tsk keeps project titles.
pub project_titles: bool,
}

/// Finds the `tsk` binary from the user's setting, the login-shell `PATH` and the
Expand Down Expand Up @@ -118,6 +120,7 @@ pub async fn tsk_info(state: State<'_, AppState>) -> Result<TskInfo, TskError> {
version: format!("{}.{}.{}", parsed.0, parsed.1, parsed.2),
supported: parsed >= MIN_TSK,
minimum: format!("{}.{}.{}", MIN_TSK.0, MIN_TSK.1, MIN_TSK.2),
project_titles: parsed >= PROJECT_TITLES_TSK,
})
})
.await
Expand Down Expand Up @@ -212,6 +215,20 @@ pub async fn set_archived(
.await
}

/// Shows the project at `path` under `title`, or under its folder name when `title` is `None`.
#[tauri::command]
pub async fn set_project_title(
state: State<'_, AppState>,
path: String,
title: Option<String>,
) -> Result<(), TskError> {
with_tsk(&state, move |tsk| {
tsk.run(&args::project_title_args(&path, title.as_deref()))
.map(drop)
})
.await
}

#[tauri::command]
pub async fn get_settings(state: State<'_, AppState>) -> Result<Settings, String> {
let guard = state.settings.lock().map_err(|e| e.to_string())?;
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub fn run() {
commands::step,
commands::reply,
commands::set_archived,
commands::set_project_title,
commands::get_settings,
commands::save_settings,
commands::relocate_tsk,
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ pub struct Settings {
pub keymap: BTreeMap<String, Vec<String>>,
pub tsk_path: Option<PathBuf>,
pub sidebar_hidden: bool,
/// Names given to projects in tskdeck, keyed by the project's full path.
/// Names given to projects in tskdeck, keyed by the project's full path. tskdeck shows them
/// when tsk keeps no project titles; with titles, it holds only the names tsk has not taken yet.
pub project_names: BTreeMap<String, String>,
/// Whether tskdeck looks for a newer release after launch and once a day.
pub check_for_updates: bool,
Expand Down
22 changes: 22 additions & 0 deletions src-tauri/src/tsk/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,16 @@ pub fn archive_args(number: u64, archived: bool) -> Vec<String> {
vec![command.into(), task(number)]
}

/// Sets the title of the project at `path`, or removes it when `title` is `None`.
pub fn project_title_args(path: &str, title: Option<&str>) -> Vec<String> {
let mut args = vec!["project".to_string(), "title".into(), path.to_string()];
match title {
Some(title) => args.push(title.to_string()),
None => args.push("--clear".into()),
}
args
}

fn task(number: u64) -> String {
format!("T{number}")
}
Expand Down Expand Up @@ -715,6 +725,18 @@ mod tests {
assert_eq!(archive_args(7, false), s(&["unarchive", "T7"]));
}

#[test]
fn project_title_sets_and_clears() {
assert_eq!(
project_title_args("/home/test/a", Some("Site A")),
s(&["project", "title", "/home/test/a", "Site A"])
);
assert_eq!(
project_title_args("/home/test/a", None),
s(&["project", "title", "/home/test/a", "--clear"])
);
}

#[test]
fn list_options_use_plain_strings() {
let o: ListOptions = serde_json::from_value(
Expand Down
5 changes: 5 additions & 0 deletions src-tauri/src/tsk/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ pub struct TaskRow {
pub title: String,
pub status: Status,
pub project: Option<String>,
/// The name the project shows under. tsk omits it when the project has no title.
#[serde(default)]
pub project_title: Option<String>,
pub thread: Option<String>,
pub assignee: Option<String>,
pub assignee_kind: Option<String>,
Expand Down Expand Up @@ -167,6 +170,8 @@ mod tests {
serde_json::from_str(include_str!("../../tests/fixtures/rows.json")).unwrap();
assert_eq!(rows.len(), 4);
assert_eq!(rows[0].project, None);
assert_eq!(rows[1].project_title, None);
assert_eq!(rows[2].project_title.as_deref(), Some("Client Site"));
assert_eq!(rows[3].block.as_ref().unwrap().on, "task:7");
}

Expand Down
9 changes: 9 additions & 0 deletions src-tauri/src/tsk/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

pub const MIN_TSK: (u32, u32, u32) = (0, 13, 0);

/// The first tsk that keeps project titles (`tsk project title`, `project_title` on rows).
pub const PROJECT_TITLES_TSK: (u32, u32, u32) = (0, 14, 0);

/// Reads `tsk 0.13.0` into `(0, 13, 0)`.
pub fn parse_version(output: &str) -> Option<(u32, u32, u32)> {
let token = output.trim().strip_prefix("tsk ")?.split_whitespace().next()?;
Expand Down Expand Up @@ -34,4 +37,10 @@ mod tests {
assert!((0, 12, 9) < MIN_TSK);
assert!((0, 13, 1) >= MIN_TSK);
}

#[test]
fn project_titles_start_at_0_14_0() {
assert!((0, 13, 9) < PROJECT_TITLES_TSK);
assert!((0, 14, 0) >= PROJECT_TITLES_TSK);
}
}
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.1.1",
"version": "1.2.0",
"identifier": "com.s3rgiosan.tskdeck",
"build": {
"beforeDevCommand": "npm run dev",
Expand Down
55 changes: 54 additions & 1 deletion src-tauri/tests/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::Path;
use tskdeck_lib::tsk::args::*;
use tskdeck_lib::tsk::locate::{default_candidates, locate};
use tskdeck_lib::tsk::model::*;
use tskdeck_lib::tsk::runner::Tsk;
use tskdeck_lib::tsk::runner::{Tsk, TskError};

fn tsk_for(store: &Path) -> Tsk {
let home = dirs::home_dir();
Expand Down Expand Up @@ -336,3 +336,56 @@ fn contract_steps_edit_status_and_scopes() {
assert!(on_shelf(Shelf::Archived).is_empty());
assert!(on_shelf(Shelf::Done).iter().any(|r| r.number == n));
}

#[test]
#[ignore]
fn contract_project_titles() {
let store = tempfile::tempdir().unwrap();
let project = tempfile::tempdir().unwrap();
let tsk = tsk_for(store.path());
let added: AddResult = tsk
.json(&add_args(&CaptureInput {
project: Some(project.path().to_string_lossy().into_owned()),
..capture("titled")
}))
.unwrap();
// tsk stores the project's canonical path; tskdeck names a project by the path on its rows.
let path = detail(&tsk, added.number).row.project.expect("project row");

// tsk trims the title and joins inner whitespace
tsk.run(&project_title_args(&path, Some(" Site A ")))
.unwrap();
assert_eq!(
detail(&tsk, added.number).row.project_title.as_deref(),
Some("Site A")
);
let rows: Vec<TaskRow> = tsk.json(&list_args(&Scope::All, &live())).unwrap();
assert_eq!(rows[0].project_title.as_deref(), Some("Site A"));

// refusals carry a code; a title in use elsewhere is taken whatever its case
let other = tempfile::tempdir().unwrap();
let second: AddResult = tsk
.json(&add_args(&CaptureInput {
project: Some(other.path().to_string_lossy().into_owned()),
..capture("other")
}))
.unwrap();
let other_path = detail(&tsk, second.number)
.row
.project
.expect("project row");
for (target, title, code) in [
(&path, "a/b", "invalid-title"),
(&path, "desk", "invalid-title"),
(&other_path, "site a", "title-taken"),
] {
match tsk.run(&project_title_args(target, Some(title))) {
Err(TskError::Refused { code: got, .. }) => assert_eq!(got, code),
other => panic!("expected {code} for {title}, got {other:?}"),
}
}

// --clear removes the title, and tsk then omits the field
tsk.run(&project_title_args(&path, None)).unwrap();
assert_eq!(detail(&tsk, added.number).row.project_title, None);
}
4 changes: 2 additions & 2 deletions src-tauri/tests/fixtures/rows.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{"id":"11111111-0000-4000-8000-000000000001","number":1,"title":"Sketch the launch checklist","status":"open","project":null,"thread":null,"assignee":null,"assignee_kind":null,"base":null,"after":[],"before":[]},
{"id":"11111111-0000-4000-8000-000000000002","number":2,"title":"Fix footer links","status":"ready","project":"/home/test/work/site","thread":"polish","assignee":"alice","assignee_kind":"human","base":"main","after":[{"task":1,"done":true}],"before":[],"group":"footer"},
{"id":"11111111-0000-4000-8000-000000000003","number":3,"title":"Add contact form","status":"started","project":"/home/test/client/site","thread":null,"assignee":"bot-a","assignee_kind":"agent","base":null,"after":[],"before":[4]},
{"id":"11111111-0000-4000-8000-000000000004","number":4,"title":"Publish release notes","status":"blocked","project":"/home/test/client/site","thread":null,"assignee":null,"assignee_kind":null,"base":null,"after":[{"task":3,"done":false}],"before":[],"block":{"why":"Waiting on copy","needs":null,"options":[],"on":"task:7","by":"bot-a","at":[1700000000,5],"edited":false,"replies":[],"answered":false}}
{"id":"11111111-0000-4000-8000-000000000003","number":3,"title":"Add contact form","status":"started","project":"/home/test/client/site","project_title":"Client Site","thread":null,"assignee":"bot-a","assignee_kind":"agent","base":null,"after":[],"before":[4]},
{"id":"11111111-0000-4000-8000-000000000004","number":4,"title":"Publish release notes","status":"blocked","project":"/home/test/client/site","project_title":"Client Site","thread":null,"assignee":null,"assignee_kind":null,"base":null,"after":[{"task":3,"done":false}],"before":[],"block":{"why":"Waiting on copy","needs":null,"options":[],"on":"task:7","by":"bot-a","at":[1700000000,5],"edited":false,"replies":[],"answered":false}}
]
3 changes: 3 additions & 0 deletions src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export const api = {
invoke<void>("reply", { number, text, send }),
setArchived: (number: number, archived: boolean) =>
invoke<void>("set_archived", { number, archived }),
/** Shows the project at `path` under `title`, or under its folder name when `title` is null. */
setProjectTitle: (path: string, title: string | null) =>
invoke<void>("set_project_title", { path, title }),
// Rejects with a plain string, not a TskError.
getSettings: () => invoke<Settings>("get_settings"),
// Rejects with a plain string, not a TskError.
Expand Down
9 changes: 8 additions & 1 deletion src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export interface TaskRow {
title: string;
status: Status;
project: string | null;
/** The name the project shows under; tsk omits it when the project has no title. */
project_title?: string | null;
thread: string | null;
assignee: string | null;
assignee_kind: string | null;
Expand Down Expand Up @@ -184,7 +186,10 @@ export interface Settings {
keymap: Record<string, string[]>;
tskPath: string | null;
sidebarHidden: boolean;
/** Names given to projects in tskdeck, keyed by the project's full path. */
/**
* Names given to projects in tskdeck, keyed by the project's full path. tskdeck shows them when tsk
* keeps no project titles; with titles, it holds only the names tsk has not taken yet.
*/
projectNames: Record<string, string>;
/** Whether tskdeck looks for a newer release after launch and once a day. */
checkForUpdates: boolean;
Expand Down Expand Up @@ -214,4 +219,6 @@ export interface TskInfo {
version: string;
supported: boolean;
minimum: string;
/** Whether this tsk keeps project titles (tsk 0.14.0 and later). */
projectTitles: boolean;
}
19 changes: 18 additions & 1 deletion src/board/sidebar.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { row } from "../test/fixtures";
import { onDesk, projectLabelsOf, scopeTitle, sidebarModel, sortByProject } from "./sidebar";
import { onDesk, projectLabelsOf, projectNamesOf, scopeTitle, sidebarModel, sortByProject } from "./sidebar";

describe("sidebarModel", () => {
it("disambiguates colliding basenames", () => {
Expand Down Expand Up @@ -100,6 +100,23 @@ describe("projectLabelsOf", () => {
});
});

describe("projectNamesOf", () => {
const rows = [
row({ project: "/home/test/a", project_title: "Alpha" }),
row({ project: "/home/test/b" }),
row({ project: null }),
];
const local = { "/home/test/b": "Beta" };

it("reads the titles tsk puts on the rows", () => {
expect(projectNamesOf(rows, true, local)).toEqual({ "/home/test/a": "Alpha" });
});

it("uses the names kept in settings on a tsk without titles", () => {
expect(projectNamesOf(rows, false, local)).toBe(local);
});
});

describe("sortByProject", () => {
it("keeps projects that share a label apart", () => {
const rows = [
Expand Down
Loading
Loading