Skip to content

feat(thread): opt-in unarchive of newly-created threads#196

Merged
scottlovegrove merged 2 commits intomainfrom
scottl/unarchive-new-thread
Apr 27, 2026
Merged

feat(thread): opt-in unarchive of newly-created threads#196
scottlovegrove merged 2 commits intomainfrom
scottl/unarchive-new-thread

Conversation

@scottlovegrove
Copy link
Copy Markdown
Collaborator

Summary

  • Inspired by twist-ai#178, but factoring in the review feedback there: don't change Twist's default behaviour. Make it opt-in.
  • New --unarchive flag on tw thread create calls inbox.unarchiveThread after creation so the thread lands in the author's Inbox. Failure is non-fatal (warning only — the thread itself was created).
  • New persisted preference userSettings.unarchiveNewThreads settable via tw config set unarchive-new-threads <true|false>. The flag wins over the config value, so --no-unarchive can override a persisted true for a one-off post.
  • tw config view now renders a "User settings" section.
  • Default behaviour is unchanged: with no flag and no config, Twist still auto-archives the thread for the author.

Test plan

  • npm test — all 537 tests pass, including new matrix coverage for thread create (no flag / --unarchive / config-true / --no-unarchive override / unarchive-failure non-fatal), tw config set (true, false, sibling preservation, unknown key, invalid value), and validateConfigForDoctor for the new nested key.
  • npm run type-check and npm run lint:check clean.
  • npm run check:skill-sync passes — content.ts updated and SKILL.md regenerated.
  • Manual end-to-end against a real Twist workspace:
    • 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 view shows the new "User settings" section.
    • tw doctor reports no spurious warnings.

🤖 Generated with Claude Code

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>
@scottlovegrove scottlovegrove self-assigned this Apr 27, 2026
@doistbot doistbot requested a review from rmartins90 April 27, 2026 09:25
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Share FeedbackReview Logs

Comment thread src/commands/thread/create.ts
Comment thread src/commands/config/set.ts
Comment thread src/commands/config/set.ts Outdated
- 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>
@scottlovegrove scottlovegrove added the 👀 Show PR PR must be reviewed before or after merging label Apr 27, 2026
@scottlovegrove scottlovegrove merged commit 1872225 into main Apr 27, 2026
4 checks passed
@scottlovegrove scottlovegrove deleted the scottl/unarchive-new-thread branch April 27, 2026 11:01
doist-release-bot Bot added a commit that referenced this pull request Apr 27, 2026
## [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))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.34.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Copy Markdown

@rmartins90 rmartins90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants