Add local player reputation (inline + profile card)#11
Open
RsNest wants to merge 1 commit intoFaceit-Forecast:masterfrom
Open
Add local player reputation (inline + profile card)#11RsNest wants to merge 1 commit intoFaceit-Forecast:masterfrom
RsNest wants to merge 1 commit intoFaceit-Forecast:masterfrom
Conversation
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.
Implemented a local player reputation feature for Faceit matchrooms.
Reputation is stored locally (chrome.storage.local) as a per-player tag: 👍 Friendly / 👎 Toxic / Neutral.
What’s included
New module
Added src/faceit/reputation/reputation.js
Constants: REPUTATION_TOXIC / REPUTATION_FRIENDLY / REPUTATION_NEUTRAL, storage key
Storage: chrome.storage.local structure { [playerId]: { rating, updatedAt, meetCount? } }
API: getPlayerReputation, setPlayerReputation, getAllReputations, resetPlayerReputation
Templates + styles
Updated src/faceit/resources/templates.js
Added PLAYER_REPUTATION_BADGE_HTML (full block for player card popup)
Added PLAYER_REPUTATION_INLINE_HTML (compact inline buttons for lobby list)
Initialized PLAYER_REPUTATION_BADGE_TEMPLATE and PLAYER_REPUTATION_INLINE_TEMPLATE in initTemplates()
Added styles for inline buttons (20x20, opacity states, active scale, toxic/friendly colors)
Matchroom integration
Updated src/faceit/room/matchroom.js
Kept the existing “full” reputation block inside player card popup (with Reset + Rated timestamp tooltip)
Added inline reputation controls directly in the matchroom player list (both columns), inserted into the NicknameContainer next to the nickname
Uses the same approach as profiles.js: builds nickname → playerId map from matchDetails rosters, then attaches UI per player node
Added duplicate protection via data-processed-reputation and cleanup via removalNode
Button click sets local rating and updates UI instantly; logs for debugging:
console.log('[REPUTATION INLINE]', playerId, nickname, rating)
Manifest update
Updated manifest.json content_scripts to include:
src/faceit/reputation/reputation.js (after integrations.js, before moduleManager.js)
Fixes / adjustments during implementation
Made the lobby selector less brittle so it works for all 5 players per team (not only first 2).
Fixed profiles.js crash “logo is null” by guarding logo.style usage when addFCUserLogoIfRegisteredByNick returns null.
Intentional change: removed “meet count” UX
Previously there was a “Met N×” counter logic; this is a local tag feature, so the UI no longer displays or increments meet count.
meetCount field remains in stored data for backward compatibility, but it is not used in the UI anymore.
How to test
Open a Faceit matchroom lobby: inline 👍/👎 buttons should appear next to each player nickname in both columns.
Clicking buttons marks the player locally and updates the button active state.
Clicking a player still opens the popup card with the full reputation block (Neutral/Reset + Rated tooltip).
Interest / contribution
I’m interested in continuing development of this project and would love to contribute more.
Background: DevOps engineer / VoIP engineer, currently a beginner in full-stack development, but actively growing and ready to help with features, bugfixes, and infrastructure.
Future ideas (optional)
Shared reputation backend so reputation becomes visible across users (not only local):
Store votes / tags (and optional comments) in a shared database (e.g., Postgres) behind a small API service.
The extension would fetch and display aggregated reputation for players in matchroom lobby based on playerId.
This could allow seeing reputation instantly for players you meet, even across different users.
Happy to discuss preferred architecture / privacy / moderation rules (anti-abuse, auth, rate limits) before implementing.
Telegram @nadzerateli
