Skip to content

Commit cac2d48

Browse files
Copilothotlong
andcommitted
style: add clarifying comments for field filter logic and showAllRecords default
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 4271613 commit cac2d48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/console/src/utils/view-config-schema.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,8 @@ function buildDataSection(
10731073
const currentFields: Array<{ field: string; label?: string }> = uf.fields || [];
10741074
const currentTabs: Array<{ id: string; label: string; filters: any[]; default?: boolean }> = uf.tabs || [];
10751075

1076-
// Derive available fields — only discrete-option fields work well with dropdown/toggle
1076+
// Derive available fields — only discrete-option fields work with dropdown/toggle.
1077+
// hasOptions: custom fields with explicit options arrays; isSupportedType: standard select/boolean types
10771078
const availableFields = fieldOptions
10781079
.filter(f => {
10791080
const hasOptions = Array.isArray(f.options) && f.options.length > 0;
@@ -1232,7 +1233,8 @@ function buildDataSection(
12321233
data-testid="uf-show-all-records"
12331234
checked={uf.showAllRecords !== false}
12341235
onCheckedChange={(checked: boolean) => {
1235-
updateField('userFilters', { ...uf, showAllRecords: checked === true ? undefined : false });
1236+
// undefined = runtime default (show), false = explicitly hidden
1237+
updateField('userFilters', { ...uf, showAllRecords: checked ? undefined : false });
12361238
}}
12371239
className="h-3.5 w-3.5"
12381240
/>

0 commit comments

Comments
 (0)