Skip to content

feat: add feedback configuration API and integrate feedback feature in sidebar#30

Merged
JoachimLK merged 1 commit intomainfrom
JoachimLK/issue29
Feb 21, 2026
Merged

feat: add feedback configuration API and integrate feedback feature in sidebar#30
JoachimLK merged 1 commit intomainfrom
JoachimLK/issue29

Conversation

@JoachimLK
Copy link
Copy Markdown
Contributor

@JoachimLK JoachimLK commented Feb 21, 2026

Summary

  • What does this PR change?
  • Why is this needed?

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Chore

Validation

  • I tested locally
  • I added/updated relevant documentation
  • I verified multi-tenant scoping and auth behavior for affected API paths

DCO

  • All commits in this PR are signed off (Signed-off-by) via git commit -s

Summary by CodeRabbit

  • New Features
    • GitHub feedback button visibility is now dynamically controlled based on server-side configuration.

@railway-app railway-app Bot temporarily deployed to applirank / applirank-pr-30 February 21, 2026 13:34 Destroyed
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Feb 21, 2026

🚅 Deployed to the applirank-pr-30 environment in applirank

Service Status Web Updated (UTC)
applirank ✅ Success (View Logs) Feb 21, 2026 at 1:36 pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 21, 2026

📝 Walkthrough

Walkthrough

This PR adds conditional feedback functionality by introducing a new server API endpoint that checks environment configuration and a client component that fetches and respects this setting to control visibility of the GitHub feedback button.

Changes

Cohort / File(s) Summary
Server Feedback Configuration
server/api/feedback/config.get.ts
New authenticated endpoint that returns feedback enabled status based on GITHUB_FEEDBACK_TOKEN and GITHUB_FEEDBACK_REPO environment variables.
Client Sidebar Integration
app/components/AppSidebar.vue
Fetches feedback configuration on component load and conditionally renders the GitHub issue report button only when feedback is enabled.

Sequence Diagram

sequenceDiagram
    participant Client as AppSidebar Component
    participant Server as /api/feedback/config
    participant Env as Environment

    Client->>Server: GET /api/feedback/config
    Server->>Env: Check GITHUB_FEEDBACK_TOKEN<br/>and GITHUB_FEEDBACK_REPO
    Env-->>Server: Environment variables
    Server-->>Client: { enabled: boolean }
    Client->>Client: Store as feedbackConfig
    alt Feedback Enabled
        Client->>Client: Render GitHub feedback button
    else Feedback Disabled
        Client->>Client: Hide feedback button
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A button now whispers, "Should I appear?"
Environment secrets make the answer clear,
GitHub feedback hops in when the tokens align,
Hidden away when the config's not fine.
Control and grace in just twenty-one lines! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is empty—only the template structure is present with no filled-in content under Summary, Type of change, Validation, or DCO sections. Fill in the Summary section explaining what changed and why, select the appropriate Type of change, and verify all validation requirements including authentication review.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding a feedback configuration API and integrating the feedback feature in the sidebar.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch JoachimLK/issue29

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/components/AppSidebar.vue (1)

56-61: LGTM — consider lazy: true to unblock SSR.

The useFetch is correctly keyed, forwards cookies, and isFeedbackEnabled safely defaults to false on error or null data. One optional micro-optimisation: since this config is static between deployments and the button visibility is non-critical, adding lazy: true would prevent the fetch from blocking the server-side render on every page.

💡 Optional: add lazy: true
 const { data: feedbackConfig } = useFetch('/api/feedback/config', {
   key: 'feedback-config',
   headers: useRequestHeaders(['cookie']),
+  lazy: true,
 })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/AppSidebar.vue` around lines 56 - 61, Add lazy loading to the
feedback config fetch so SSR isn't blocked: update the useFetch call that
assigns feedbackConfig (const { data: feedbackConfig } = useFetch(...)) to
include lazy: true in its options object (alongside key and headers) so the
computed isFeedbackEnabled still works but the request is deferred from
server-side rendering.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/components/AppSidebar.vue`:
- Around line 56-61: Add lazy loading to the feedback config fetch so SSR isn't
blocked: update the useFetch call that assigns feedbackConfig (const { data:
feedbackConfig } = useFetch(...)) to include lazy: true in its options object
(alongside key and headers) so the computed isFeedbackEnabled still works but
the request is deferred from server-side rendering.

@JoachimLK JoachimLK merged commit ecf1703 into main Feb 21, 2026
4 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