-
Notifications
You must be signed in to change notification settings - Fork 238
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
ZO Character assets #2678
ZO Character assets #2678
Conversation
WalkthroughThe changes introduce a new module that aggregates image assets and several new type definitions and functions in another module. The first file creates a default export containing two image assets. The second file enhances functionality by adding type aliases, importing new types, and defining functions that retrieve or process image assets while adding error handling improvements. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant I as Index Module
participant Cache as Asset Cache
participant Chars as Chars Module
U->>I: Call characterAsset(ck, asset)
I->>Cache: Check for asset
alt Asset exists
Cache-->>I: Return asset
else Asset missing
I->>Chars: Fetch asset for ck and asset
Chars-->>I: Return fetched asset
I->>Cache: Cache the asset
end
I-->>U: Return asset
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
[zzz-frontend] [Sat Feb 8 17:42:40 UTC 2025] - Deployed fb5ef17 to https://genshin-optimizer-prs.github.io/pr/2678/zzz-frontend (Takes 3-5 minutes after this completes to be available) [zzz-frontend] [Sat Feb 8 18:06:32 UTC 2025] - Deployed c3bb537 to https://genshin-optimizer-prs.github.io/pr/2678/zzz-frontend (Takes 3-5 minutes after this completes to be available) [zzz-frontend] [Sat Feb 8 18:35:21 UTC 2025] - Deployed c3bb537 to https://genshin-optimizer-prs.github.io/pr/2678/zzz-frontend (Takes 3-5 minutes after this completes to be available) [Sat Feb 8 18:37:22 UTC 2025] - Deleted deployment |
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (107)
libs/zzz/assets/src/common/discBackdrop.png
is excluded by!**/*.png
libs/zzz/assets/src/common/drive.png
is excluded by!**/*.png
libs/zzz/assets/src/gen/chars/Anby/IconRole01.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Anby/IconRoleCircleAnby.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Anby/IconRoleSelectAnby.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Anby/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Anton/IconRole15.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Anton/IconRoleSelect15.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Anton/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/AstraYao/IconRole36.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/AstraYao/IconRoleCircleAstraYao.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/AstraYao/IconRoleSelectAstraYao.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/AstraYao/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Ben/IconRole16.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Ben/IconRoleSelect16.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Ben/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Billy/IconRole10.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Billy/IconRoleSelect10.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Billy/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Burnice/IconRole32.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Burnice/IconRoleSelect32.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Burnice/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Caesar/IconRole25.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Caesar/IconRoleSelect25.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Caesar/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Corin/IconRole09.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Corin/IconRoleSelect09.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Corin/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Ellen/IconRole21.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Ellen/IconRoleSelect21.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Ellen/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Evelyn/IconRole37.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Evelyn/IconRoleSelect37.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Evelyn/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Grace/IconRole20.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Grace/IconRoleSelect20.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Grace/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Harumasa/IconRole35.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Harumasa/IconRoleSelect35.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Harumasa/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Jane/IconRole24.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Jane/IconRoleSelect24.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Jane/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Koleda/IconRole14.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Koleda/IconRoleSelect14.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Koleda/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Lighter/IconRole26.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Lighter/IconRoleSelect26.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Lighter/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Lucy/IconRole27.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Lucy/IconRoleSelect27.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Lucy/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Lycaon/IconRole18.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Lycaon/IconRoleSelect18.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Lycaon/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Miyabi/IconRole13.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Miyabi/IconRoleSelect13.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Miyabi/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Nekomata/IconRole11.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Nekomata/IconRoleSelect11.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Nekomata/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Nicole/IconRole12.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Nicole/IconRoleSelect12.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Nicole/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Piper/IconRole28.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Piper/IconRoleSelect28.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Piper/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/QingYi/IconRole29.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/QingYi/IconRoleSelect29.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/QingYi/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Rina/IconRole22.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Rina/IconRoleSelect22.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Rina/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Seth/IconRole30.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Seth/IconRoleSelect30.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Seth/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Soldier11/IconRole05.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Soldier11/IconRoleSelect05.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Soldier11/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Soukaku/IconRole17.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Soukaku/IconRoleSelect17.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Soukaku/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Yanagi/IconRole31.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Yanagi/IconRoleSelect31.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/Yanagi/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/ZhuYuan/IconRole23.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/ZhuYuan/IconRoleSelect23.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/chars/ZhuYuan/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/common/SkillCore.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/common/SkillEvade.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/common/SkillNormal.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/common/SkillQTE.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/common/SkillSpecial.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/common/SkillSwitch.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/common/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/rarity/RANK_A.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/rarity/RANK_B.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/rarity/RANK_S.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/rarity/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/speciality/IconAnomaly.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/speciality/IconAttack.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/speciality/IconDefense.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/speciality/IconStun.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/speciality/IconSupport.png
is excluded by!**/*.png
,!**/gen/**
libs/zzz/assets/src/gen/speciality/index.ts
is excluded by!**/gen/**
📒 Files selected for processing (3)
libs/zzz/assets/src/common/index.ts
(1 hunks)libs/zzz/assets/src/index.ts
(1 hunks)libs/zzz/consts/src/character.ts
(0 hunks)
💤 Files with no reviewable changes (1)
- libs/zzz/consts/src/character.ts
🧰 Additional context used
🪛 Biome (1.9.4)
libs/zzz/assets/src/index.ts
[error] 28-28: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: lint
🔇 Additional comments (4)
libs/zzz/assets/src/index.ts (3)
1-22
: Looks good to me... yawnsThe imports and type definitions are well-organized. I've been staring at type definitions all night, and these ones actually make sense.
36-38
: Simple and sweet, just like my coffee at midnight.The null check is there, it returns what it should. No complaints from this sleep-deprived dev.
40-46
: Copy-paste done right for once... sips coffeeThese functions follow the same pattern consistently. It's refreshing to see consistency at this hour.
libs/zzz/assets/src/common/index.ts (1)
1-9
: Simple and clean... just what my tired brain needs.Nice use of
as const
for type safety. The generated index file is doing exactly what it should - no more, no less.
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (4)
libs/zzz/assets/src/gen/chars/PulchraFeliny/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/SilverAnby/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/Trigger/index.ts
is excluded by!**/gen/**
libs/zzz/assets/src/gen/chars/index.ts
is excluded by!**/gen/**
📒 Files selected for processing (1)
libs/zzz/assets/src/index.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
libs/zzz/assets/src/index.ts
[error] 28-28: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
🔇 Additional comments (8)
libs/zzz/assets/src/index.ts (8)
1-7
: All these imports look tidy.
Somnia, caffeinated and scanning... no immediate red flags here. Nice and clean.
14-22
: New type definitions look concise.
Somnia appreciates the succinctness of these type aliases—no extra fluff to keep me awake at night.
28-28
: Avoid the non-null assertion.
Somnia’s eyes twitch whenever I see a “!”. It's safer to replace it with optional chaining or a default, like so:- return characterAssetCache.get(cacheKey)! + return characterAssetCache.get(cacheKey) ?? ''🧰 Tools
🪛 Biome (1.9.4)
[error] 28-28: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
25-34
: Good caching approach, but let's keep an eye on potential object shape changes.
Somnia wonders if you might eventually store more fields than just strings. If so, watch out for any mismatch in theRecord<characterAssetKey, ...>
shape. For now, though, everything lines up fine.🧰 Tools
🪛 Biome (1.9.4)
[error] 28-28: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
36-38
: discDefIcon logic is straightforward.
Somnia sees no fancy footwork here—just a clean fallback to an empty string. Perfect for night-time debugging.
40-42
: specialityDefIcon reads well.
Somnia has no nightmares about this function. It's simple, returns a string or empty, easy to maintain.
44-46
: rarityDefIcon remains consistent.
Somnia notes that this is aligned with the pattern of returning either from a lookup or an empty string. All good.
52-53
: commonDefImages is consistent with your icon approach.
Somnia likes the empty string fallback—less chance of a late-night “undefined” meltdown.
export function commonDefIcon(key: commonKey) { | ||
return key ? common[key] : '' | ||
} |
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.
🧹 Nitpick (assertive)
commonDefIcon pattern matches the others nicely.
Somnia sees a repeating pattern across these “defIcon” functions—maybe a future DRY refactor, but not urgent.
Describe your changes
Issue or discord link
Testing/validation
Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)
yarn run mini-ci
locally to validate format and lint.Summary by CodeRabbit