feat(thread): opt-in unarchive of newly-created threads#196
feat(thread): opt-in unarchive of newly-created threads#196scottlovegrove merged 2 commits intomainfrom
Conversation
Twist auto-archives a newly-created thread for its author so it does not appear in the author's Inbox. Add an opt-in `--unarchive` flag on `tw thread create` that calls `inbox.unarchiveThread` after creation, plus a persisted `userSettings.unarchiveNewThreads` preference settable via `tw config set unarchive-new-threads <true|false>`. The flag wins over the config value, so `--no-unarchive` can override a persisted default. Default behaviour is unchanged — thread stays archived for the author unless the user opts in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
left a comment
There was a problem hiding this comment.
This PR introduces a helpful opt-in feature to automatically unarchive newly created threads via a new --unarchive flag and a configurable unarchiveNewThreads preference. The addition is well-tested and thoughtfully avoids altering the default Twist behavior while providing flexibility for authors who prefer threads to land directly in their inbox. There are a few areas to refine before merging, specifically regarding strict error handling for malformed config files to prevent accidental data loss, registering the newly introduced error codes, and adding the required spinner message for the unarchive API call.
- Add `inbox.unarchiveThread` to API_SPINNER_MESSAGES so users see progress feedback during the unarchive call. - Register `INVALID_VALUE` and `UNKNOWN_KEY` in the ErrorCode union. - Switch `tw config set` from `getConfig` (which silently treats parse failures as empty) to `readConfigStrict`, so a malformed config file surfaces the error instead of being overwritten — preserving any existing token / workspace / future fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## [2.34.0](v2.33.0...v2.34.0) (2026-04-27) ### Features * **thread:** opt-in unarchive of newly-created threads ([#196](#196)) ([1872225](1872225))
|
🎉 This PR is included in version 2.34.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
--unarchiveflag ontw thread createcallsinbox.unarchiveThreadafter creation so the thread lands in the author's Inbox. Failure is non-fatal (warning only — the thread itself was created).userSettings.unarchiveNewThreadssettable viatw config set unarchive-new-threads <true|false>. The flag wins over the config value, so--no-unarchivecan override a persistedtruefor a one-off post.tw config viewnow renders a "User settings" section.Test plan
npm test— all 537 tests pass, including new matrix coverage forthread create(no flag /--unarchive/ config-true /--no-unarchiveoverride / unarchive-failure non-fatal),tw config set(true, false, sibling preservation, unknown key, invalid value), andvalidateConfigForDoctorfor the new nested key.npm run type-checkandnpm run lint:checkclean.npm run check:skill-syncpasses —content.tsupdated andSKILL.mdregenerated.tw thread create <ch> "T1" "body"→ archived for me (default).tw thread create <ch> "T2" "body" --unarchive→ appears in my Inbox.tw config set unarchive-new-threads true→ persisted to~/.config/twist-cli/config.json.tw thread create <ch> "T3" "body"→ in my Inbox (config default).tw thread create <ch> "T4" "body" --no-unarchive→ archived (flag overrides config).tw config viewshows the new "User settings" section.tw doctorreports no spurious warnings.🤖 Generated with Claude Code