Skip to content

feat: complete OAuth flow, preferences API, /signal help, HandleAppMe…#10

Merged
LSUDOKO merged 1 commit into
mainfrom
fix/critical-bugs-worker-ai-translator-focus
Jul 12, 2026
Merged

feat: complete OAuth flow, preferences API, /signal help, HandleAppMe…#10
LSUDOKO merged 1 commit into
mainfrom
fix/critical-bugs-worker-ai-translator-focus

Conversation

@LSUDOKO

@LSUDOKO LSUDOKO commented Jul 12, 2026

Copy link
Copy Markdown
Owner

…ntion

  • Add /oauth/start endpoint that redirects to Slack OAuth with proper scopes
  • Fix OAuth redirect_uri to use frontend callback page
  • Capture authed_user.id in OAuth response, pass slack_user_id + team_id to frontend
  • Add preferences-by-slack API endpoints (GET/PUT) for frontend
  • Add user-by-slack API endpoints (GET/PUT) for neurotype management
  • Wire App Home preferences form to real API calls with loading state
  • Fix Add to Slack buttons on landing page to use /oauth/start
  • OAuth callback page now redirects browser to API for token exchange
  • Implement /signal slash command with help block
  • Implement HandleAppMention with help message in DM
  • Fix /metrics endpoint with promhttp.Handler()

What

How to Test

Checklist

  • make lint passes
  • make test passes
  • Feature tested in Slack sandbox
  • Demo video updated (if UX changed)
  • Docs updated (if API changed)

Summary by CodeRabbit

  • New Features

    • Added Slack installation and OAuth flow with automatic redirect back to the app.
    • App Home now loads and saves preferences using the connected Slack account and workspace.
    • Added support for updating neurotype and preferences, including sensible defaults for new users.
    • Added Slack-based user and preference API access.
    • Mentions and preference requests now open a direct message with updated help guidance.
  • Improvements

    • Updated installation links and simplified the OAuth callback experience.
    • Refreshed help text for translation, digest, and support options.

…ntion

- Add /oauth/start endpoint that redirects to Slack OAuth with proper scopes
- Fix OAuth redirect_uri to use frontend callback page
- Capture authed_user.id in OAuth response, pass slack_user_id + team_id to frontend
- Add preferences-by-slack API endpoints (GET/PUT) for frontend
- Add user-by-slack API endpoints (GET/PUT) for neurotype management
- Wire App Home preferences form to real API calls with loading state
- Fix Add to Slack buttons on landing page to use /oauth/start
- OAuth callback page now redirects browser to API for token exchange
- Implement /signal slash command with help block
- Implement HandleAppMention with help message in DM
- Fix /metrics endpoint with promhttp.Handler()
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 4ad6fbbe-4a6d-4087-a9db-fb4c26a213dd

📥 Commits

Reviewing files that changed from the base of the PR and between f510bdc and 4efb643.

📒 Files selected for processing (6)
  • api/internal/features/controller.go
  • api/internal/httpapi/handler.go
  • frontend/src/app/app-home/page.tsx
  • frontend/src/app/oauth/callback/page.tsx
  • frontend/src/app/page.tsx
  • frontend/src/lib/api.ts

📝 Walkthrough

Walkthrough

Slack OAuth now passes Slack identity parameters into the App Home, which loads and updates user preferences through new Slack-based APIs. Slack help responses move to user DMs, and the help content is updated.

Changes

OAuth and preferences

Layer / File(s) Summary
OAuth routes and Slack identity APIs
api/internal/httpapi/handler.go
Adds OAuth initiation, updates callback token exchange and redirects, and provides Slack-based user and preference endpoints.
Slack identity client contract
frontend/src/lib/api.ts
Updates preference types and helpers to use Slack user/team identifiers and adds user API helpers.
App Home loading and OAuth entry points
frontend/src/app/app-home/page.tsx, frontend/src/app/oauth/callback/page.tsx, frontend/src/app/page.tsx
Loads and saves preferences through the new APIs, handles OAuth callback redirects, and routes installation CTAs through the backend OAuth start endpoint.

Slack help interactions

Layer / File(s) Summary
DM help response flow
api/internal/features/controller.go
Mention and preference handlers open user DMs before posting help blocks, with revised translation, digest, and support text.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant OAuthStart
  participant Slack
  participant OAuthCallback
  participant AppHome
  participant PreferenceAPI

  Browser->>OAuthStart: Request OAuth start
  OAuthStart->>Slack: Redirect to Slack authorization
  Slack->>Browser: Return authorization code
  Browser->>OAuthCallback: Forward code to backend
  OAuthCallback->>Slack: Exchange code for token
  OAuthCallback->>Browser: Redirect with Slack user and team IDs
  Browser->>AppHome: Load App Home
  AppHome->>PreferenceAPI: Get preferences and user
  PreferenceAPI-->>AppHome: Return preference data
  AppHome->>PreferenceAPI: Update preferences and user
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@LSUDOKO
LSUDOKO merged commit b69c475 into main Jul 12, 2026
1 of 3 checks passed
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