feat(settings): initial implementation & move optout - #6
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a first-pass “Settings” surface for Slack Extra, backed by a new UserSettings table, and routes move behavior through per-user opt-out preferences (including moving the manual move opt-out logic into the move command path).
Changes:
- Add a
UserSettingsPiccolo table + migration to persist move opt-out preferences per user. - Implement
/settingsmodal + view submission handler to toggle manual/auto move preferences. - Enforce opt-out behavior in both automatic moves (member-joined handler) and manual channel move command.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| slack_extra/views/settings.py | Adds modal submission handler to save move preference checkboxes. |
| slack_extra/views/init.py | Registers the new settings modal callback handler. |
| slack_extra/tables.py | Adds UserSettings table schema for move opt-out preferences. |
| slack_extra/preferences.py | Adds helpers to read/write move opt-out preferences and check opt-out state. |
| slack_extra/piccolo_migrations/slack_extra_2026_06_21t17_59_09_692057.py | Creates user_settings table with opt-out columns and timestamps. |
| slack_extra/events/member_joined_channel/move.py | Skips automatic channel moves when the user opted out of auto moves. |
| slack_extra/commands/settings.py | Adds /settings command (modal) and settings move subcommand. |
| slack_extra/commands/channel/move.py | Filters out users opted out of manual moves before inviting them; fixes moved count in response. |
| slack_extra/commands/init.py | Registers the new settings command and settings move subcommand in the command registry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+15
to
+17
| insert_values = {"auto_move_opt_out": opt_out} | ||
| else: | ||
| raise ValueError(f"unknown type?? {move_type}") |
Comment on lines
+34
to
+36
| if move_type == "auto": | ||
| return settings.auto_move_opt_out | ||
| raise ValueError(f"unknown type?? {move_type}") |
Comment on lines
+113
to
+115
| await send_heartbeat( | ||
| f"Skipping people who have opted out: `{sorted(opted_out_ids)}`" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.