Copilot commented on code in PR #464:
URL: https://github.com/apache/casbin-website/pull/464#discussion_r3087550374
##########
src/theme/Footer/Links/MultiColumn/index.js:
##########
@@ -0,0 +1,93 @@
+import React from "react";
+import clsx from "clsx";
+import {ThemeClassNames} from "@docusaurus/theme-common";
+import LinkItem from "@theme/Footer/LinkItem";
+import FooterMoreBadges from "@site/src/components/FooterMoreBadges";
+
+function getItemKey(item) {
+ return [
+ item.href,
+ item.to,
+ item.label,
+ item.className,
+ item.html,
+ ].filter(Boolean).join("::");
Review Comment:
`getItemKey()` includes `item.html` as part of the React key. In this repo,
many footer items are large multi-line HTML strings (e.g., the Community
links), so this makes keys very large and sensitive to whitespace changes,
which can hurt reconciliation/perf and cause unnecessary re-mounts. Prefer a
smaller stable identifier (e.g., `href`/`to`/`label`, and only fall back to an
explicit `id` field or a short hash).
##########
src/components/FooterMoreBadges/styles.module.css:
##########
@@ -0,0 +1,47 @@
+.badgesGrid {
+ display: grid;
+ grid-template-columns: repeat(2, max-content);
+ gap: 0.5rem 1rem;
+ justify-content: start;
+}
+
+.badgeLink {
+ display: inline-flex;
+ line-height: 0;
+ transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
+}
Review Comment:
The new badge hover/active transitions add motion, but there’s no
`prefers-reduced-motion: reduce` override here. Other animated components in
this repo disable animations under reduced-motion, so this should also disable
transitions/transforms for users who prefer reduced motion.
##########
.github/workflows/master.yml:
##########
@@ -48,6 +48,9 @@ jobs:
if: github.event_name != 'pull_request'
run: yarn crowdin:sync
+ - name: Generate footer stars
Review Comment:
The star-generation script supports authenticated GitHub API requests via
`process.env.GITHUB_TOKEN`, but this workflow step doesn’t set it. Without a
token, GitHub REST calls are more likely to be rate-limited, and the script
will often fall back to the existing `stars.json` (so stars won’t update).
Consider setting `env: { GITHUB_TOKEN: ${{ github.token }} }` (or `${{
secrets.GITHUB_TOKEN }}`) on this step.
##########
.github/workflows/pr_ci.yml:
##########
@@ -22,5 +22,8 @@ jobs:
- name: Install dependencies
run: yarn install
+ - name: Generate footer stars
Review Comment:
The star-generation script supports authenticated GitHub API requests via
`process.env.GITHUB_TOKEN`, but this workflow step doesn’t set it. Without a
token, GitHub REST calls are much more likely to be rate-limited, and the
script will frequently fall back to the committed `stars.json` (meaning stars
won’t actually update). Consider setting `env: { GITHUB_TOKEN: ${{ github.token
}} }` (or `${{ secrets.GITHUB_TOKEN }}`) on this step.
##########
docusaurus.config.js:
##########
@@ -234,72 +234,8 @@ module.exports = {
},
{
title: "More",
- items: [
- {
- html: `
- <a href="https://github.com/casbin/casbin" target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/casbin?label=Casbin&style=social">
- </a>
-
- <a href="https://github.com/casbin/jcasbin" target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/jcasbin?label=jCasbin&style=social">
- </a>
- `,
- },
- {
- html: `
- <a href="https://github.com/casbin/node-casbin"
target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/node-casbin?label=Node-Casbin&style=social">
- </a>
-
- <a href="https://github.com/php-casbin/php-casbin"
target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/php-casbin/php-casbin?label=PHP-Casbin&style=social">
- </a>
- `,
- },
- {
- html: `
- <a href="https://github.com/casbin/pycasbin" target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/pycasbin?label=PyCasbin&style=social">
- </a>
-
- <a href="https://github.com/casbin/Casbin.NET" target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/Casbin.NET?label=Casbin.NET&style=social">
- </a>
- `,
- },
- {
- html: `
- <a href="https://github.com/casbin/casbin-cpp" target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/casbin-cpp?label=Casbin-CPP&style=social">
- </a>
-
- <a href="https://github.com/casbin/casbin-rs" target="_blank">
- <img alt="GitHub Repo stars"
src="https://img.shields.io/github/stars/casbin/casbin-rs?label=Casbin-RS&style=social">
- </a>
- `,
- },
- {
- html: `
- <a href="https://twitter.com/casbinHQ" target="_blank">
- <img alt="Twitter Follow"
src="https://img.shields.io/twitter/follow/casbinHQ?style=social">
- </a>
- `,
- },
- {
- html: `
-<script>
-var _hmt = _hmt || [];
-(function() {
- var hm = document.createElement("script");
- hm.src = "https://hm.baidu.com/hm.js?2c0ffc6f8d49e98d964d59d7aa4cbf34";
- var s = document.getElementsByTagName("script")[0];
- s.parentNode.insertBefore(hm, s);
-})();
-</script>
-`,
- },
- ],
+ className: "footer-more-column",
+ items: [],
},
Review Comment:
This replaces the previous HTML items under the "More" footer column,
including removal of the embedded Baidu analytics `<script>` that used to be
injected via the footer config. If that tracking script is still required, it
should be relocated to a supported script mechanism (e.g., `scripts`/plugin)
rather than being silently dropped here; otherwise, please confirm the removal
is intentional since it changes production behavior beyond the stated
footer-badge refactor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]