Skip to content

feat(quests): highlight bonus reward quests - #7465

Merged
capJavert merged 2 commits into
mainfrom
quest-bonus-rewards
Nov 20, 2026
Merged

capJavert merged 2 commits into
mainfrom
quest-bonus-rewards

Conversation

@capJavert

@capJavert capJavert commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Shows which daily and weekly quests have bonus rewards.

  • The daily and weekly quest queries select the new rewardMultipliers { xp reputation cores }.
  • QuestCard gets a cheese accent border with shadow-bubble-cheese while a bonus quest is unclaimed.
  • New QuestBonusRewardBadge shows each boosted type, such as "2x XP" or "2x XP · 3x Cores". It's used in QuestCard and in the CompactQuestList sidebar row.
  • The badge and glow only count rewards the card shows (XP is hidden when the level system is off), and both are hidden once the quest is claimed.
  • getQuestRewardLabel moved from QuestCard to graphql/quests.ts so 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

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>
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-webapp Ready Ready Preview Nov 20, 2026 1:57pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
storybook Ignored Ignored Preview Nov 20, 2026 1:57pm UTC

Request Review

@capJavert capJavert left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/shared/src/graphql/quests.ts Outdated
export const getQuestBonusRewards = (
quest: UserQuest,
): { type: QuestRewardType; multiplier: number }[] =>
Object.values(QuestRewardType).flatMap((type) => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@capJavert
capJavert merged commit 97589ec into main Nov 20, 2026
18 checks passed
@capJavert
capJavert deleted the quest-bonus-rewards branch November 20, 2026 14:07

This branch was successfully deployed

1 active deployment
Preview – daily-webapp — cfef6a26 Deployed Nov 20, 2026 by vercel[bot]
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