Skip to content

Add EloWard League of Legends Rank Badges Module - #1190

Open
SunnyWang0 wants to merge 31 commits into
SevenTV:masterfrom
EloWard:master
Open

SunnyWang0 wants to merge 31 commits into
SevenTV:masterfrom
EloWard:master

Conversation

@SunnyWang0

Copy link
Copy Markdown

Adds a new module that displays League of Legends rank badges next to usernames in Twitch chat ONLY when watching League streams.

Features

  • Automatically detects League of Legends streams
  • Fetches and displays rank badges (Iron through Challenger) from EloWard API
  • Shows rank details (tier, division, LP) on hover
  • Click badge to open player's OP.GG profile
  • LRU cache with 1-hour TTL for performance
  • Detects and defers to official EloWard Chrome extension when present
  • User setting to enable/disable (on by default)

Implementation

  • New /modules/eloward/ module with composables for game detection and rank fetching
  • Integrated into existing chat UserTag component
  • Zero performance impact when not on League streams
  • Production-ready with proper error handling and cache management

Configuration

Users can toggle the feature via Settings → Appearance → Vanity → "EloWard Rank Badges"

SunnyWang0 and others added 30 commits October 13, 2025 18:10
The merge with upstream kept both `import Badge from "./Badge.vue"` and
upstream's `import Badge, { TwitchChatBadgeWithData } from "./Badge.vue"`,
which fails lint (no-redeclare) and vue-tsc (TS2300).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Theme styles: `:global(.tw-root--theme-*) .x` compiles to a bare
  `.tw-root--theme-*` rule, which applied a brightness/contrast filter (and
  text colors) to the whole Twitch page for every 7TV user. Removed; the
  tooltip already uses Twitch's theme variables.
- Game detection: `watch(() => window.location.pathname)` is not reactive,
  so detection ran once. After in-app navigation from a LoL channel, every
  chatter on the next channel was looked up and badged. Detection now
  re-checks the category link periodically and matches its href slug,
  which also fixes late-rendering headers, mid-stream category changes,
  localized category names (ja/ko), Wild Rift matching as LoL, and
  offline-channel carousel links.
- Skip rank lookups for hidden-badge user tags (@mentions, user card).
- Cache failed lookups so every new message doesn't retry while the API
  is erroring, and encode the username in the request URL.
- Keep upstream's badge list spacing; the `!important` inline-flex rules
  changed badge-to-name spacing for all users.
- Tooltip shows "UNRANKED" instead of "UNRANKED - 0 LP".
- Open OP.GG with noopener,noreferrer.
- Changelog entry moved to a new 3.1.26.1000 heading.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ory changed

The category is now re-checked while a stream is open, so a lookup started
on a League stream can resolve after the streamer switched category (or
after the setting was turned off) and put a badge back on messages that
are already on screen.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous commit removed the per-theme brightness adjustment along
with the broken selector. Put it back with the whole selector inside
:global(), so it applies to .eloward-rank-badge instead of compiling to
a bare .tw-root--theme-* rule that filtered the entire Twitch page.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Match the original selector (.seventv-chat-badge.eloward-rank-badge) so
the filter can't reach a .eloward-rank-badge element injected by the
official EloWard extension, which this module already expects to
coexist with.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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