Skip to content

UI/UX Enhancements: Custom channel mode and interactive permission buttons#13

Open
BRBCoffeeDebuff wants to merge 5 commits into
dbenn8:mainfrom
BRBCoffeeDebuff:feature/interactive-ui-and-channels
Open

UI/UX Enhancements: Custom channel mode and interactive permission buttons#13
BRBCoffeeDebuff wants to merge 5 commits into
dbenn8:mainfrom
BRBCoffeeDebuff:feature/interactive-ui-and-channels

Conversation

@BRBCoffeeDebuff

Copy link
Copy Markdown

Summary

This PR adds several UI/UX enhancements to improve the Slack integration experience:

New Features

Custom Channel Mode (--channel / -c)

  • Run Claude sessions in a dedicated channel with top-level messages instead of threads
  • Useful for dedicated project channels or testing environments
  • Example: claude-slack --channel testchannel

Interactive Permission Buttons

  • Permission prompts now use Block Kit cards with clickable buttons
  • Supports both 2-option and 3-option permission prompts
  • Buttons are styled appropriately (green for approve, red for deny)

Bug Fixes

  • Stale sessions: Sessions are now properly marked as inactive when the wrapper exits
  • Socket lookup: Listener now skips sessions with non-existent sockets (safety net for stale sessions)
  • Deny button detection: Uses button style (danger) instead of hardcoded value, fixing 2-option prompts

Technical Changes

File Changes
hooks/on_notification.py v2.2.0 - Custom channel support, interactive buttons
core/slack_listener.py get_socket_for_channel(), channel ID→name resolution
core/session_registry.py deactivate_session() method
core/claude_wrapper_hybrid.py Cleanup marks sessions inactive
README.md Documentation for custom channel mode

Testing

  • Tested custom channel mode with top-level messages
  • Verified permission button clicks route back correctly
  • Confirmed stale session cleanup works on exit

🤖 Generated with Claude Code

BRBCoffeeDebuff and others added 5 commits January 17, 2026 16:35
New Features:
- Add claude-slack-test command for testing Slack connection
- Add --local flag to test directory-level hook configuration
- Add optional --description flag to claude-slack for meaningful thread descriptions

Path Standardization:
- Consolidate all paths to ~/.claude/slack/ directory structure:
  - ~/.claude/slack/logs/ for all log files
  - ~/.claude/slack/sockets/ for Unix sockets
  - ~/.claude/slack/registry.db for session database
- Remove hardcoded /tmp/ paths that were inconsistent with config.py defaults
- Update .env.example to show correct default paths (commented out)
- Fix .env to not override defaults with /tmp/ paths

Files Changed:
- bin/claude-slack-test (new): Test Slack connection and directory setup
- bin/claude-slack: Add --description and --help flags
- bin/claude-slack-listener: Fix monitor log path
- bin/claude-slack-monitor: Add env loading, fix log paths
- bin/claude-slack-debug: Fix log/socket directory paths
- core/slack_listener.py: Use get_socket_dir() for legacy socket
- core/claude_wrapper_hybrid.py: Use LOG_DIR for buffer files
- core/session_registry.py: Add description support in Slack threads
- hooks/on_*.py: Add LOG_DIR, fix debug log paths
- README.md, SECURITY.md: Update path references

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Key changes:
1. Fix session ID detection bug - hooks now use project_dir fallback when
   session_id lookup fails, resolving the mismatch between wrapper session
   IDs (8-char) and Claude's internal project session IDs (36-char UUID)

2. Replace emoji reactions with interactive Block Kit buttons for permission
   prompts - buttons show colored options (green approve, red deny) and
   update in-place when clicked to show the selection

3. Add project-specific channel support - use `--channel #my-channel` flag
   to post session threads to a specific channel instead of the default

4. Database schema migration - added project_dir column and expanded
   session_id column to support UUIDs, with automatic migration for
   existing databases

Technical details:
- registry_db.py: Expanded session_id column from String(8) to String(50),
  added project_dir column with index, added get_by_project_dir() method
- on_notification.py: Added post_permission_card() for Block Kit cards,
  enhanced enhance_notification_message() to return permission options
- slack_listener.py: Added handle_permission_button() for button clicks
- session_registry.py: Support custom_channel in _create_slack_thread()
- claude_wrapper_hybrid.py: Added --channel flag, pass project_dir in
  registration calls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Custom channels:
- Custom channel mode now uses top-level messages instead of threading
- Helps keep project-specific channels organized without long threads

Permissions channel:
- New --permissions-channel flag for dedicated permission prompts channel
- Permissions can go to a separate channel from main session messages

Message cleanup:
- Permission messages are deleted after approval to keep channels clean
- Falls back to updating message if delete permissions not available

Deny feedback:
- Clicking deny button prompts user to type feedback for Claude
- User's reply in thread will be routed as the deny response
- Improves communication flow when rejecting proposed actions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrapper now waits for channel (not thread_ts) since custom channels
  use top-level messages without a parent thread
- REGISTER_EXISTING command now only requires session_id and channel
  (thread_ts can be None for custom channel mode)
- Added file-based logging to session registry for debugging
- Updated log messages to clarify top-level vs threaded mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
UI/UX Enhancements:
- Custom channel mode (--channel/-c): Post messages as top-level instead of threads
- Interactive buttons for permission prompts (Block Kit cards)
- Proper handling of 2-option vs 3-option permission prompts
- Channel-based routing for custom channel sessions

Bug Fixes:
- Fix stale sessions: Sessions now marked inactive on cleanup
- Fix socket lookup: Skip sessions with non-existent sockets
- Fix deny button: Detect via button style (danger) not just value

Technical Changes:
- hooks/on_notification.py v2.2.0: Custom channel support, interactive buttons
- core/slack_listener.py: get_socket_for_channel(), channel ID resolution
- core/session_registry.py: deactivate_session() method
- core/claude_wrapper_hybrid.py: Cleanup marks sessions inactive
- README.md: Documentation for custom channel mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant