Skip to content

Add streak to shareable results string - #6

Draft
NicolasWinsten with Copilot wants to merge 2 commits into
masterfrom
copilot/add-active-streak-sharing
Draft

Add streak to shareable results string#6
NicolasWinsten with Copilot wants to merge 2 commits into
masterfrom
copilot/add-active-streak-sharing

Conversation

Copilot AI commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

When users share their game results via the webshare API, their active streak is now included in the output string.

Changes

  • Modified makeShareableResultString to accept optional streak parameter
  • Updated share button to pass streakData?.streak from existing state
  • Streak line (🔥 X day streak!) appends only when streak > 0

Example Output

Before (no streak shown):

My Daily Zimi
Fri Jan 24 2026
🟩🟩🟩🟩
🟩🟩🟩🟩

 00:39:230

After (with 5-day streak):

My Daily Zimi
Fri Jan 24 2026
🟩🟩🟩🟩
🟩🟩🟩🟩

 00:39:230
🔥 5 day streak!

Implementation

const makeShareableResultString = (gameState, milliseconds, dateSeed, streak = null) => {
  // ... existing time and grid formatting
  const streakLine = (streak !== null && streak > 0) ? `🔥 ${streak} day streak!\n` : '';
  return `My Daily Zimi\n${date.toDateString()}\n${grid}\n${timeStr}\n${streakLine}`
}

// In share button onClick
text: makeShareableResultString(currentGameState, timerTotalMilliseconds(stopWatch), dateSeed, streakData?.streak)

Unauthenticated users and users with zero streak see no change.

Original prompt

If the user has an active streak, add it to the shareable string that is used with the webshare api


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Jan 24, 2026

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
zimi Ready Ready Preview, Comment Jan 24, 2026 1:38am

Co-authored-by: NicolasWinsten <56099103+NicolasWinsten@users.noreply.github.com>
Copilot AI changed the title [WIP] Add active streak to shareable string for webshare API Add streak to shareable results string Jan 24, 2026
Copilot AI requested a review from NicolasWinsten January 24, 2026 01: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.

2 participants