Tag Filter - #295
Conversation
Dokploy Preview Deployment
|
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe change centralizes bilingual tag names, normalizes Pretalx language values, appends language and difficulty tags to session summaries, and localizes session filter labels. ChangesSession tag localization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Pretalx
participant buildSessionSummary
participant parseLanguage
participant parseTags
participant SessionFilter
Pretalx->>buildSessionSummary: session answers and tag IDs
buildSessionSummary->>parseLanguage: raw language
parseLanguage-->>buildSessionSummary: canonical language
buildSessionSummary->>parseTags: tag IDs plus language and difficulty
parseTags-->>buildSessionSummary: normalized session tags
buildSessionSummary->>SessionFilter: session summary
SessionFilter->>SessionFilter: localize type and tag labels
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
95075d6 to
3c431a9
Compare
There was a problem hiding this comment.
Pull request overview
Adds localized, user-friendly “tag filter” labels for sessions by centralizing tag display names and appending normalized language/difficulty into each session’s tag list, so the UI can render consistent multi-lingual filter options.
Changes:
- Introduces shared
TAG_NAMESmapping for language + difficulty labels and uses it in both the app session filter and OPass tag generation. - Appends normalized difficulty + language into
SessionSummary.tagsvia updated pretalx parsing (parseTags, newparseLanguage). - Updates the session filter composable to render tag labels in the current locale.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/utils/session.ts | Adds centralized TAG_NAMES mapping for multi-lingual tag labels. |
| server/utils/pretalx/sessions.ts | Appends normalized difficulty + language into session tags and normalizes language. |
| server/utils/pretalx/parser.ts | Generalizes parseTags to accept appended tags and adds parseLanguage. |
| server/utils/opass/tags.ts | Reuses shared TAG_NAMES for OPass tag dictionary labels. |
| app/composables/useSessionFilter.ts | Uses TAG_NAMES to display localized tag labels in filter options. |
Comments suppressed due to low confidence (1)
server/utils/pretalx/parser.ts:165
parseLanguage()lowercases the input but compares against mixed-case strings (e.g.Mandarin), so some values will never match. It also has a duplicatelang === 'chinese'check, making the laterChinesebranch unreachable. This will incorrectly normalize some languages and affect bothSessionSummary.languageand the appended language tag.
export function parseLanguage(language: string | undefined): string | undefined {
if (!language) {
return undefined
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // 各通用鍵(語言 + 難度)的多語顯示名稱(沿用 2025 tagTranslations)。 | ||
| export const TAG_NAMES: Record<string, { zh: string, en: string }> = { | ||
| 'zh-tw': { zh: '漢語', en: 'Mandarin' }, | ||
| 'en': { zh: '英語', en: 'English' }, | ||
| 'ja-JP': { zh: '日本語', en: '日本語' }, | ||
| 'others': { zh: '其他', en: '其他' }, | ||
| 'Elementary': { zh: '入門', en: 'Elementary' }, | ||
| 'Intermediate': { zh: '中階', en: 'Intermediate' }, | ||
| 'Advanced': { zh: '進階', en: 'Advanced' }, | ||
| 'Professional': { zh: '專業', en: 'Professional' }, | ||
| 'Chinese': { zh: '中國語', en: 'Chinese' }, | ||
| 'English': { zh: '英語', en: 'English' }, | ||
| 'Japanese': { zh: '日本語', en: '日本語' }, | ||
| 'Mandarin': { zh: '中文', en: 'Mandarin' }, | ||
| 'Taiwanese': { zh: '台語', en: '台語' }, | ||
| } |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/utils/pretalx/parser.ts`:
- Around line 161-184: Fix the conditional mappings in parseLanguage after
lowercasing: use lowercase comparisons consistently, including the Mandarin
alias, and ensure Chinese inputs map to “Chinese” rather than being captured by
the Mandarin branch. Preserve the existing English and Japanese mappings and the
“others” fallback.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6703f299-7b27-40ca-b906-e97f41ff4ac2
📒 Files selected for processing (5)
app/composables/useSessionFilter.tsserver/utils/opass/tags.tsserver/utils/pretalx/parser.tsserver/utils/pretalx/sessions.tsshared/utils/session.ts
Summary by CodeRabbit
New Features
Bug Fixes