Skip to content

v0.3.0

Choose a tag to compare

@rameerez rameerez released this 16 Sep 14:21
· 8 commits to main since this release

Official accounts. A support desk, a shop or an organization is not a person, and the people it talks to need to see that at a glance — the blue tick everyone already reads.

class SupportDesk < ApplicationRecord
  acts_as_messager verified: true, notifications: false, blockable: false, inbox: :grouped
end

The badge renders next to the name in the inbox row, the grouped row and the thread header. Never replacing the name, always beside it.

What ships

  • acts_as_messager verified: true → Klass.chat_verified?, alongside the existing notifications:, blockable: and inbox: options.
  • Accessible by default. The badge carries an aria-label and title reading "Official account" (Cuenta oficial in Spanish), with the glyph itself aria-hidden so nothing is announced twice.
  • Yours to restyle. The colour is the --chats-verified custom property; the glyph is config.verified_badge = ->(messager) { markup }, or eject chats/shared/_verified_badge.html.erb.
  • It refuses to coerce. verified: "false" raises at boot rather than quietly verifying an account. Every other boolean option here is forgiving; this one is the mark that says an account is really us, and the strings that reach a model declaration come from exactly the places that produce "false".

The default colour was chosen by measurement

The familiar #1d9bf0 failed: 3.00:1 on the page and 2.73:1 on the inbox row's hover background — the badge dropped below the contrast bar precisely while someone was pointing at it.

Ground #1d9bf0 #0284c7 (shipped)
page #ffffff 3.00 4.10
row hover #f3f4f6 2.73 3.72
inverted #111827 5.91 4.33

A test computes these ratios from the stylesheet rather than asserting a hex, so changing the colour tells you if it stops passing.

Upgrading

Nothing to do. The option defaults to false and an app that does not set it renders exactly as it did on 0.2.0.

Verified

Tests 320 runs, 1342 assertions, 0 failures
Databases SQLite, PostgreSQL
Rails 7.1, 7.2, 8.1

Full detail in CHANGELOG.md.

Full Changelog: v0.2.0...v0.3.0