Skip to content

Fix four known bugs in demo plugin - #215

Merged
saturninoabril merged 1 commit into
masterfrom
demo-plugin-fixes
Aug 13, 2026
Merged

Fix four known bugs in demo plugin#215
saturninoabril merged 1 commit into
masterfrom
demo-plugin-fixes

Conversation

@DHaussermann

Copy link
Copy Markdown
Contributor

Fixed 4 minor bugs with Demo plugin that were found while adding Playwright test coverage.

  • Add null guards for team and channel name in rhs_view.jsx — missing values were causing a webapp crash in the pop-out tab
  • Add trigger_id to openInteractiveDialog to prevent the dialog from being lost in Redux
  • Add unique cancel/confirm handling in handleDialog2 with distinct messages for each outcome
  • Add data-testid to left sidebar header hook status element

- Add null guards for team and channel name in rhs_view.jsx —
  missing values were causing a webapp crash in the pop-out tab
- Add trigger_id to openInteractiveDialog to prevent the dialog
  from being lost in Redux
- Add unique cancel/confirm handling in handleDialog2 with distinct
  messages for each outcome
- Add data-testid to left sidebar header hook status element

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DHaussermann DHaussermann self-assigned this Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes update dialog confirmation and cancellation messages, add a plugin dialog trigger identifier, expose a sidebar hook status test identifier, and guard RHS popout and team navigation paths when context is unavailable.

Changes

Interaction updates

Layer / File(s) Summary
Dialog trigger and callback messaging
webapp/src/plugin.jsx, server/http_hooks.go
The confirmation dialog now supplies demo-plugin-confirmation-dialog. The HTTP hook formats separate confirmation and cancellation messages while preserving the username and callback suffix.
RHS context guards
webapp/src/components/right_hand_sidebar/rhs_view.jsx
RHS popout actions now require team and channel. Effect dependencies use optional team and channel names. Team navigation is guarded when team is unavailable.
Sidebar hook status identifier
webapp/src/components/left_sidebar_header/left_sidebar_header.jsx
The sidebar header now exposes the demo-plugin-hook-status test identifier.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change by identifying four bug fixes in the demo plugin.
Description check ✅ Passed The description directly relates to the changes and identifies all four demo plugin bug fixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch demo-plugin-fixes

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
server/http_hooks.go (1)

237-245: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression tests for both dialog outcomes.

The new request.Cancelled branch changes the post content. Add handler tests for confirmation and cancellation. Also cover the relative callback suffix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@server/http_hooks.go` around lines 237 - 245, Add regression coverage for the
dialog handler around the message construction using request.Cancelled: verify
both confirmation and cancellation posts, and assert each includes the expected
relative callback suffix. Reuse the existing handler test setup and validate the
created post content for both outcomes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webapp/src/components/right_hand_sidebar/rhs_view.jsx`:
- Around line 56-57: Update the anchor rendering in the RHS view so it is only
rendered when team?.name exists, preventing the href text from displaying an
undefined team route; otherwise render the appropriate non-link fallback while
preserving the current navigation behavior for valid teams.
- Around line 15-20: Update the pop-out button disabled conditions and the
popoutRhsPlugin guard in the RHS view component to require popoutSupported,
team?.name, and channel?.name. Ensure both buttons are disabled whenever either
context name is unavailable, matching the API invocation checks.

---

Nitpick comments:
In `@server/http_hooks.go`:
- Around line 237-245: Add regression coverage for the dialog handler around the
message construction using request.Cancelled: verify both confirmation and
cancellation posts, and assert each includes the expected relative callback
suffix. Reuse the existing handler test setup and validate the created post
content for both outcomes.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c7bae1df-7622-4c93-b243-b3ccc6bd685a

📥 Commits

Reviewing files that changed from the base of the PR and between af0d3d8 and 96ee30b.

📒 Files selected for processing (4)
  • server/http_hooks.go
  • webapp/src/components/left_sidebar_header/left_sidebar_header.jsx
  • webapp/src/components/right_hand_sidebar/rhs_view.jsx
  • webapp/src/plugin.jsx

Comment thread webapp/src/components/right_hand_sidebar/rhs_view.jsx
Comment thread webapp/src/components/right_hand_sidebar/rhs_view.jsx
@DHaussermann

Copy link
Copy Markdown
Contributor Author

@saturninoabril this PR resolves 4 bugs identified while adding Playwright coverage.

Once this is in place E2E test in the monorepo can be used to guard against regression.

@saturninoabril

Copy link
Copy Markdown
Contributor

Thanks @DHaussermann, lgtm.

@saturninoabril
saturninoabril merged commit b74e11c into master Aug 13, 2026
4 checks passed
@saturninoabril
saturninoabril deleted the demo-plugin-fixes branch August 13, 2026 02:50
@saturninoabril saturninoabril added the 4: Reviews Complete All reviewers have approved the pull request label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4: Reviews Complete All reviewers have approved the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants