-
Notifications
You must be signed in to change notification settings - Fork 729
fix: collection color management #3905
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,70 +56,6 @@ | |
| </lf-field> | ||
| </article> | ||
|
|
||
| <!-- Appearance section --> | ||
| <div class="mb-6"> | ||
| <h6 class="text-sm font-semibold text-gray-500 mb-4 border-b border-gray-100 pb-2"> | ||
| Appearance | ||
| </h6> | ||
|
|
||
| <!-- Card image URL --> | ||
| <article class="mb-6"> | ||
| <lf-field label-text="Card image URL" :required="true"> | ||
| <lf-input | ||
| v-model="form.imageUrl" | ||
| class="h-10" | ||
| placeholder="https://example.com/card-image.png" | ||
| :invalid="$v.imageUrl.$invalid && $v.imageUrl.$dirty" | ||
| @blur="$v.imageUrl.$touch()" | ||
| @change="$v.imageUrl.$touch()" | ||
| /> | ||
| <lf-field-messages | ||
| :validation="$v.imageUrl" | ||
| :error-messages="{ url: 'Please enter a valid URL' }" | ||
| /> | ||
| <span class="text-2xs text-gray-400">Recommended image size: 800×240px</span> | ||
| </lf-field> | ||
| </article> | ||
|
|
||
| <!-- Collection logo URL --> | ||
| <article class="mb-6"> | ||
| <lf-field label-text="Collection logo URL" :required="true"> | ||
| <lf-input | ||
| v-model="form.logoUrl" | ||
| class="h-10" | ||
| placeholder="https://example.com/logo.png" | ||
| :invalid="$v.logoUrl.$invalid && $v.logoUrl.$dirty" | ||
| @blur="$v.logoUrl.$touch()" | ||
| @change="$v.logoUrl.$touch()" | ||
| /> | ||
| <lf-field-messages | ||
| :validation="$v.logoUrl" | ||
| :error-messages="{ url: 'Please enter a valid URL' }" | ||
| /> | ||
| <span class="text-2xs text-gray-400">Recommended image size: 400×400px</span> | ||
| </lf-field> | ||
| </article> | ||
|
|
||
| <!-- Collection color --> | ||
| <article class="mb-6"> | ||
| <lf-field label-text="Collection color"> | ||
| <div class="flex items-center gap-2"> | ||
| <span | ||
| class="w-6 h-6 rounded-full flex-shrink-0 border border-gray-200" | ||
| :style="{ backgroundColor: form.color || '#009AFF' }" | ||
| /> | ||
| <lf-input | ||
| v-model="form.color" | ||
| class="h-10 flex-grow" | ||
| placeholder="#FE9A00" | ||
| type="color" | ||
| /> | ||
| </div> | ||
| <span class="text-2xs text-gray-400">Leave blank to use the default color #009AFF</span> | ||
| </lf-field> | ||
| </article> | ||
| </div> | ||
|
|
||
| <!-- Category --> | ||
| <article class="mb-5"> | ||
| <lf-field label-text="Category"> | ||
|
|
@@ -180,6 +116,76 @@ | |
| /> | ||
| </lf-field> | ||
| </article> | ||
|
|
||
| <!-- Appearance section --> | ||
| <div class="mb-6"> | ||
| <div class="flex items-center gap-3"> | ||
| <h6 class="text-sm font-primary font-semibold text-gray-500 mb-4 pb-2"> | ||
| Appearance | ||
| </h6> | ||
| <div class="border-b border-gray-100 w-full" /> | ||
| </div> | ||
|
|
||
| <!-- Card image URL --> | ||
| <article class="mb-6"> | ||
| <lf-field label-text="Card image URL" :required="true"> | ||
| <lf-input | ||
| v-model="form.imageUrl" | ||
| class="h-10" | ||
| placeholder="https://example.com/card-image.png" | ||
| :invalid="$v.imageUrl.$invalid && $v.imageUrl.$dirty" | ||
| @blur="$v.imageUrl.$touch()" | ||
| @change="$v.imageUrl.$touch()" | ||
| /> | ||
| <lf-field-messages | ||
| :validation="$v.imageUrl" | ||
| :error-messages="{ url: 'Please enter a valid URL' }" | ||
| /> | ||
| <span class="text-2xs text-gray-400">Recommended image size: 800×240px</span> | ||
| </lf-field> | ||
| </article> | ||
|
|
||
| <!-- Collection logo URL --> | ||
| <article class="mb-6"> | ||
| <lf-field label-text="Collection logo URL" :required="true"> | ||
| <lf-input | ||
| v-model="form.logoUrl" | ||
| class="h-10" | ||
| placeholder="https://example.com/logo.png" | ||
| :invalid="$v.logoUrl.$invalid && $v.logoUrl.$dirty" | ||
| @blur="$v.logoUrl.$touch()" | ||
| @change="$v.logoUrl.$touch()" | ||
| /> | ||
| <lf-field-messages | ||
| :validation="$v.logoUrl" | ||
| :error-messages="{ url: 'Please enter a valid URL' }" | ||
| /> | ||
| <span class="text-2xs text-gray-400">Recommended image size: 400×400px</span> | ||
| </lf-field> | ||
| </article> | ||
|
|
||
| <!-- Collection color --> | ||
| <article class="mb-6"> | ||
| <lf-field label-text="Collection color"> | ||
| <div class="flex items-center gap-2"> | ||
| <lf-input | ||
| v-model="form.color" | ||
| class="h-10 flex-grow" | ||
| placeholder="Enter HEX code" | ||
| > | ||
| <template #prefix> | ||
| <span | ||
| v-if="form.color" | ||
| class="w-6 h-6 rounded-full flex-shrink-0 border border-gray-200" | ||
| :style="{ backgroundColor: form.color || '#009AFF' }" | ||
| /> | ||
| </template> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty prefix div renders with padding when color blankLow Severity The |
||
| </lf-input> | ||
| </div> | ||
| <span class="text-2xs text-gray-400">Leave blank to use the default color #009AFF</span> | ||
| </lf-field> | ||
| </article> | ||
| </div> | ||
| </div> | ||
| <lf-collection-add-projects-tab | ||
| v-if="activeTab === 'projects'" | ||
|
|
||


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.
Unreachable fallback due to
v-ifguardLow Severity
The
v-if="form.color"on line 178 ensures the color previewspanonly renders whenform.coloris truthy, which makes the|| '#009AFF'fallback in thebackgroundColorstyle binding on line 180 unreachable dead code. If the intent was to show a default color swatch when the field is empty, thev-ifprevents that. If the intent was to only show a preview when the user has typed something, the fallback is unnecessary.