Skip to content

feat: implement new patch#29

Merged
mehdiasadli merged 1 commit into
mainfrom
v26-04-22
Apr 30, 2026
Merged

feat: implement new patch#29
mehdiasadli merged 1 commit into
mainfrom
v26-04-22

Conversation

@mehdiasadli
Copy link
Copy Markdown
Contributor

@mehdiasadli mehdiasadli commented Apr 30, 2026

Summary by CodeRabbit

  • New Features

    • Added alternate acceptable answers input for questions during topic creation using chip-style UI
    • Displayed total followers and following counts in the users dashboard with new sorting options
    • Improved question display in dashboards with multiline text wrapping for better readability
  • UI/UX

    • Refined form layouts for topic and question creation with optimized spacing and sizing
  • Changes

    • Updated leaderboard ranking logic to assign the same rank to tied scores rather than strictly ordered ranks

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

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

Project Deployment Actions Updated (UTC)
xamsa-web Ready Ready Preview, Comment Apr 30, 2026 5:35am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces support for alternate acceptable answers in question creation, improves dashboard table displays with additional metrics and better text rendering, refactors global leaderboard ranking to handle tied primary metrics, and updates API responses to include follower/following counts and question text details in admin endpoints.

Changes

Cohort / File(s) Summary
Acceptable Answers Component
apps/web/src/components/acceptable-answers-chips.tsx
Adds new AcceptableAnswersChips component with exported constants ACCEPTABLE_ANSWERS_MAX_ITEMS (5) and ACCEPTABLE_ANSWER_MAX_LEN (250). Component manages chip-style UI for alternate answers with draft input, commit on Enter/blur, trimming, validation, and de-duplication.
Form Integrations
apps/web/src/components/create-topic-form.tsx, apps/web/src/components/bulk-create-topics-form.tsx
Wires AcceptableAnswersChips component into question forms. Reduces textarea heights (3 to 2 rows), adjusts spacing (space-y-4 to space-y-3), and updates useEffect dependencies for form reset syncing.
Dashboard Table Displays
apps/web/src/routes/dashboard/questions/index.tsx, apps/web/src/routes/dashboard/clicks/index.tsx, apps/web/src/routes/dashboard/users/index.tsx
Updates question text truncation (2 to 4 lines) with improved wrapping. Adds multiline rendering for clicks table question column (order + text + slug). Adds totalFollowers and totalFollowing columns to users dashboard with sort option labels.
Admin API Service
packages/api/src/modules/admin/service.ts
Extends listAdminUsers to return totalFollowers and totalFollowing fields. Updates listAdminClicks to include question text field alongside existing id, slug, and order.
Global Leaderboard Ranking
packages/api/src/modules/user/global-leaderboard.ts
Replaces offset-based ranking with per-row rank calculation using primary-metric-only comparison. Removes strict tie-breaker logic (peakElo, secondary stats, username). Adds cache-keyed rank grouping via new helper functions primaryStrictlyBetterWhere() and rankPrimaryKey().
Schema Updates
packages/schemas/src/modules/admin.ts, packages/schemas/src/modules/listings/admin.ts
Extends ListAdminUsersItemSchema with totalFollowers and totalFollowing fields. Extends ListAdminClicksItemSchema with question text field. Updates adminUserSort to support followers and following sort options.
Documentation & Release Notes
draft.md, packages/utils/src/app-releases.ts
Adds v26.04.22 roadmap section documenting acceptable answers, compact forms, tied-rank behavior, and dashboard improvements. Updates v26.04.22 release notes with feature highlights and shifts date from 2026-04-29 to 2026-04-30.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related PRs

  • feat: implement new patch #27: Modifies bulk-create-topics-form.tsx in the same PR; involves concurrent refactoring of the question carousel component.
  • feat: implement patch 19 #26: Extends follower/following aggregates (totalFollowers/totalFollowing) in parallel, affecting the same user schema and admin API surface.
  • Fix bugs #11: Modifies global leaderboard logic in global-leaderboard.ts; may have competing or complementary rank eligibility changes.

Suggested labels

size:xl, docs, pkg:api

Poem

🐰 Chips of answers bloom so neat,
Forms grow compact, light and sweet!
Leaderboard ties rank as one,
Tables sparkle—work is done!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive language ('implement new patch') that does not convey meaningful information about the specific changes in the changeset. Consider using a more descriptive title that summarizes the main changes, such as 'feat: add acceptable answers to topic forms and update leaderboard ranking logic'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v26-04-22

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@mehdiasadli mehdiasadli merged commit feef249 into main Apr 30, 2026
4 of 5 checks passed
@mehdiasadli mehdiasadli deleted the v26-04-22 branch April 30, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant