Skip to content

Fix achievement badge rendering in game-stats.njk#523

Closed
jbampton with Copilot wants to merge 20 commits into
mainfrom
copilot/fix-achievement-badge-logic
Closed

Fix achievement badge rendering in game-stats.njk#523
jbampton with Copilot wants to merge 20 commits into
mainfrom
copilot/fix-achievement-badge-logic

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The achievement badge strip in src/_includes/game-stats.njk could remain visible on desktop even when no badges were earned because sm:flex overrode hidden. This update makes badge visibility responsive to actual badge state and aligns the badge-rendering block with the file’s existing formatting conventions.

  • Badge visibility

    • Remove static sm:flex from #achievement-badges
    • Toggle sm:flex dynamically only when at least one badge is present
    • Preserve the intended behavior: hidden on mobile, visible as a flex row on larger screens when badges exist
  • Render lifecycle

    • Clear the badge container before re-rendering
    • Track rendered badge count while iterating stored achievements
    • Use the rendered count as the single source of truth for container visibility
  • Template consistency

    • Normalize the updated badge-rendering lines to the file’s 2-space indentation standard
badgeContainer.innerHTML = "";
var badgeCount = 0;

Object.keys(icons).forEach(function (id) {
  if (earned[id]) {
    var badge = document.createElement("span");
    badge.title = labels[id];
    badge.className = "text-sm cursor-help";
    badge.textContent = icons[id];
    badgeContainer.appendChild(badge);
    badgeCount += 1;
  }
});

badgeContainer.classList.toggle("sm:flex", badgeCount > 0);

Copilot AI changed the title [WIP] Fix inconsistent indentation and visibility bug for game stats Fix achievement badges visibility on desktop in game-stats.njk Jun 11, 2026
Copilot AI requested a review from jbampton June 11, 2026 23:43
dependabot Bot and others added 15 commits June 13, 2026 05:48
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.28.0 to 0.28.1.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.28.0...v0.28.1)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.28.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the uv-dependencies group with 1 update: [prek](https://github.com/j178/prek).


Updates `prek` from 0.4.3 to 0.4.4
- [Release notes](https://github.com/j178/prek/releases)
- [Changelog](https://github.com/j178/prek/blob/master/CHANGELOG.md)
- [Commits](j178/prek@v0.4.3...v0.4.4)

---
updated-dependencies:
- dependency-name: prek
  dependency-version: 0.4.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: uv-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the npm-dependencies group with 1 update: [enhanced-resolve](https://github.com/webpack/enhanced-resolve).


Updates `enhanced-resolve` from 5.22.2 to 5.23.0
- [Release notes](https://github.com/webpack/enhanced-resolve/releases)
- [Changelog](https://github.com/webpack/enhanced-resolve/blob/main/CHANGELOG.md)
- [Commits](webpack/enhanced-resolve@v5.22.2...v5.23.0)

---
updated-dependencies:
- dependency-name: enhanced-resolve
  dependency-version: 5.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the npm-dependencies group with 1 update: [enhanced-resolve](https://github.com/webpack/enhanced-resolve).


Updates `enhanced-resolve` from 5.23.0 to 5.24.0
- [Release notes](https://github.com/webpack/enhanced-resolve/releases)
- [Changelog](https://github.com/webpack/enhanced-resolve/blob/main/CHANGELOG.md)
- [Commits](webpack/enhanced-resolve@v5.23.0...v5.24.0)

---
updated-dependencies:
- dependency-name: enhanced-resolve
  dependency-version: 5.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ws](https://github.com/websockets/ws) from 8.20.1 to 8.21.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](websockets/ws@8.20.1...8.21.0)

---
updated-dependencies:
- dependency-name: ws
  dependency-version: 8.21.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…oup (#529)

Bumps the pre-commit-hooks group with 1 update: [https://github.com/biomejs/pre-commit](https://github.com/biomejs/pre-commit).


Updates `https://github.com/biomejs/pre-commit` from v2.4.16 to 2.5.0
- [Release notes](https://github.com/biomejs/pre-commit/releases)
- [Commits](biomejs/pre-commit@v2.4.16...v2.5.0)

---
updated-dependencies:
- dependency-name: https://github.com/biomejs/pre-commit
  dependency-version: 2.5.0
  dependency-type: direct:production
  dependency-group: pre-commit-hooks
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the npm-dependencies group with 2 updates: [@tailwindcss/postcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss) and [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss).


Updates `@tailwindcss/postcss` from 4.3.0 to 4.3.1
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.1/packages/@tailwindcss-postcss)

Updates `tailwindcss` from 4.3.0 to 4.3.1
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.1/packages/tailwindcss)

---
updated-dependencies:
- dependency-name: "@tailwindcss/postcss"
  dependency-version: 4.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: tailwindcss
  dependency-version: 4.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the github-actions-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@df4cb1c...9c091bb)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the github-actions-dependencies group with 2 updates: [FirebaseExtended/action-hosting-deploy](https://github.com/firebaseextended/action-hosting-deploy) and [super-linter/super-linter](https://github.com/super-linter/super-linter).


Updates `FirebaseExtended/action-hosting-deploy` from 0.10.0 to 0.11.0
- [Release notes](https://github.com/firebaseextended/action-hosting-deploy/releases)
- [Commits](FirebaseExtended/action-hosting-deploy@e2eda2e...500ac62)

Updates `super-linter/super-linter` from 8.6.0 to 8.7.0
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](super-linter/super-linter@9e86335...4ce2083)

---
updated-dependencies:
- dependency-name: FirebaseExtended/action-hosting-deploy
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
- dependency-name: super-linter/super-linter
  dependency-version: 8.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Stop Firebase from trying to deploy on forks
Bumps the uv-dependencies group with 1 update: [prek](https://github.com/j178/prek).


Updates `prek` from 0.4.4 to 0.4.5
- [Release notes](https://github.com/j178/prek/releases)
- [Changelog](https://github.com/j178/prek/blob/master/CHANGELOG.md)
- [Commits](j178/prek@v0.4.4...v0.4.5)

---
updated-dependencies:
- dependency-name: prek
  dependency-version: 0.4.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: uv-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the pre-commit-hooks group with 1 update: [https://github.com/zizmorcore/zizmor-pre-commit](https://github.com/zizmorcore/zizmor-pre-commit).


Updates `https://github.com/zizmorcore/zizmor-pre-commit` from v1.25.2 to 1.26.1
- [Release notes](https://github.com/zizmorcore/zizmor-pre-commit/releases)
- [Commits](zizmorcore/zizmor-pre-commit@9257c60...e3eebf6)

---
updated-dependencies:
- dependency-name: https://github.com/zizmorcore/zizmor-pre-commit
  dependency-version: 1.26.1
  dependency-type: direct:production
  dependency-group: pre-commit-hooks
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Seyyed Ali Mohammadiyeh (Max Base) <MaxBaseCode@Gmail.Com>
Copilot AI changed the title Fix achievement badges visibility on desktop in game-stats.njk Fix achievement badge rendering in game-stats.njk Jun 28, 2026
@jbampton jbampton closed this Jul 18, 2026
@github-project-automation github-project-automation Bot moved this to Done in Next Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

AI feedback regarding src/_includes/game-stats.njk

2 participants