Skip to content

Commit dc98ffb

Browse files
committed
Update Claude description
1 parent 79a82e6 commit dc98ffb

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ The codebase is split into several Stack packages:
3737
- **`ff-core`** — all business logic and CLI code
3838
- **`ff-test`** — test suite (tasty + tasty-golden + tasty-hedgehog)
3939
- **`ff-brick`** — experimental TUI frontend (included in stack.yaml)
40-
- **`ff-gtk`**, **`ff-qtah`** — experimental GUI frontends (not in stack.yaml)
40+
- **`ff-qtah`** — experimental Qt GUI frontend (included in stack.yaml)
41+
- **`ff-gtk`** — experimental GTK GUI frontend (not in stack.yaml)
4142

4243
### Core modules (`ff-core/lib/`)
4344

@@ -71,6 +72,25 @@ Main types: `Note` (tasks and wiki pages), `Contact`, `Tag`, `Track` (external i
7172

7273
Data is stored on the filesystem via `ron-storage` (from the `ff-notes/ron` repo, pinned by git commit in `stack.yaml`). Each collection (`note`, `contact`, `tag`) is a subdirectory under the data dir. Documents are identified by `DocId` (a RON UUID).
7374

75+
### ff-qtah: Qt GUI frontend
76+
77+
The Qt frontend uses [qtah](https://hackage.haskell.org/package/qtah) bindings. Key constraints:
78+
79+
**Thread safety**: All Qt UI operations must happen on the main (GUI) thread. Never call Qt functions from `forkIO` threads — this is UB and causes unpredictable behavior (e.g., sorting not applied). The correct pattern for background data loading:
80+
81+
```haskell
82+
-- background thread: only pure IO, no Qt calls
83+
void . forkIO $ do
84+
result <- loadData
85+
putMVar resultVar result
86+
-- main thread: receives result and updates UI
87+
runInGuiThreadWhenReady resultVar $ \result -> updateUI result
88+
```
89+
90+
`runInGuiThreadWhenReady` (in `FF.Qt`) creates a 0ms repeating timer on the main thread, and when the `MVar` is filled it calls `QObject.deleteLater` to stop itself, then runs the action.
91+
92+
**qtah API gaps**: `QTimer` in qtah does not expose `stop` — use `QObject.deleteLater` to destroy the timer from within its own callback.
93+
7494
### External dependencies (extra-deps)
7595

7696
The RON libraries (`ron`, `ron-rdt`, `ron-schema`, `ron-storage`) are pulled directly from the `ff-notes/ron` GitHub repo at a specific commit, not from Hackage.

0 commit comments

Comments
 (0)