Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/web-pkg/src/components/AppTopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
padding-size="small"
toggle="#oc-openfile-contextmenu-trigger"
close-on-click
:title="resource.name"
@click.stop.prevent
>
<context-action-menu
Expand Down
46 changes: 20 additions & 26 deletions packages/web-pkg/src/components/FilesList/ResourceTiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,28 @@
<div v-if="sortFields.length" class="oc-tiles-sort">
<oc-filter-chip
class="oc-tiles-sort-filter-chip"
:filter-label="currentSortField.label"
:selected-item-names="[]"
:filter-label="$gettext('Sort by')"
:selected-item-names="[currentSortField.label]"
:has-active-state="false"
close-on-click
raw
>
<template #default>
<oc-button
v-for="(option, index) in sortFields"
:key="index"
appearance="raw"
size="medium"
justify-content="space-between"
class="oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s"
:class="{
'oc-tiles-sort-filter-chip-item-active': currentSortField === option,
'oc-mt-xs': index > 0
}"
@click="selectSorting(option)"
>
<span>{{ option.label }}</span>
<div v-if="option === currentSortField" class="oc-flex">
<oc-icon name="check" />
</div>
</oc-button>
<oc-list>
<li v-for="(option, index) in sortFields" :key="index">
<oc-button
appearance="raw"
:class="{ 'oc-secondary-container': currentSortField === option }"
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The conditional class 'oc-secondary-container' should be applied consistently. Consider using a computed property or method to determine the button's class state for better maintainability.

Copilot uses AI. Check for mistakes.
class="oc-tiles-sort-filter-chip-item"
@click="selectSorting(option)"
>
<span>{{ option.label }}</span>
<div v-if="option === currentSortField" class="oc-flex">
<oc-icon name="check" />
</div>
</oc-button>
</li>
</oc-list>
</template>
</oc-filter-chip>
</div>
Expand Down Expand Up @@ -624,12 +622,8 @@ onBeforeUnmount(() => {
font-size: var(--oc-font-size-default);
}

&-item-active {
background-color: var(--oc-role-secondary-container) !important;
}

&-item:hover:not(&-item-active) {
background-color: var(--oc-role-surface-container) !important;
&-item {
justify-content: space-between !important;
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using !important should be avoided as it makes styles harder to maintain and override. Consider restructuring the CSS specificity or using more specific selectors instead.

Suggested change
justify-content: space-between !important;
display: flex;
justify-content: space-between;

Copilot uses AI. Check for mistakes.
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ describe('ResourceTiles component', () => {
const { wrapper } = getWrapper({ props: { sortFields } })
const filterChip = wrapper.findComponent<typeof OcFilterChip>({ name: 'oc-filter-chip' })
await filterChip.trigger('click')
const sortItem = filterChip.find('.oc-tiles-sort-filter-chip-item:nth-child(2)')
await sortItem.trigger('click')
const sortItem = filterChip.findAll('.oc-tiles-sort-filter-chip-item')
await sortItem[1].trigger('click')
expect(wrapper.emitted('sort')).toBeTruthy()
})
})
Expand Down