Repository navigation
feat(quests): highlight bonus reward quests - #7465
Conversation
Quests with a reward multiplier above 1 get a glow on the quest card and a badge like "2x XP" in the quest card and the compact sidebar list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
capJavert
left a comment
There was a problem hiding this comment.
Two non-blocking findings inline, both about the badge advertising rewards the quest card doesn't show. Checked: shadow-bubble-cheese, rounded-6, typo-caption2 all exist in the Tailwind config; QuestRewardType values match the GraphQL field names; deploy order (daily-api#4671 first) is stated in the description.
Reviewed by AI.
| export const getQuestBonusRewards = ( | ||
| quest: UserQuest, | ||
| ): { type: QuestRewardType; multiplier: number }[] => | ||
| Object.values(QuestRewardType).flatMap((type) => { |
There was a problem hiding this comment.
This iterates every QuestRewardType, but in daily-api#4671 getQuestRewardMultipliers returns all three multipliers straight from remoteConfig.questBonusReward.multipliers, whatever rewards the quest actually has. If the config is { xp: 2, cores: 3 } and the quest pays only XP, the badge reads "2x XP · 3x Cores" on a quest that pays no Cores.
Suggest deriving the bonus types from quest.rewards instead (e.g. quest.rewards.filter((r) => (quest.rewardMultipliers?.[r.type] ?? 1) > 1)), so the badge only lists rewards the user will get. Alternatively, the API could return 1 for types missing from the quest's rewards.
Reviewed by AI.
There was a problem hiding this comment.
Fixed on both sides. daily-api#4671 (f16b0e541) now returns 1 in rewardMultipliers for reward types the quest doesn't pay, and in cfef6a2 getQuestBonusRewards only looks at the quest's rewards, so the badge can't list a type the quest has no reward for.
| <article | ||
| className={classNames( | ||
| 'relative overflow-hidden rounded-12 border p-2', | ||
| hasQuestBonusReward(quest) && !isClaimed |
There was a problem hiding this comment.
The card hides XP chips when showLevelSystem is false (getVisibleQuestRewards), but the bonus check and <QuestBonusRewardBadge> (line 255) use the unfiltered quest. For a user with the level system off, an XP-only bonus quest still gets the cheese border and a "2x XP" badge, with no XP reward on the card.
Suggest passing visibleRewards (or showLevelSystem) into the bonus helpers and the badge, so the highlight matches what's displayed. Small related nit: the border is gated on !isClaimed but the badge isn't, so claimed quests keep the badge. If that's intended (it shows what was earned), fine. If not, gate both the same way. The multiplier is also read live from remote config, so a claimed quest could show a different multiplier than the one it paid out.
Reviewed by AI.
There was a problem hiding this comment.
Fixed in cfef6a2. QuestCard passes visibleRewards to the bonus check and the badge, so an XP-only bonus isn't highlighted when the level system is off. The badge is now hidden on claimed quests in both the card and the compact list, matching the border, which also avoids showing a live multiplier after the claim.
The bonus badge and glow only count reward types the card shows, so XP bonuses aren't highlighted when the level system is off, and claimed quests no longer show the badge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Shows which daily and weekly quests have bonus rewards.
rewardMultipliers { xp reputation cores }.QuestCardgets a cheese accent border withshadow-bubble-cheesewhile a bonus quest is unclaimed.QuestBonusRewardBadgeshows each boosted type, such as "2x XP" or "2x XP · 3x Cores". It's used inQuestCardand in theCompactQuestListsidebar row.getQuestRewardLabelmoved fromQuestCardtographql/quests.tsso the card and the badge can share it.The reward amounts already come back multiplied from the API, so the reward chips need no change.
Depends on
dailydotdev/daily-api#4671 must be deployed first. These queries select
rewardMultipliers, which doesn't exist before it.🤖 Generated with Claude Code
Preview domain
https://quest-bonus-rewards.preview.app.daily.dev