Vote Rewards: 2-col tab layout + dedup (supersedes #52)#53
Merged
Conversation
PR #50 prevented new duplicates forming (the Newtonsoft-append bug), but admins whose state was poisoned while that bug was active still carry the doubled list in their persisted JSON. Symptoms after loading: - /vote prints "<key>: provider disabled" + "<displayname>: granted ..." side by side because the foreach iterates both entries - Settings tab shows two provider blocks; Vue's v-for warns about duplicate :key values and the diffing reconciles unpredictably Two-part fix: 1. EnsureDefaultProviders now deduplicates by Key on every load. The entry with the strongest "configured" signal wins (enabled+apiKey > enabled > apiKey > anything else), so a real config never gets displaced by an empty stub. Logs a one-line note when it dropped any rows so admins can see it ran. 2. SettingsView.vue's v-for key is now `${provider.key}-${idx}` so duplicate provider keys can't collide in Vue's diffing. Defense in depth — the backend dedup means duplicates shouldn't reach the UI anymore, but the v-for shouldn't be the thing that breaks if they do. Self-heals existing poisoned state on the next server boot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Vote Rewards tab was rendering everything in a single column inside the left half of the available width — large empty space sat to the right. Mirrors the Discord tab pattern: a 2-col grid at the tab level, with the configuration cards (master toggle, providers, save) on the left and the audit feed on the right. Grid is 3fr / 2fr because the provider config card is wider than the audit table needs. Collapses to single column at <=1100px (earlier than the 768px tablet breakpoint) since the 3:2 split gets cramped on narrow-desktop screens before mobile. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Two changes bundled. Supersedes #52 — close that one, merge this instead.
1. 2-col tab layout (the new bit)
Vote Rewards tab was rendering everything in a single column on the left half of the screen, leaving a huge empty area on the right. Mirrored the Discord tab pattern:
Picked 3:2 instead of 1:1 because the provider config card has more density (its own 2-col grid inside) and the audit table is naturally narrower. Collapses to single col at <=1100px (earlier than the 768px tablet breakpoint) since the split gets cramped on smaller laptops before mobile.
2. Dedupe provider list on load (carried from #52)
PR #50 prevented new duplicates forming, but admins whose state was already poisoned still carry the doubled list in their persisted JSON. `EnsureDefaultProviders` now dedups by Key with a configured-priority tiebreaker (`enabled+apiKey > enabled > apiKey > anything`). Logs once when it dropped any rows. Self-heals on the next boot. The Vue `:key` is also `${provider.key}-${idx}` now as defense in depth.
(Already verified working on Ada's WSL test box — boot log:
`VoteRewards: deduped 1 duplicate provider entry/entries on load.`)
Files
Test plan
🤖 Generated with Claude Code