Repository navigation
Conversation
Daily and weekly quests with a refreshCost get a Swap action: in the sidebar it replaces the rewards line on hover, and in the quest dropdown it is a button on the card. Both open a Cores confirmation (a drawer on mobile) that swaps the quest, or sends users without enough Cores to the Cores page. 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.
No blockers, 3 non-blocking. I checked the API side together with daily-api#4672: when questRefresh isn't set in remote config (or is 0), refreshCost comes back null. Every entry point here (CompactQuestRow, QuestCard, QuestRefreshModal, useRefreshQuest) requires a number, so no Swap UI renders. Deploy order as stated: the API first, because these queries select refreshCost.
Reviewed by AI.
| variant={ButtonVariant.Tertiary} | ||
| icon={<RefreshIcon />} | ||
| onClick={() => onRefresh?.(quest)} | ||
| className="relative z-1 -my-1 !hidden group-focus-within/quest:!flex group-hover/quest:!flex" |
There was a problem hiding this comment.
Non-blocking: this Swap only appears on hover or focus-within. On touch devices (tablet sidebar, the streak widget) nothing hovers, and the row is a stretched link, so the button can't be reached. Worse, on iOS a tap that changes content on :hover gets swallowed: the first tap reveals Swap, and it takes a second tap to open the quest (same failure as #6893). Please gate the reveal behind the mouse: variant and decide what touch gets: always show Swap, or leave it to the quest dropdown.
Reviewed by AI.
| onUnlock, | ||
| onRefresh, | ||
| }: CompactQuestRowProps): ReactElement => { | ||
| const canRefresh = typeof quest.refreshCost === 'number' && !!onRefresh; |
There was a problem hiding this comment.
Non-blocking: hiding Swap when refreshCost is null or missing is the whole kill switch for this feature, because it's how the UI stays off until questRefresh is set in the API remote config. Please add a spec (here and/or QuestCard) that renders a quest with refreshCost: null and with the field absent, and asserts there's no Swap button. That keeps a later refactor from showing the UI while the config is off.
Reviewed by AI.
| }); | ||
| } | ||
| }, | ||
| onError: async (error: ApiErrorResult, { quest }) => { |
There was a problem hiding this comment.
Non-blocking: on a non-balance error (swapping turned off in remote config after the dashboard loaded, "No other quests available", quest no longer in progress), the toast shows and the modal closes, but the cached dashboard still holds the old refreshCost. Swap stays visible and fails again on every try until the next refetch. Please invalidate the QuestDashboard query here.
Reviewed by AI.
Summary
Lets users swap a daily or weekly quest for a different one by paying Cores.
CompactQuestRow): on hover or keyboard focus, the rewards line is replaced by a Swap button. It only shows when the quest has arefreshCost.QuestCardviaQuestSection): a Swap button on cards with arefreshCost.QuestRefreshModal(LazyModal.QuestRefresh, a drawer on mobile): Cores confirmation with "Swap for ◆ N" andCoresBalanceNote./coreswithorigin=quest refresh.useRefreshQuesthook:refreshQuestmutation and writes the returned quests into the dashboard cache;useTransactionError.useOpenQuestRefreshhook: logs and opens the modal.refreshCost;QUEST_ACTION_PAYLOAD_FIELDS).open quest refresh,cancel quest refresh,refresh quest(withnewQuestId) andrefresh quest error;target_idisquest sidebarorquest dropdown;extraholdsquestId,questType,userQuestId,rotationIdandcost.Origin.QuestRefreshfor the Cores page.Depends on
dailydotdev/daily-api#4672 must be deployed first. These queries select
refreshCostand callrefreshQuest, which don't exist before it.🤖 Generated with Claude Code
Preview domain
https://quest-refresh.preview.app.daily.dev