From 1e05dbddf1a9bb537fcb9fb4a8b13e2a60cff96f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 4 Jun 2026 09:17:27 +0000 Subject: [PATCH 1/4] Change hash format from (hash) to `hash` across display and copy The renderer, hash parser, copy function, and buffer search all used parenthesized hashes. Switched to backtick-delimited format consistently. https://claude.ai/code/session_01HuYbyYvM2aYDGCRT7Eakmk --- lua/frontline/init.lua | 2 +- lua/frontline/mappings.lua | 9 ++++----- lua/frontline/renderer.lua | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lua/frontline/init.lua b/lua/frontline/init.lua index 2fd6ef8..7d21d90 100644 --- a/lua/frontline/init.lua +++ b/lua/frontline/init.lua @@ -232,7 +232,7 @@ function M.refresh_current_buffer(task_hash) if task_hash then local bufnr = vim.api.nvim_get_current_buf() local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) - local search_str = "(" .. task_hash .. ")" + local search_str = "`" .. task_hash .. "`" for lnum, line in ipairs(lines) do if line:find(search_str, 1, true) then if saved_pos and lnum ~= saved_pos[1] then diff --git a/lua/frontline/mappings.lua b/lua/frontline/mappings.lua index 190e32b..bc3099e 100644 --- a/lua/frontline/mappings.lua +++ b/lua/frontline/mappings.lua @@ -15,12 +15,12 @@ function M.set_config(new_config) end -- Extract task hash from the current line --- Expected format: * [status] description ... (hash) +-- Expected format: * [status] description ... `hash` function M.get_task_hash_under_cursor() local line = vim.api.nvim_get_current_line() - -- Match the hash pattern at the end: (xxxxxxxx) - local hash = string.match(line, "%(([a-f0-9]+)%)%s*$") + -- Match the hash pattern at the end: `xxxxxxxx` + local hash = string.match(line, "`([a-f0-9]+)`%s*$") if not hash then vim.notify("No task hash found on current line", vim.log.levels.WARN) @@ -974,8 +974,7 @@ function M.copy_task() local description = task.description or "Unknown task" local short_uuid = string.sub(task.uuid, 1, 8) - -- Format as "description (short_uuid)" - local text_to_copy = string.format("%s (%s)", description, short_uuid) + local text_to_copy = string.format("%s `%s`", description, short_uuid) -- Copy to system clipboard (+ register) vim.fn.setreg('+', text_to_copy) diff --git a/lua/frontline/renderer.lua b/lua/frontline/renderer.lua index 2d40b9f..e0dc374 100644 --- a/lua/frontline/renderer.lua +++ b/lua/frontline/renderer.lua @@ -259,7 +259,7 @@ function M.format_task(task, convert_to_local, use_relative) table.insert(parts, extra_icons_str) end - table.insert(parts, string.format("(%s)", short_hash)) + table.insert(parts, string.format("`%s`", short_hash)) return table.concat(parts, " ") end From e8b4c6d2564aeacfce3079aa5c1a81c16dcea2b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 4 Jun 2026 10:44:15 +0000 Subject: [PATCH 2/4] Fix get_task_hash_under_cursor not matching hash mid-line Removed the end-of-line anchor so the backtick-wrapped hash is found regardless of its position in the line. https://claude.ai/code/session_01HuYbyYvM2aYDGCRT7Eakmk --- lua/frontline/mappings.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/frontline/mappings.lua b/lua/frontline/mappings.lua index bc3099e..f759131 100644 --- a/lua/frontline/mappings.lua +++ b/lua/frontline/mappings.lua @@ -19,8 +19,7 @@ end function M.get_task_hash_under_cursor() local line = vim.api.nvim_get_current_line() - -- Match the hash pattern at the end: `xxxxxxxx` - local hash = string.match(line, "`([a-f0-9]+)`%s*$") + local hash = string.match(line, "`([a-f0-9]+)`") if not hash then vim.notify("No task hash found on current line", vim.log.levels.WARN) From 94ca45176d1e5317ca634246a56f29cb3b28146c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 8 Jun 2026 09:11:04 +0000 Subject: [PATCH 3/4] Guard against non-string workspace and rc values causing E731 resolve_workspace_rc now checks that entry.rc is a string before passing it to vim.fn.expand. get_workspace_rc_with_override also rejects non-string workspace values early. https://claude.ai/code/session_01HuYbyYvM2aYDGCRT7Eakmk --- lua/frontline/init.lua | 2 +- lua/frontline/mappings.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/frontline/init.lua b/lua/frontline/init.lua index 7d21d90..3d8672a 100644 --- a/lua/frontline/init.lua +++ b/lua/frontline/init.lua @@ -47,7 +47,7 @@ local current_workspace = nil local function resolve_workspace_rc(entry) if type(entry) == "string" then return vim.fn.expand(entry) - elseif type(entry) == "table" and entry.rc then + elseif type(entry) == "table" and type(entry.rc) == "string" then return vim.fn.expand(entry.rc) end return nil diff --git a/lua/frontline/mappings.lua b/lua/frontline/mappings.lua index f759131..4605e16 100644 --- a/lua/frontline/mappings.lua +++ b/lua/frontline/mappings.lua @@ -75,7 +75,7 @@ local function get_workspace_rc_with_override(workspace_override) -- Use override if provided, otherwise use current workspace local workspace = workspace_override or frontline.get_current_workspace() - if not workspace then + if not workspace or type(workspace) ~= "string" then return nil end From 6d02bdd6ab5750bdb0a0b00462d124989352288d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 8 Jun 2026 09:35:08 +0000 Subject: [PATCH 4/4] Revert workspace type guards that caused E731 regression The type guards added to resolve_workspace_rc and get_workspace_rc_with_override caused E731 errors during BufReadPost. Reverting to original workspace resolution logic. https://claude.ai/code/session_01HuYbyYvM2aYDGCRT7Eakmk --- lua/frontline/init.lua | 2 +- lua/frontline/mappings.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/frontline/init.lua b/lua/frontline/init.lua index 3d8672a..7d21d90 100644 --- a/lua/frontline/init.lua +++ b/lua/frontline/init.lua @@ -47,7 +47,7 @@ local current_workspace = nil local function resolve_workspace_rc(entry) if type(entry) == "string" then return vim.fn.expand(entry) - elseif type(entry) == "table" and type(entry.rc) == "string" then + elseif type(entry) == "table" and entry.rc then return vim.fn.expand(entry.rc) end return nil diff --git a/lua/frontline/mappings.lua b/lua/frontline/mappings.lua index 4605e16..f759131 100644 --- a/lua/frontline/mappings.lua +++ b/lua/frontline/mappings.lua @@ -75,7 +75,7 @@ local function get_workspace_rc_with_override(workspace_override) -- Use override if provided, otherwise use current workspace local workspace = workspace_override or frontline.get_current_workspace() - if not workspace or type(workspace) ~= "string" then + if not workspace then return nil end