Repository navigation
JTech theme: logos on @handles - #384
Open
jayjaytech wants to merge 2 commits into
Open
jayjaytech wants to merge 2 commits into
jayjaytech wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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@jtechforumslooks like@TripleUwhether or not the account exists: core cooks a mention of an account asa.mention(a chip) and of a name nobody has asspan.mention(plain text); both get the logo, and the span gets core's chip. New JTech theme settinghandle_logos, on by default.Affected module(s)
How it's built, following the theme's existing patterns:
api-initializers/jt-handle-logos.ts:decorateCookedElement(likejt-external-links) appends a.jt-handle-logowithdata-jt-handleto 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 inabout.jsonashandle-<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-handletakes core'sa.mentionchip (its values, repeated), and each logo is drawn round at the status emoji's size (0.93em) after the name.locales/en.ymland typed intypes/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
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@somebodygets nothing. It runs in the JTech theme job (JTECH_THEME_SPECS=1). I couldn't run it locally (no Discourse install).pnpm lintis clean in a Codespace on currentmain(4910539): lint:theme (eslint, prettier, stylelint), lint:types, lint:js, lint:prettier, lint:css, lint:scripts, lint:languages, lint:dumbcourse.stree checkandrubocopare clean on the spec.Checklist
pnpm lintis cleanbundle exec rubocopis cleanconfig/locales/server.en.ymlorclient.en.yml