Merged
Conversation
…ring feat: update API documentation to reflect changes in milestone representation feat: add comparable version utility functions for version validation and extraction refactor: update project API to use projectKey instead of id for consistency feat: implement scrollToPageTop utility function for smooth scrolling refactor: modify version API types to use boolean for milestone status and add platform support chore: add sonner library for notifications in package.json
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands backend + web functionality around versioning/announcements/admin dashboards: it refactors “milestone” to a boolean marker, adds multi-platform targeting (versions + announcements), adds announcement visibility filtering for public APIs, and migrates admin UX feedback from inline messages to toast + dialog-based editing.
Changes:
- Refactor versions:
milestone(string) →is_milestone(boolean), requirecomparable_version, and addplatformsarray support end-to-end (DB/schema, services, OpenAPI, web types/tests). - Announcements: add
is_hidden+platformstargeting, filter hidden announcements from public endpoints, and supportplatformquery filtering (backend + OpenAPI + web). - Admin UI: switch multiple dashboards to toast notifications (sonner) and modal editing dialogs; standardize project selection by
project_keyinstead ofid.
Reviewed changes
Copilot reviewed 57 out of 60 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web/package.json | Add sonner dependency for toast notifications. |
| web/lib/versions-api.ts | Update web API types for milestone boolean, required comparable_version, and platforms array. |
| web/lib/scroll.ts | Add helper to scroll smoothly to page top (used by dashboards). |
| web/lib/projects-api.ts | Switch update/delete project endpoints to use projectKey in path. |
| web/lib/comparable-version.ts | Add client-side comparable_version validation + extraction helper. |
| web/lib/api-docs/registry.ts | Update API docs seeds/examples for new fields and platform filtering. |
| web/lib/announcements-api.ts | Extend announcement types with is_hidden and platforms. |
| web/components/versions/versions-dashboard.test.tsx | Update tests for new project key semantics + toast notifications + checkVersionUpdate mocking. |
| web/components/projects/projects-dashboard.tsx | Refactor project UI: create-only main form + edit dialog, toast feedback, comparable range validation. |
| web/components/projects/projects-dashboard.test.tsx | Add tests for scroll-to-top and comparable range validation behavior. |
| web/components/projects/project-showcase-view.tsx | Render milestone as a boolean badge (milestone) instead of string label. |
| web/components/logs/logs-dashboard.tsx | Use project_key for selected project resolution instead of id. |
| web/components/feedbacks/feedbacks-dashboard.tsx | Move editing to dialog + toast feedback; switch project selection to project_key. |
| web/components/announcements/announcements-dashboard.tsx | Add hidden/platform fields; create vs edit separation with dialog; toast feedback. |
| web/components/admin/project-selector-card.tsx | Selector values/keys now use project_key. |
| web/components/actions/actions-dashboard.tsx | Switch to toast feedback + edit dialog; keep create form separate. |
| web/app/layout.tsx | Add shared Toaster provider to render sonner toasts. |
| web/app/admin/about/page.tsx | Update milestone display to boolean (“是/否”). |
| verhub.openapi.yaml | Update OpenAPI for projectKey path param, announcement platform query, versions milestone/platforms, and required comparable_version. |
| skills-lock.json | Add shadcn skill lock metadata. |
| pnpm-lock.yaml | Lockfile updates for sonner. |
| packages/ui/src/components/sonner.tsx | Add themed Toaster wrapper component for shared UI package. |
| packages/ui/src/components/dialog.tsx | Add shared Dialog components for UI package. |
| packages/ui/package.json | Add sonner dependency to shared UI package. |
| packages/backend/src/versions/versions.service.ts | Implement milestone boolean + platforms array mapping; adjust update-check milestone logic. |
| packages/backend/src/versions/versions.service.spec.ts | Update tests + add new cases around deprecated/milestone update-check behavior. |
| packages/backend/src/versions/dto/create-version.dto.ts | Require comparable_version + validate format; add platforms + is_milestone. |
| packages/backend/src/versions/dto/check-version-update.dto.ts | Validate current_comparable_version format. |
| packages/backend/src/projects/projects.service.ts | Fix comparable range validation using comparator; validate partial updates against persisted values. |
| packages/backend/src/projects/projects.service.spec.ts | Add partial-update validation test for comparable ranges. |
| packages/backend/src/projects/dto/create-project.dto.ts | Add comparable range format validation. |
| packages/backend/src/announcements/dto/query-announcements.dto.ts | Add platform query param validation/normalization. |
| packages/backend/src/announcements/dto/create-announcement.dto.ts | Add is_hidden + platforms validation. |
| packages/backend/src/announcements/announcements.service.ts | Add hidden/platform targeting; filter hidden in public list/latest and support platform query. |
| packages/backend/src/announcements/announcements.service.spec.ts | Add tests for hidden/platform filtering (note: one test has timestamp unit inconsistency). |
| packages/backend/src/announcements/announcements-public.controller.ts | Pass query DTO to latest endpoint for platform filtering. |
| packages/backend/prisma/schema.prisma | Add Version.isMilestone + Version.platforms[]; add Announcement.isHidden + Announcement.platforms[]. |
| packages/backend/prisma/migrations/20260323193000_versions_platforms_array/migration.sql | Add Version.platforms[] and backfill from Version.platform. |
| packages/backend/prisma/migrations/20260323164000_announcements_visibility_platforms/migration.sql | Add Announcement.isHidden + platforms[] + index for public queries. |
| packages/backend/prisma/migrations/20260323103000_milestone_boolean_refactor/migration.sql | Backfill and migrate Version.milestone → Version.isMilestone boolean. |
| doc/index.md | Update hero logo configuration. |
| doc/guide/user-guide.md | Update docs for is_milestone semantics. |
| doc/guide/update-policy.md | Update milestone docs to boolean marker guidance. |
| doc/.vitepress/config.ts | Update nav/footer licensing text. |
| README.md | Update README milestone field name. |
| ARCHITECTURE.md | Update architecture docs for isMilestone naming/meaning. |
| .agents/skills/shadcn/** | Add shadcn skill documentation/assets for agent tooling. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/backend/src/announcements/announcements.service.spec.ts:41
- This test mixes milliseconds and seconds for timestamps.
publishedAt/createdAt/updatedAtare set to millisecond values (e.g.1774080000000), while other announcement tests and the service (nowSeconds()) use Unix seconds. Using ms here can mask real bugs and would produce far-future dates if it ever leaked into runtime data. Please update the test data to consistently use seconds (e.g.Math.floor(date.getTime() / 1000)) and adjust expectations accordingly.
publishedAt: 1774080000000,
createdAt: 1774076400000,
updatedAt: 1774078200000,
})
const service = new AnnouncementsService(prisma as never)
const publishedAt = new Date("2026-03-21T08:00:00.000Z").getTime()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.