Skip to content

Commit c1ed3d9

Browse files
longer description
1 parent df8dc6c commit c1ed3d9

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

packages/compass-preferences-model/src/preferences-schema.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ type PreferenceDefinition<K extends keyof AllPreferences> = {
200200
short: string;
201201
long?: string;
202202
options?: AllPreferences[K] extends string
203-
? { [k in AllPreferences[K]]: string }
203+
? { [k in AllPreferences[K]]: { label: string; description: string } }
204204
: never;
205205
};
206206
/** A method for deriving the current semantic value of this option, even if it differs from the stored value */
@@ -565,11 +565,22 @@ export const storedUserPreferencesProps: Required<{
565565
short: 'Default Sort for Query Bar',
566566
long: "All queries executed from the query bar will apply the sort order '$natural: -1'.",
567567
options: {
568-
'': 'None (equivalent to $natural: 1, in ascending natural order of documents)',
569-
'{ $natural: -1 }':
570-
'$natural: -1 (in descending natural order of documents)',
571-
'{ _id: 1 }': '_id: 1 (in ascending order by creation)',
572-
'{ _id: -1 }': '_id: -1 (in descending order by creation) ',
568+
'': {
569+
label: '$natural: 1 (MongoDB server default)',
570+
description: 'in natural order of documents',
571+
},
572+
'{ $natural: -1 }': {
573+
label: '$natural: -1',
574+
description: 'in reverse natural order of documents',
575+
},
576+
'{ _id: 1 }': {
577+
label: '_id: 1',
578+
description: 'in ascending order by id',
579+
},
580+
'{ _id: -1 }': {
581+
label: '_id: -1',
582+
description: 'in descending order by id',
583+
},
573584
},
574585
},
575586
validator: z.enum(SORT_ORDER_VALUES).default(''),

packages/compass-settings/src/components/settings/settings-list.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,14 @@ function DefaultSortOrderSetting<PreferenceName extends 'defaultSortOrder'>({
194194
disabled={disabled}
195195
>
196196
{SORT_ORDER_VALUES.map((option) => (
197-
<Option key={option} value={option}>
198-
{(optionDescriptions && optionDescriptions[option]) || value}
197+
<Option
198+
key={option}
199+
value={option}
200+
description={
201+
optionDescriptions && optionDescriptions[option].description
202+
}
203+
>
204+
{optionDescriptions && optionDescriptions[option].label}
199205
</Option>
200206
))}
201207
</Select>

0 commit comments

Comments
 (0)