fix: restore deprecated color values from deprecated sprinkles#483
fix: restore deprecated color values from deprecated sprinkles#483
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @noahchoii, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where deprecated color values were incorrectly handled, leading to potential breakage or unexpected styling. By reverting these values and implementing a robust mechanism for managing deprecated color tokens, the change ensures that components relying on these older definitions continue to function correctly, improving backward compatibility and stability of the styling system. Additionally, deprecated shorthand properties were removed from the main sprinkle properties. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
이 PR은 사용 중단된(deprecated) 색상 관련 유틸리티 CSS 속성을 이전 값으로 복원하는 수정을 수행합니다. removePrefixFromKeys 함수를 도입하여 접두사를 제거하고 이전 토큰 값을 생성하는 방식이 인상적입니다. 전반적으로 변경 사항은 명확하며 PR의 목적을 잘 달성하고 있습니다.
코드의 안정성을 높이기 위해 removePrefixFromKeys 함수 구현을 개선하는 제안을 하나 추가했습니다. 현재 replace를 사용하는 방식은 잠재적인 엣지 케이스에 취약할 수 있으므로, 정규식을 사용하여 접두사만 명시적으로 처리하도록 하는 것이 좋습니다.
| ): RemovePrefix<T, P> { | ||
| return Object.fromEntries( | ||
| Object.entries(tokens).map(([key, value]) => [ | ||
| key.replace(prefix, '').replace('basic-', ''), |
There was a problem hiding this comment.
현재 replace 메소드는 문자열의 첫 번째 일치 항목만 바꾸며, 반드시 접두사일 필요는 없습니다. 이로 인해 bg- 또는 basic-이 키의 중간에 나타날 경우 예기치 않은 동작을 유발할 수 있습니다.
정규식을 사용하여 문자열의 시작 부분(^)에 있는 접두사만 대상으로 하도록 수정하면 코드가 더 안정적이고 예측 가능해집니다.
| key.replace(prefix, '').replace('basic-', ''), | |
| key.replace(new RegExp(`^${prefix}`), '').replace(/^basic-/, ''), |
|
✅ All tests passed!
Click here if you need to update snapshots. |
Description of Changes
Deprecated color-related utility CSS properties have been reverted to their previous values prior to the change.
$bg-primary-200->$primary-200$border-primary->$primary$fg-primary-200->$primary-200$basic-grey-200->$grey-200Checklist
Before submitting the PR, please make sure you have checked all of the following items.