Commit Graph
6 Commits
Author SHA1 Message Date
Matouš Jan FialkaandGitHub 203ef99fc7 Improve enhanced task widget (#1905)
* Fix (tasks): Toggle dropdown on re-click and narrow mark decoration range

- Clicking the dropdown icon now dismisses the completion menu if it
  is already open (`closeCompletion`).

- The `data-task-state` mark decoration now covers only the inner state
  text (excluding brackets). This prevents CodeMirror cursor/editing
  issues when the caret is inside the brackets and allows bracket-aware
  CSS styling. Example:

  ```space-style
  [data-task-state="DONE"] { color: green; }
  [data-task-state="PLANNED"] { color: orange; }
  [data-task-state] { font-weight: bold; }
  ```

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>

* Refactor (tasks): Unify task state data attribute to `data-task-state`

Rename `data-state` to `data-task-state` on extended task state spans in
Markdown renderer and update the corresponding places.

Previously the editor (CodeMirror mark decoration) used
`data-task-state` while the widget HTML renderer used `data-state`,
requiring duplicate CSS selectors. Now a single attribute selector works
everywhere (for example tasks rendered using `template.taskItem` also
follow the styling now):

```css
[data-task-state="PLANNED"] { /* cool CSS here */; }
```

Note: Checkbox inputs (`[ ]`/`[x]`/`[X]`) still use `data-state` since
they follow a different code path.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>

---------

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-03-24 08:51:13 +01:00
Zef Hemel 6623daa0a2 More sync engine tests + fixes 2026-03-20 16:10:33 +01:00
d2e24ebae0 Add a dropdown picker for custom task states (#1900)
* Add a dropdown picker for custom task states

Add a dropdown picker for custom task states that appears as a small
triangle next to the `[state]` allowing to quickly switch between
defined states with autocomplete.

States marked as done receive strikethrough styling on the task text.

Each state can be styled individually using the `data-task-state`
attribute, for example:

```space-style
[data-task-state=PLANNED] .sb-task-state {
  color: black;
  background-color: orange;
}
```

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>

* Keep the current task state visible while the dropdown picker is open

Keep the current task state visible while the dropdown picker is open by
disabling built-in filtering and handling it manually — when the state
text exactly matches a known state all options are shown, otherwise
results are filtered by what the user has typed so far.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>

* Added on-hover completion styling

* Fix: Show all defined task states in the dropdown when clicking the picker on an unrecognized state instead of showing an empty menu

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>

---------

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
Co-authored-by: Zef Hemel <zef@zef.me>
2026-03-20 15:09:12 +01:00
Matouš Jan FialkaandGitHub 8f7e525812 Fix mobile tasks, annoying caret jumping and empty widgets on navigation (#1890) 2026-03-17 22:16:58 +01:00
Zef Hemel 799e27a9b4 Enable biome based formatter and reformat 2026-03-10 09:38:59 +01:00
Zef Hemel d6190b7c05 Moving more files around 2025-09-29 11:17:55 +02:00