Skip to content

feat(bichat): always-visible message actions + Fast/Deep regenerate picker#25

Open
diyor28 wants to merge 2 commits into
mainfrom
feat/bichat-enhancements
Open

feat(bichat): always-visible message actions + Fast/Deep regenerate picker#25
diyor28 wants to merge 2 commits into
mainfrom
feat/bichat-enhancements

Conversation

@diyor28

@diyor28 diyor28 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Always-visible message actions: drop the hover-gated opacity on assistant + user message action buttons (copy / regenerate / edit) so they're discoverable on touch devices and reduce a11y friction.
  • Regenerate ⇒ Fast / Deep picker: clicking the ↻ button on the last assistant message now opens a small popover with the configured models (sourced from extensions.llm.models). Picking a model updates the session model via setModel and re-runs the turn with that model. When fewer than 2 models are configured the previous immediate-regenerate behaviour is preserved.
  • Shadow-DOM-safe outside-click: AssistantMessage's outside-click handler now uses event.composedPath(). BiChat is mounted inside a shadow root (applet-host/react-element.ts); without this the retargeted e.target made every click look "outside", unmounting the menu before its onClick could fire — i.e. clicking Fast/Deep did nothing.

Changes

  • ChatMachine._handleRegenerate(turnId, model?) and the public handleRegenerate signature now accept an optional model id and apply it via _setModel before delegating to _sendMessageDirect, keeping ModelSelector in sync.
  • New RegenerateModelOption type and regenerateModels prop on AssistantMessage. AssistantTurnView reads models from useIotaContext() and passes them through.
  • MessagingSnapshot.handleRegenerate and machine/types.ts updated.

Test plan

  • Open a chat session with ≥2 models configured (EAI ali applet).
  • After an assistant turn finishes, click ↻ on the last message — the Fast/Deep popover should appear (Lightning + Brain icons, accent colours match ModelSelector).
  • Click outside / press Escape — popover closes without regeneration.
  • Click Fast — picker closes, regeneration starts using the Fast model, ModelSelector reflects the change.
  • Click Deep — same behaviour with the Deep model.
  • Confirm copy / regenerate buttons are visible without hovering on touch and pointer devices.
  • With only one model configured, clicking ↻ regenerates immediately (no popover).

… picker

- Drop hover-gated opacity on assistant/user message action buttons so
  copy/regenerate/edit are always visible (touch + a11y friendly).
- Clicking the regenerate (↻) button on the last assistant message now
  opens a small popover with the available models (Fast / Deep) sourced
  from `extensions.llm.models`. Selecting one updates the session model
  via setModel and triggers regeneration with that model. Falls back to
  immediate regeneration when fewer than 2 models are configured.
- ChatMachine.handleRegenerate now accepts an optional model id and
  applies it via _setModel before delegating to _sendMessageDirect, so
  ModelSelector and the active session stay in sync.
- Outside-click handler uses event.composedPath() so it works correctly
  inside the BiChat shadow root (event retargeting otherwise made every
  click look "outside" and unmounted the menu before its onClick fired).
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@diyor28 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 39 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18196f8d-a9e8-4399-95f4-1930a292a2b8

📥 Commits

Reviewing files that changed from the base of the PR and between 62ac478 and 1c05149.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • go.mod
  • ui/src/bichat/components/AssistantMessage.tsx
  • ui/src/bichat/components/AssistantTurnView.tsx
  • ui/src/bichat/components/UserMessage.tsx
  • ui/src/bichat/index.ts
  • ui/src/bichat/machine/ChatMachine.ts
  • ui/src/bichat/machine/types.ts
  • ui/src/bichat/types/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bichat-enhancements

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
Review rate limit: 0/1 reviews remaining, refill in 51 minutes and 39 seconds.

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

Pulled in by `go install ./cmd/applet` against the latest module graph
(golang.org/x/text v0.34.0, golang.org/x/sys v0.41.0, etc). No code or
behaviour change — just keeps go.mod / go.sum in sync.
@diyor28

diyor28 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Consumed by eai: https://github.com/iota-uz/eai/pull/2524

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