Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix [properties-fe] - fixes for sort and display properties components (#416)

Daniel Kweona48e466f3a9b
diff --git a/js/app/packages/app/component/PropertyDisplayControl.tsx b/js/app/packages/app/component/PropertyDisplayControl.tsx
index af9006439b..34f7068a51 100644
--- a/js/app/packages/app/component/PropertyDisplayControl.tsx
+++ b/js/app/packages/app/component/PropertyDisplayControl.tsx
@@ -3,6 +3,7 @@ import { PropertyDataTypeIcon } from '@core/component/Properties/utils';
import { ERROR_MESSAGES } from '@core/component/Properties/utils/errorHandling';
import { toast } from '@core/component/Toast/Toast';
import { isErr } from '@core/util/maybeResult';
+import MagnifyingGlassIcon from '@phosphor-icons/core/assets/regular/magnifying-glass.svg';
import XIcon from '@phosphor-icons/core/assets/regular/x.svg';
import { propertiesServiceClient } from '@service-properties/client';
import type { Accessor, Component } from 'solid-js';
@@ -203,9 +204,9 @@ export const PropertyDisplayControl: Component<PropertyDisplayControlProps> = (
const currentIds = props.selectedPropertyIds();
if (!currentIds.includes(property.id)) {
const currentIds = props.selectedPropertyIds();
- // Enforce max 6 properties
+ // Enforce max 4 properties
if (currentIds.length >= MAX_DISPLAY_PROPERTIES) {
- toast.failure('You can only select up to 6 properties to display.');
+ toast.failure('You can only select up to 4 properties to display.');
return;
}
@@ -220,9 +221,9 @@ export const PropertyDisplayControl: Component<PropertyDisplayControlProps> = (
const handleSelectProperty = (property: PropertyDefinitionFlat) => {
const currentIds = props.selectedPropertyIds();
- // Enforce max 6 properties
- if (currentIds.length >= 6) {
- toast.failure('You can only select up to 6 properties to display.');
+ // Enforce max 4 properties
+ if (currentIds.length >= MAX_DISPLAY_PROPERTIES) {
+ toast.failure('You can only select up to 4 properties to display.');
return;
}
@@ -352,7 +353,8 @@ export const PropertyDisplayControl: Component<PropertyDisplayControlProps> = (
</div>
</Show>
- <div class="relative w-full">
+ <div class="relative flex w-full">
+ <MagnifyingGlassIcon class="absolute left-2 top-1/2 -translate-y-1/2 size-3.5 text-ink-muted pointer-events-none" />
<input
ref={searchInputRef}
type="text"
@@ -363,7 +365,7 @@ export const PropertyDisplayControl: Component<PropertyDisplayControlProps> = (
}}
onFocus={() => setIsDropdownOpen(true)}
placeholder="Search Properties..."
- class="w-full px-2 py-1 font-mono text-xs text-ink placeholder-ink-muted bg-transparent"
+ class="w-full pl-7 pr-2 py-1 font-mono text-xs text-ink placeholder-ink-muted bg-transparent"
/>
<PropertyDropdown
diff --git a/js/app/packages/macro-entity/src/components/Sort.tsx b/js/app/packages/macro-entity/src/components/Sort.tsx
index 4024bdea7f..e8e3c79ed2 100644
--- a/js/app/packages/macro-entity/src/components/Sort.tsx
+++ b/js/app/packages/macro-entity/src/components/Sort.tsx
@@ -1,6 +1,7 @@
import { ENABLE_PROPERTY_DISPLAY_CONTROL } from '@core/constant/featureFlags';
import ClockIcon from '@phosphor-icons/core/assets/regular/clock.svg';
import LightningIcon from '@phosphor-icons/core/assets/regular/lightning.svg';
+import MagnifyingGlassIcon from '@phosphor-icons/core/assets/regular/magnifying-glass.svg';
import SortAscendingIcon from '@phosphor-icons/core/assets/regular/sort-ascending.svg';
import SortDescendingIcon from '@phosphor-icons/core/assets/regular/sort-descending.svg';
import XIcon from '@phosphor-icons/core/assets/regular/x.svg';
@@ -123,6 +124,7 @@ function PropertySortSearch(props: PropertySortSearchProps) {
return (
<div ref={containerRef} class="relative w-full">
+ <MagnifyingGlassIcon class="absolute left-2 top-1/2 -translate-y-1/2 size-3.5 text-ink-muted pointer-events-none" />
<input
ref={searchInputRef}
type="text"
@@ -133,7 +135,7 @@ function PropertySortSearch(props: PropertySortSearchProps) {
}}
onFocus={() => setIsDropdownOpen(true)}
placeholder="Search Properties..."
- class="w-full px-2 py-1 font-mono text-xs text-ink placeholder-ink-muted bg-transparent border border-edge focus:ring-2 focus:ring-accent/50 focus:border-accent"
+ class="w-full pl-7 pr-2 py-1 font-mono text-xs text-ink placeholder-ink-muted bg-transparent border border-edge focus:ring-2 focus:ring-accent/50 focus:border-accent"
/>
<Show when={isDropdownOpen()}>
<div