Skip to content

JTech theme: logos on @handles - #384

Open
jayjaytech wants to merge 2 commits into
TripleU613:mainfrom
jayjaytech:handle-logos
Open

jayjaytech wants to merge 2 commits into
TripleU613:mainfrom
jayjaytech:handle-logos

Conversation

@jayjaytech

@jayjaytech jayjaytech commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A mention of one of 22 forum handles is the chip Discourse draws for a mention of an account, with that brand's logo after the name where core puts a status emoji, in posts and the composer's preview: @claude, @chatgpt, @anthropic, @microsoft, @apple, @meta, @samsung, @nvidia, @intel, @tesla, @spacex, @jtechforums, @groupme, @github, @discourse, @linux, @android, @24six, @zing, @naki, @cloudflare, @python. So @jtechforums looks like @TripleU whether or not the account exists: core cooks a mention of an account as a.mention (a chip) and of a name nobody has as span.mention (plain text); both get the logo, and the span gets core's chip. New JTech theme setting handle_logos, on by default.

Affected module(s)

  • Moderator tools
  • Mini-mod
  • Dislike
  • Disteleplus
  • REQ-PM
  • Mod elections
  • Dumbcourse
  • Smart search
  • Pop-ups
  • Another SMTP
  • Translator tweaks
  • JTech theme
  • Shared (plugin.rb, settings, locales, docs, lint/CI)

How it's built, following the theme's existing patterns:

  • api-initializers/jt-handle-logos.ts: decorateCookedElement (like jt-external-links) appends a .jt-handle-logo with data-jt-handle to matching mentions. For a link the name comes from its /u/ path, since core can put a status emoji in the mention's text.
  • lib/jt-handle-logos.ts: the list of handles.
  • assets/handles/*.svg: one 24×24 logo per handle, registered in about.json as handle-<name>. Each is the brand's colour and mark: Simple Icons for most, LobeHub's icon for ChatGPT, drawn squares for Microsoft, and the brands' own icons for JTech (the JF mark from jtechforums.org), GroupMe, 24six, Zing and Naki, embedded so nothing loads from another site.
  • stylesheets/jt-handles.scss: span.mention.jt-handle takes core's a.mention chip (its values, repeated), and each logo is drawn round at the status emoji's size (0.93em) after the name.
  • Setting described in locales/en.yml and typed in types/jtech-theme.d.ts. The docs (features and development) and the changelog are updated.

The logos are the companies' trademarks; the setting's description says so.

Test plan

  • New system spec in jtech_theme_part3_spec.rb: @claude (an existing account) and @groupme (no account) get their logos with a background image, @groupme's span is a chip (inline-block), and @somebody gets nothing. It runs in the JTech theme job (JTECH_THEME_SPECS=1). I couldn't run it locally (no Discourse install).
  • pnpm lint is clean in a Codespace on current main (4910539): lint:theme (eslint, prettier, stylelint), lint:types, lint:js, lint:prettier, lint:css, lint:scripts, lint:languages, lint:dumbcourse.
  • stree check and rubocop are clean on the spec.

Checklist

  • pnpm lint is clean
  • bundle exec rubocop is clean
  • New / changed settings have entries in config/locales/server.en.yml or client.en.yml
  • New / changed behavior has a spec (a bug fix has one that fails without it)
  • Follows the repository rules: no access past core, visibility checked, nothing core already does
  • No Ruby file references a non-existent setting name

A mention of @claude, @chatgpt, @microsoft, @JtechForums, @groupme, @24six, @zing, @Naki and the rest of the 22 handles in lib/jt-handle-logos shows that brands logo in front of it, in posts and the composer preview, whether or not the account exists. Each logo is a theme asset (assets/handles), drawn round by jt-handles.scss. Setting: handle_logos.
A mention of a listed handle is now the chip core draws for an account (a.mention), with the logo after the name where core puts a status emoji, so @JtechForums looks like @TripleU whether or not the account exists.
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