-
-
Notifications
You must be signed in to change notification settings - Fork 252
feat(tags): add inactive tag for extensions and apps without updates for 8+ months #1088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds an "inactive" tag to identify extensions and apps that haven't been updated in 8 or more months, helping users identify potentially unmaintained packages.
Key Changes:
- Introduces an
INACTIVE_THRESHOLD_MONTHSconstant (set to 8 months) to define the inactivity period - Implements logic to automatically tag extensions and apps as "inactive" based on their last update date
- Adds styling and localization support for the new "inactive" tag across all supported languages
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/constants.ts |
Adds INACTIVE_THRESHOLD_MONTHS constant to define the 8-month threshold |
src/components/Card/Card.tsx |
Implements logic to check last update date and apply inactive tag to extensions/apps |
src/components/Card/TagsDiv.tsx |
Updates tag mapping, rendering, and sorting to include inactive tag as a priority tag |
src/styles/components/_card.scss |
Adds orange background styling for inactive tag display |
src/resources/locales/*.json |
Adds "inactive" translation across all 19 supported languages (ar, ca, de-DE, en, es, et, fi, fr, it, ja, ko, pl, pt-BR, ru, tr, uk, zh-CN, zh-TW) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds an "inactive" tag: items of type "extension" or "app" with a lastUpdated older than INACTIVE_THRESHOLD_MONTHS (8) and not archived are tagged inactive. UI rendering, tag priority/sorting, translations, and styling were updated to surface the tag. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/Card/Card.tsx (1)
74-79: Inactivity detection logic looks solid.The implementation correctly identifies inactive extensions and apps based on the 8-month threshold. The logic follows the existing pattern for archived and externalJS tags.
Optional: Consider more robust date arithmetic.
The current approach using
setMonth()can have edge cases when dealing with month boundaries (e.g., Jan 31 minus 1 month becomes Mar 2/3 due to February having fewer days). For the 8-month threshold used here, the impact is minimal, but if you want more predictable behavior, consider:🔎 Alternative using date-fns for precise date math
If date-fns is already a project dependency, you could use:
+import { subMonths } from 'date-fns'; + if (!props.item.archived && props.item.lastUpdated && (props.type === "extension" || props.type === "app")) { const lastUpdate = new Date(props.item.lastUpdated); - const threshold = new Date(); - threshold.setMonth(threshold.getMonth() - INACTIVE_THRESHOLD_MONTHS); + const threshold = subMonths(new Date(), INACTIVE_THRESHOLD_MONTHS); if (lastUpdate < threshold) this.tags.push(t("grid.inactive")); }This provides more consistent behavior across month boundaries.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
src/components/Card/Card.tsxsrc/components/Card/TagsDiv.tsxsrc/constants.tssrc/resources/locales/ar.jsonsrc/resources/locales/ca.jsonsrc/resources/locales/de-DE.jsonsrc/resources/locales/en.jsonsrc/resources/locales/es.jsonsrc/resources/locales/et.jsonsrc/resources/locales/fi.jsonsrc/resources/locales/fr.jsonsrc/resources/locales/it.jsonsrc/resources/locales/ja.jsonsrc/resources/locales/ko.jsonsrc/resources/locales/pl.jsonsrc/resources/locales/pt-BR.jsonsrc/resources/locales/ru.jsonsrc/resources/locales/tr.jsonsrc/resources/locales/uk.jsonsrc/resources/locales/zh-CN.jsonsrc/resources/locales/zh-TW.jsonsrc/styles/components/_card.scss
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/Card/Card.tsx (1)
src/constants.ts (1)
INACTIVE_THRESHOLD_MONTHS(43-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Agent
🔇 Additional comments (23)
src/resources/locales/ru.json (1)
97-97: LGTM!The Russian translation for "inactive" is correct and properly placed within the grid section.
src/resources/locales/ar.json (1)
97-97: LGTM!The Arabic translation for "inactive" is correct and consistently placed.
src/resources/locales/fi.json (1)
97-97: LGTM!The Finnish translation for "inactive" is correct and properly placed.
src/resources/locales/es.json (1)
97-97: LGTM!The Spanish translation for "inactive" is correct and consistently placed within the grid section.
src/resources/locales/uk.json (1)
97-97: LGTM!The Ukrainian translation for "inactive" is correct and properly placed.
src/resources/locales/de-DE.json (1)
97-97: LGTM! Translation is correct.The German translation "inaktiv" for the inactive tag is accurate and properly placed within the grid section.
src/resources/locales/et.json (1)
84-84: LGTM! Translation is correct.The Estonian translation "mitteaktiivne" for the inactive tag is accurate and properly positioned within the grid section.
src/resources/locales/tr.json (1)
97-97: LGTM! Translation is correct.The Turkish translation "pasif" for the inactive tag is accurate and consistently placed within the grid section.
src/resources/locales/ca.json (1)
84-84: LGTM! Translation is correct.The Catalan translation "inactiu" for the inactive tag is accurate and properly placed within the grid section.
src/resources/locales/pt-BR.json (1)
97-97: LGTM! Translation is correct.The Brazilian Portuguese translation "inativo" for the inactive tag is accurate and consistently placed within the grid section.
src/constants.ts (1)
42-43: LGTM! Well-documented constant addition.The
INACTIVE_THRESHOLD_MONTHSconstant is clearly documented and follows the existing pattern. An 8-month threshold is a reasonable choice for marking items as inactive.src/resources/locales/zh-TW.json (1)
84-84: LGTM! Translation key added consistently.The
grid.inactivetranslation entry is properly placed and follows the established pattern for grid-related translations.src/resources/locales/ja.json (1)
97-97: LGTM! Consistent translation addition.The
grid.inactivetranslation is properly added and aligns with the feature's internationalization requirements.src/resources/locales/fr.json (1)
84-85: LGTM! Translation additions with bonus fix.Both
grid.archivedandgrid.inactivetranslations are added consistently. The addition of thearchivedtranslation appears to fix a previously missing entry, which is a helpful improvement alongside the main inactive feature.src/resources/locales/ko.json (1)
97-97: LGTM! Translation entry added correctly.The
grid.inactivetranslation follows the established pattern and is properly integrated into the Korean locale.src/resources/locales/zh-CN.json (1)
98-98: LGTM! Translation key added correctly.The "inactive" translation key is properly positioned and the Chinese translation "不活跃" is appropriate for indicating inactive status.
src/styles/components/_card.scss (1)
47-50: LGTM! Styling is appropriate and consistent.The inactive tag styling follows the established pattern for other tags. The orange/amber color (hsl(35deg 90% 50%)) effectively distinguishes inactive items from archived (red) items while conveying a warning/caution state.
src/resources/locales/pl.json (1)
97-97: LGTM! Translation key added correctly.The "inactive" translation key is properly positioned and the Polish translation "nieaktywny" is appropriate for the inactive tag feature.
src/resources/locales/it.json (1)
97-97: LGTM! Translation key added correctly.The "inactive" translation key is properly positioned and the Italian translation "inattivo" is appropriate for indicating inactive status.
src/components/Card/Card.tsx (1)
5-5: LGTM!The import of
INACTIVE_THRESHOLD_MONTHSis clean and correctly integrated with existing imports.src/components/Card/TagsDiv.tsx (3)
13-13: LGTM!The mapping for the inactive tag is correctly added to
englishTagMap, following the established pattern for CSS selector support.
34-34: LGTM!Correctly ensures the inactive tag is always rendered regardless of the
showTagssetting, which is appropriate since inactivity is important information for users. This follows the same pattern asarchivedandexternalJStags.
51-51: LGTM!The sorting logic correctly prioritizes the inactive tag alongside
externalJSandarchivedtags, ensuring important warnings appear first in the tag list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/Card/TagsDiv.tsx (1)
61-63: Bug:extraTagsis sliced from unsortedprops.tagsinstead of sortedbaseTags.Line 62 uses
props.tags.slice(MAX_TAGS), which references the original unsorted array. This breaks the priority sorting—a priority tag (e.g., inactive) positioned afterMAX_TAGSin the original array would end up inextraTagsinstead of being displayed prominently inbaseTags.🔎 Proposed fix
if (baseTags.length - MAX_TAGS > 1) { - extraTags = props.tags.slice(MAX_TAGS); + extraTags = baseTags.slice(MAX_TAGS); baseTags = baseTags.slice(0, MAX_TAGS); }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/components/Card/Card.tsxsrc/components/Card/TagsDiv.tsxsrc/resources/locales/en-US.json
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/Card/Card.tsx
🔇 Additional comments (2)
src/resources/locales/en-US.json (1)
14-16: LGTM!The new localization key for the inactive tag is correctly structured and follows i18next conventions.
src/components/Card/TagsDiv.tsx (1)
51-58: Good fix for tag priority sorting.The
getTagPriorityfunction with distinct priority values (-3, -2, -1) properly addresses the sorting stability concern from the previous review. Priority tags will now have consistent and predictable ordering.
|
I'm going to close it due to "last updated" being actually a last activity on the repo, so if someone will open the issue it will have different date. Second, extension can work and wasn't updated for few months (e.g. adblockify) |
Summary by CodeRabbit
New Features
Localization
✏️ Tip: You can customize this high-level summary in your review settings.