Skip to content

Make the user's own bubble follow the theme instead of inverting it - #29

Merged
MyPrototypeWhat merged 2 commits into
MiniMax-AI:mainfrom
stevenjj33:fix/minimax-bot-user-bubble-follows-theme
Oct 19, 2026
Merged

MyPrototypeWhat merged 2 commits into
MiniMax-AI:mainfrom
stevenjj33:fix/minimax-bot-user-bubble-follows-theme

Conversation

@stevenjj33

@stevenjj33 stevenjj33 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The outgoing bubble inverts against the surface in both themes, because --user is defined as the inverse of the background:

theme --user (outgoing bubble) --user-ink --bubble (Bot bubbles)
light #0a0a0a #fcfcfc #efefef
dark #f2f2f2 #141414 #262626

Every Bot bubble sits on --bubble, a low-contrast tone that reads as ordinary chat. Only the outgoing bubble is fully inverted, so in the light theme it renders near-black on near-white and reads closer to a system message than to something the user wrote.

This replaces that background with a 12% tint of the accent, which inkOf() already resolves per theme.

Change

One rule, miniapp/client/app.css:

+/* The user's own bubble stays inside the theme's palette instead of inverting it:
+   a near-black bubble on the light surface and a near-white one on the dark surface read as
+   a system message rather than as outgoing chat. A 12% accent tint keeps the outgoing side
+   identifiable while following --accent, which inkOf() already resolves per theme. */
 .msg.user .bubble {
-  background: var(--user);
-  color: var(--user-ink);
+  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
+  color: var(--ink);
   white-space: pre-wrap;
   max-width: 100%;
 }

Scoped to .msg.user .bubble on purpose. --user is also used by .btn.primary (app.css:299), .send.stop (app.css:1305) and the toast (app.css:2450), so redefining the variable would change those three surfaces as well. All four remaining --user references are untouched.

Contrast

WCAG 2.1 ratios for the outgoing bubble, AA body-text threshold is 4.5:1:

before after (default ocean accent)
light 19.30:1 15.56:1
dark 16.46:1 12.35:1

Because the tint keeps the background close to --surface, no palette can collapse the ratio. Checked against all twelve palettes in octopus.js:

  • light, worst case: indigo, 15.10:1
  • dark, worst case: yellow, 11.18:1

Tested environment

  • macOS, MiniMax Code with MiniMax Bot 0.7.2 (ea3c8a3)
  • npm run check on the branch: validate clean, 69/69 tests pass (same as the base commit)
  • Reproduced both themes in a standalone page built from the real variable values and the real .bubble / .msg.user .bubble rules, and compared the outgoing bubble before and after side by side in each theme
  • Contrast ratios computed with the WCAG 2.1 relative-luminance formula

Unverified: I did not install the patched package and view it inside a running MiniMax Code instance, so the result in the live app is inferred from the reproduction rather than observed there. The rounding corner radius, spacing and hover states are unchanged, so the visible difference is limited to the bubble fill and text colour.

I also left the package version at 0.7.2 rather than bumping it, since releasing an official package looks like a maintainer decision and a bump would collide with your release PRs. Happy to add it if that is the convention for outside contributions.

Note on scope

This is a visual design change rather than a defect fix: the current inversion is internally consistent and fully readable, so if the inversion is deliberate, closing this is a perfectly reasonable outcome. The change is reversible and self-contained.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

--user is defined as the inverse of the surface (#0a0a0a on light, #f2f2f2 on
dark), so the outgoing bubble inverts in both themes while every Bot bubble
stays on --bubble and reads as normal chat. On the light surface the outgoing
bubble looks like a system message rather than something the user wrote.

Tint it with the accent instead. --accent is already resolved per theme by
inkOf(), so this keeps the outgoing side identifiable without leaving the
palette. Scoped to .msg.user .bubble on purpose: --user is also used by
.btn.primary, .send.stop and the toast, and redefining the variable would
change those three surfaces as well.

WCAG 2.1 contrast for the outgoing bubble stays well above the 4.5:1 AA
threshold: 15.56:1 light, 12.35:1 dark with the default ocean accent, and
11.18:1 in the worst case across all twelve palettes (yellow on dark).

@MyPrototypeWhat MyPrototypeWhat left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this change — the analysis is solid. I ran npm run check on the merged tree (Node 22: validate clean, 69/69 tests pass) and also loaded the real app.css in headless Chrome to verify computed styles: light bubble background #e4ecff, dark #262d3a, body text contrast at worst 15.1:1 (light) / 11.2:1 (dark) across all 12 accent palettes, matching your numbers. One extra win: dark-theme @-mention chips on the user bubble were all below 3:1 on the inverted bubble and are now ~4.5:1 or better. Scope is correctly limited to .msg.user .bubble; .btn.primary, .send.stop, and toast still use --user unchanged.

Required changes

  • CONTRIBUTING line 17 asks for a version bump when updating an existing app. This is an official package; if we take the design change, please bump .minimax-plugin/plugin.json and package.json to 0.7.3 in sync (validate does not check that the two match). I can do that at merge time, or you can add it in this PR.
  • CONTRIBUTING line 17 also asks to install and check in MiniMax Code. You've noted you haven't seen it in a running client; I'll install it before merge and confirm both themes look right.

Suggestions (optional)

  • Light-theme lime / yellow @-mention chips on the bubble are ~2.7:1. That's an existing palette-ink issue (same on Bot bubbles), not something this PR needs to fix — we'll follow up separately.

.msg.user .bubble {
background: var(--user);
color: var(--user-ink);
background: color-mix(in srgb, var(--accent) 12%, var(--surface));

@MyPrototypeWhat MyPrototypeWhat Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified in headless Chrome: light #e4ecff, dark #262d3a, body text at worst 15.1 / 11.2:1 — looks good. If we merge, please bump plugin.json / package.json versions in sync (CONTRIBUTING:17).

CONTRIBUTING.md:17 asks for a version bump when updating an existing app. Both manifests move 0.7.2 -> 0.7.3 together, since validate does not check that they match.

@MyPrototypeWhat MyPrototypeWhat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the bump. 5af6983 only changes the version in .minimax-plugin/plugin.json and package.json, both 0.7.2 → 0.7.3, and nothing else; no other 0.7.2 references are left in the package. Merged onto current main, repository validation passes with minimax-bot: OK.

I didn't get to an install in a running client, but the change is a single .msg.user .bubble rule and I'd already checked the real app.css in headless Chrome (computed #e4ecff light / #262d3a dark, body text ≥15.1:1 / ≥11.2:1 across all 12 accents), so I'm comfortable merging. Approving.

@MyPrototypeWhat
MyPrototypeWhat merged commit 994d358 into MiniMax-AI:main Oct 19, 2026
1 check 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.

2 participants