test #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
1. Executive Summary
This PR focuses on architectural refactoring, internationalization (i18n) migration, and feature enhancements. Key changes include replacing Prettier with
oxfmt, migrating hardcoded UI strings toi18next, extracting reusable components (StatsLine,InfoRow,SocialsRow, etc.), and adding user social link management with Mania key filtering. API hooks have been refactored to returnuseQuery/useMutationobjects directly, aligning with modern TanStack Query patterns. Dependency versions are also bumped across the board.2. Critical Issues (High Priority)
src/components/user/panels/top/UserTopPanel.tsx:modeis passed to<UserGradeChart mode={mode} />but is never destructured fromuseUserContext(). This will throw aReferenceErrorand crash the component.src/components/beatmap/BeatmapsetBeatmapInfo.tsx: TheStatsLinecomponent usesnext || prevfor the progress bar value. In osu!,0is a valid difficulty stat (e.g., AR 0). Using||will incorrectly fallback toprevwhennextis0. Usenext ?? previnstead.src/utils/fetcher.ts:headers["Content-Type"] = "application/json";unconditionally overwrites existing headers. This will break requests that requiremultipart/form-dataor other content types. Revert toheaders["Content-Type"] = headers["Content-Type"] ?? "application/json";.src/components/user/panels/top/SocialsRow.tsx:if ((!socials || socials.length < 0) && !editable) return null;contains a logic bug.socials.length < 0is alwaysfalse. Use!socials?.lengthorsocials.length === 0.src/components/user/panels/medals/UserMedalsPanel.tsx: Usest("no_medals"), but this key is missing from thetranslation.jsondiff (it was previouslyno_medals_yet). This will render the raw key in the UI.3. Suggestions & Improvements
console.log(value);and theconsole.logblock insideSocialsRow.tsx(EditForm) before merging.src/components/web/AudioVolume.tsxsetsmax={0.4}. Unless this is an intentional limiter for your audio player, volume sliders typically expectmax={1}. Verify if this is deliberate.SocialBadge.tsx: Directly replacing{{username}}insocial.urlwithout validation could be risky if URLs are user-controllable. Consider usingnew URL()to validate or sanitize the base URL before interpolation.useMedalsinmasterdata.tsiterates twice (once to build thelistMap, once to buildgroups). Consider combining into a singlereducepass for cleaner, more performant code.const NEW_SOCIAL: Partial<UserSocialCreate> = {};is type-safe but may cause validation errors ifsocial_codeorusernameare required by the backend. Ensure the form'sonSubmithandles missing fields gracefully or sets sensible defaults.public/locales/to prevent missing translations in non-English builds.4. Actionable Checklist
🐛 Bug Fixes
UserTopPanel.tsx: DestructuremodefromuseUserContext()(const { user, mode } = useUserContext();)StatsLine.tsx: Replacenext || prevwithnext ?? prevto correctly handle0valuesfetcher.tsContent-Type logic toheaders["Content-Type"] = headers["Content-Type"] ?? "application/json";SocialsRow.tsx: Changesocials.length < 0to!socials?.length"no_medals"translation key topublic/locales/en/translation.json🧹 Cleanup & Best Practices
console.logstatements fromSocialsRow.tsxAudioVolume.tsxmax={0.4}is intentional; change to1if notsocial.urlinSocialBadge.tsxbefore string replacementuseMedalsinmasterdata.tsto use a single-passreducefor map construction and groupingpublic/locales/📦 Dependency & Tooling
package.jsonpeer dependency compatibility after major bumps (React 19, TanStack v1/v5, Vite 6).oxfmtrc.jsonconfiguration aligns with existing project linting rulesPull request closed