Skip to content

Add local player reputation (inline + profile card)#11

Open
RsNest wants to merge 1 commit intoFaceit-Forecast:masterfrom
RsNest:feature-reputation
Open

Add local player reputation (inline + profile card)#11
RsNest wants to merge 1 commit intoFaceit-Forecast:masterfrom
RsNest:feature-reputation

Conversation

@RsNest
Copy link

@RsNest RsNest commented Feb 9, 2026

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
photo_2026-02-09_16-39-42

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