Skip to content

Liquid Glass message bubbles over wallpapers like in iMessage - #242

Draft
nedymax wants to merge 13 commits into
TelegramMessenger:masterfrom
nedymax:glass-bubbles
Draft

nedymax wants to merge 13 commits into
TelegramMessenger:masterfrom
nedymax:glass-bubbles

Conversation

@nedymax

@nedymax nedymax commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Key change

Message bubbles become Liquid Glass over chat wallpapers, in every theme.

Material:

  • Live blur: bubbles blur the wallpaper behind them on the GPU, so the glass follows scrolling, resizing and animations with no extra main thread work.
  • Incoming bubbles: in dark themes, a frosted grey that adapts to how light the wallpaper is behind each bubble, lightly tinted with the theme accent on tinted themes. In light themes, a white frosted glass that matches Telegram's light look.
  • Outgoing bubbles: the theme's bubble colour as a tinted glass. The tint is balanced against how light the wallpaper is behind each bubble, so the bubble keeps the theme's colour on dark and light wallpapers alike while the wallpaper still shows through. On gradient themes each bubble takes the gradient colour at its position.
  • Edges: a thin outline on incoming bubbles so they stay separate from bright wallpapers.
  • When: whenever a wallpaper is set. Without a wallpaper, bubbles stay solid as before.

Shape: bubble corners use continuous (squircle) curves like iMessage. Smoothing is worked out separately for the horizontal and vertical edges from each bubble's size, so one-line bubbles keep round ends while their top and bottom edges still ease into the curve, and every bubble keeps consistent corners. Photos, videos, GIFs, maps and file thumbnails use the same curve. Photo corners that touch text below them, and the gaps inside albums, are square. Tails are unchanged.

Inside bubbles: in dark themes, replies, sender names, rank badges and incoming reactions use plain colour fills that sit on the glass. Channel share and go-to buttons use the incoming glass, with the icon tinted to match the outline.

Settings: a new Glass Bubbles switch in Settings → Appearance, below Bubble Mode. It is off by default and can only be turned on while Liquid Glass is on in Power Saving. Turning either off brings back solid bubbles right away.

Fixes:

  • Glass no longer turns darker on messages that load while scrolling up.
  • Bubbles no longer flash a dark bar while a reaction animates out.
  • Long messages no longer jump while their background draws.
  • Theme switching no longer stalls while previewing themes.

Reason

Over custom wallpapers, solid bubbles cover the wallpaper and look flat next to the rest of Telegram's Liquid Glass interface on macOS 26 & above. Glass bubbles let the wallpaper read through while keeping text legible, matching the system look of iMessage.

Screenshot/video result (before/after)

Before

After

Confirmation

Steps:

  • Opened chats with photo, gradient and pattern wallpapers in light, dark and tinted themes.
  • Scrolled long histories, including loading older messages, and resized the window.
  • Opened channels not visited for a while, added and removed reactions, and sent long messages.
  • Checked replies, names, badges, reactions, media and channel share buttons on glass bubbles.
  • Switched and previewed themes repeatedly.
  • Checked media, albums and photos with captions for corner shapes.
  • Toggled Glass Bubbles and Liquid Glass, and checked chats without a wallpaper.

Expected result: bubbles show a live glass over the wallpaper with legible text and consistent corners. Scrolling, reactions and theme switching stay smooth. Media keeps its own shape with no fill around it. Turning the switch off brings back solid bubbles.

Actual result: as expected.

Tested on: macOS 27.0.1, Telegram 13.1.0 (283357).

  • I confirm that I have tested the affected behavior and verified that it works properly, or verified the content and links for a documentation-only change.

@nedymax
nedymax marked this pull request as ready for review November 3, 2026 20:26
@nedymax nedymax changed the title Liquid Glass message bubbles over wallpapers Liquid Glass message bubbles over wallpapers like in iMessage Nov 3, 2026
@macosswift

Copy link
Copy Markdown
Collaborator

Colors are broken. Could you move the PRs to Draft status and improve the solution?

  • The colors issue must be fixed (see the screenshot).
  • The sent message's color must also be improved.
  • A toggle to enable/disable this "glass mode" must be added under Settings → Appearance, and it must be disabled by default.
Screenshot 2026-11-04 at 9 02 10 PM

@nedymax
nedymax marked this pull request as draft November 5, 2026 16:22
@nedymax

nedymax commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

The sent message's color must also be improved.

Can you please specify what needs work?

@nedymax

nedymax commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Changes:

  • Light themes: incoming bubbles are now a white frosted glass that matches Telegram's light look.
  • Sent colour: sent bubbles now use the same tint formula as iMessage, so the colour stays rich in any theme. On gradient themes, each bubble takes the gradient colour at its position.
  • Corners: photos, videos, GIFs, maps and file thumbnails now use the same continuous corners as bubbles. Photo corners that touch text below them, and the gaps inside albums, are square.
  • Settings: the switch moved to Settings → Appearance, below Bubble Mode. It's off by default and still needs Liquid Glass to be on.

The PR description is updated to match.

@nedymax
nedymax marked this pull request as ready for review November 11, 2026 22:33
# Conflicts:
#	Telegram-Mac/en.lproj/Localizable.strings
#	packages/ChatUI/Sources/ChatUI/ChatReactionsView.swift
#	packages/ChatUI/Sources/ChatUI/ChatRowItem.swift
#	packages/TelegramTheme/Sources/TelegramTheme/ChatMessageBubbleImages.swift
@macosswift

Copy link
Copy Markdown
Collaborator

Issues

  • ChatBubbleWallpaperMaterial uses private QuartzCore classes CABackdropLayer and CAFilter plus filterWithType: and private KVC keys. Please use public APIs or retain the solid fallback for the App Store build.
  • The Appearance switch also saves a setting on systems where System.liquidGlassAvailable is false, including Intel Macs, but the renderer never activates there. Please hide or disable the switch when glass bubbles are unavailable.

@nedymax

nedymax commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both:

  • Private APIs: went the App Store exception way. All CABackdropLayer / CAFilter code is now inside #if !APP_STORE, so the App Store build doesn't contain those classes, selectors or keys at all. There, glass bubbles are never active and chats keep solid bubbles. Other builds look exactly as before. I also tried the public route (CALayer.backgroundFilters with CIGaussianBlur + CIColorMatrix), but on current macOS it either doesn't draw or is far too slow while scrolling. The public alternatives that work (NSVisualEffectView, NSGlassEffectView) can't produce this look.
  • Switch on unsupported Macs: the Glass Bubbles row is now hidden when System.liquidGlassAvailable is false (and in App Store builds). The renderer also checks the same flag, so a setting saved earlier has no effect there.

@macosswift

Copy link
Copy Markdown
Collaborator

Issues

  • Glass Bubbles can show as enabled while messages render solid. Turning off Blur in Power Saving reproduces the mismatch with Liquid Glass enabled. Please use the same eligibility in the switch and renderer, or remove the renderer’s separate Blur dependency.

@nedymax

nedymax commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: the renderer no longer depends on Power Saving's Blur. Glass bubbles now use exactly the same eligibility as the switch: Power Saving off, Liquid Glass on and Glass Bubbles on.

# Conflicts:
#	packages/ChatUI/Sources/ChatUI/ChatGroupedItem.swift
@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

  • Glass Bubbles still shows as enabled and on when Power Saving activates automatically. For example, set the automatic threshold to 70%, leave the manual Power Saving switch off, and drop below 70% with Liquid Glass and Glass Bubbles enabled. The renderer switches to solid bubbles, while Appearance still shows Glass Bubbles as available. Please use the effective Power Saving state for the Appearance row so it reflects what the renderer can do.

@nedymax

nedymax commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: the Glass Bubbles row now uses the effective Liquid Glass state (System.liquidGlass), which already accounts for manual Power Saving, the low-battery threshold and the Liquid Glass switch. The row also updates live when that state changes (via systemLiquidGlassDidChange, now public), and when Power Saving is the reason it shows "Glass Bubbles are off while Power Saving is on."

@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

  • In a focused AppKit check using the current layer code, dropping below the automatic Power Saving threshold updates the Appearance switch while an already-rendered bubble keeps its glass backdrop until the row updates. Bubble rows do not observe the effective-state notification. Please refresh visible rows when that state changes.
  • A theme generated below the threshold captures liquidGlass = false. After charging past the threshold, the switch becomes available, but the renderer still rejects that theme's bubbles. Please use the current effective glass state for eligibility and cover both battery transitions.

@nedymax

nedymax commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both:

  • Visible rows: when the battery crosses the Power Saving threshold in either direction and that changes the effective Liquid Glass state, the app now applies the same theme refresh the manual Liquid Glass switch uses, so visible bubbles update right away.
  • Stale theme state: bubble eligibility now reads the live System.liquidGlass instead of the liquidGlass value captured when the theme was generated, so a theme created below the threshold no longer blocks glass after charging.

@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

  • The revised code refreshes chat appearance when automatic Power Saving changes Liquid Glass and reads the live flag. Please attach a before screenshot for the same wallpaper and document VoiceOver verification of the new Glass Bubbles switch.

The changed files pass the contributor file allowlist.

@nedymax

nedymax commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

VoiceOver check: on this build VoiceOver doesn't read the Settings → Appearance rows at all. Every row, including Dark Mode, Bubble Mode and Chat Wallpaper, is announced only as "table row, N of 17", and sometimes as an empty row. Glass Bubbles is a standard GeneralInteractedRowItem switch like its neighbors and behaves the same, so this PR doesn't change how the screen is read. Fixing VoiceOver for these rows seems like a separate, general issue rather than part of this PR.

In the meantime, I found some issues in reliability of the switch and UX of enabling the new feature. I'll work on it right now to ensure it works better. Should I move to draft until I complete everything?

@nedymax
nedymax marked this pull request as draft November 18, 2026 11:46
@nedymax

nedymax commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Updated the Glass Bubbles strings to follow the localization flow in .claude/commands/localization.md:

  • The five Appearance.Settings.GlassBubbles* keys are now sorted in Localizable.strings, and the switch title carries the same @slot=SettingsRow+switch@380 / @max_en_length=37 hard annotations as Dark Mode and Bubble Mode.
  • tools/swiftgen.sh was run, which adds only those five accessors to Localizable.swift.
  • The Appearance screen now uses strings().appearanceSettingsGlassBubbles… instead of raw _NSLocalizedString keys.

About the failing Contributor PR file policy check: it didn't report any disallowed files. Its log says "Could not verify the current test merge. Rerun the workflow.", most likely because it started right after the push, before GitHub had prepared the new test merge. The changed files (Localizable.strings, Localizable.swift, AppAppearanceViewController.swift) are all within the allowlist, and the check passed on the previous commits. I can't rerun it from a fork, so could a maintainer rerun it, please?

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