Skip to content

Commit 1662562

Browse files
authored
ENG-1273: Migrate small personal settings (#691)
* fix * port more simple components, revert git ignore * restack * Sentence case * revert sentence case for readers that use old style * prettier * prettier, change default to initial
1 parent b6d7e87 commit 1662562

21 files changed

Lines changed: 298 additions & 410 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ yarn-error.log*
3737

3838
# Local development files
3939
local/*
40-
.cursor/debug.log
40+
.cursor/debug.log

apps/roam/src/components/settings/AdminPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ const FeatureFlagsTab = (): React.ReactElement => {
381381
}}
382382
labelElement={
383383
<>
384-
(BETA) Suggestive Mode Enabled
384+
(BETA) Suggestive mode enabled
385385
<Description
386386
description={
387387
"Whether or not to enable the suggestive mode, if this is first time enabling it, you will need to generate and upload all node embeddings to supabase. Go to Suggestive Mode -> Sync Config -> Click on 'Generate & Upload All Node Embeddings'"
@@ -453,7 +453,7 @@ const FeatureFlagsTab = (): React.ReactElement => {
453453
}}
454454
labelElement={
455455
<>
456-
Reified Relation Triples
456+
Reified relation triples
457457
<Description
458458
description={
459459
"When ON, relations are read/written as reifiedRelationUid in [[roam/js/discourse-graph/relations]]."
@@ -525,7 +525,7 @@ const AdminPanel = (): React.ReactElement => {
525525
{settings.suggestiveModeEnabled.value && (
526526
<Tab
527527
id="suggestive-mode-settings"
528-
title="Suggestive Mode"
528+
title="Suggestive mode"
529529
className="overflow-y-auto"
530530
panel={<SuggestiveModeSettings />}
531531
/>

apps/roam/src/components/settings/DiscourseNodeAttributes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const NodeAttributes = ({ uid }: { uid: string }) => {
8585
))}
8686
</div>
8787
<div>
88-
<Label style={{ marginBottom: 8 }}>Attribute Label</Label>
88+
<Label style={{ marginBottom: 8 }}>Attribute label</Label>
8989
<div style={{ display: "flex", alignItems: "center" }}>
9090
<InputGroup
9191
value={newAttribute}

apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const DiscourseNodeCanvasSettings = ({ uid }: { uid: string }) => {
4646
return (
4747
<div>
4848
<div className="mb-4">
49-
<Label style={{ marginBottom: "4px" }}>Color Picker</Label>
49+
<Label style={{ marginBottom: "4px" }}>Color picker</Label>
5050
<ControlGroup>
5151
<InputGroup
5252
style={{ width: 120 }}
@@ -78,7 +78,7 @@ const DiscourseNodeCanvasSettings = ({ uid }: { uid: string }) => {
7878
</ControlGroup>
7979
</div>
8080
<Label style={{ width: 240 }}>
81-
Display Alias
81+
Display alias
8282
<InputGroup
8383
value={alias}
8484
onChange={(e) => {
@@ -113,7 +113,7 @@ const DiscourseNodeCanvasSettings = ({ uid }: { uid: string }) => {
113113
}
114114
}}
115115
>
116-
Key Image
116+
Key image
117117
<Tooltip content={"Add an image to the discourse node"}>
118118
<Icon
119119
icon={"info-sign"}
@@ -126,7 +126,7 @@ const DiscourseNodeCanvasSettings = ({ uid }: { uid: string }) => {
126126
<RadioGroup
127127
disabled={!isKeyImage}
128128
selectedValue={!!keyImageOption ? keyImageOption : "first-image"}
129-
label="Key Image Location"
129+
label="Key image location"
130130
onChange={(e) => {
131131
const target = e.target as HTMLInputElement;
132132
setKeyImageOption(target.value);
@@ -139,8 +139,8 @@ const DiscourseNodeCanvasSettings = ({ uid }: { uid: string }) => {
139139
>
140140
<Radio label="First image on page" value="first-image" />
141141
<Radio value="query-builder">
142-
Query Builder reference
143-
<Tooltip content={"Use a Query Builder alias or block reference"}>
142+
Query builder reference
143+
<Tooltip content={"Use a query builder alias or block reference"}>
144144
<Icon
145145
icon={"info-sign"}
146146
iconSize={12}

apps/roam/src/components/settings/DiscourseNodeConfigPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const DiscourseNodeConfigPanel: React.FC<DiscourseNodeConfigPanelProps> = ({
6666
className={"roamjs-discourse-config-label"}
6767
/>
6868
<Button
69-
text={"Add Node"}
69+
text={"Add node"}
7070
intent={Intent.PRIMARY}
7171
icon={"plus"}
7272
className="select-none"
@@ -167,10 +167,10 @@ const DiscourseNodeConfigPanel: React.FC<DiscourseNodeConfigPanelProps> = ({
167167
(r) => r.source === n.type || r.destination === n.type,
168168
);
169169

170-
let dialogMessage = `Are you sure you want to delete the Node Type "${n.text}"?`;
170+
let dialogMessage = `Are you sure you want to delete the node type "${n.text}"?`;
171171

172172
if (affectedRelations.length > 0) {
173-
dialogMessage = `The Node Type "${n.text}" is used by the following relations, which will also be deleted:\n\n${affectedRelations
173+
dialogMessage = `The node type "${n.text}" is used by the following relations, which will also be deleted:\n\n${affectedRelations
174174
.map((r) => {
175175
const sourceNodeDetails = nodes.find(
176176
(s) => s.type === r.source,

apps/roam/src/components/settings/DiscourseNodeSuggestiveRules.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const DiscourseNodeSuggestiveRules = ({
137137
/>
138138

139139
<Button
140-
text="Update Embeddings"
140+
text="Update embeddings"
141141
intent={Intent.NONE}
142142
onClick={() => void handleUpdateEmbeddings()}
143143
loading={isUpdating}

apps/roam/src/components/settings/DiscourseRelationConfigPanel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ export const RelationEditPanel = ({
877877
/>
878878
</Tooltip>
879879
{!!getSetting("discourse-relation-copy") && (
880-
<Tooltip content={"Paste Relation"}>
880+
<Tooltip content={"Paste relation"}>
881881
<Button
882882
minimal
883883
icon={"clipboard"}
@@ -910,7 +910,7 @@ export const RelationEditPanel = ({
910910
/>
911911
</Tooltip>
912912
)}
913-
<Tooltip content={"Copy Relation"}>
913+
<Tooltip content={"Copy relation"}>
914914
<Button
915915
minimal
916916
icon={"duplicate"}
@@ -923,7 +923,7 @@ export const RelationEditPanel = ({
923923
).catch(() => undefined);
924924
renderToast({
925925
id: "relation-copy",
926-
content: "Copied Relation",
926+
content: "Copied relation",
927927
intent: Intent.PRIMARY,
928928
});
929929
}}
@@ -1099,7 +1099,7 @@ const DiscourseRelationConfigPanel: CustomField["options"]["component"] = ({
10991099
className="mb-4 select-none"
11001100
onClick={onNewRelation}
11011101
icon={"plus"}
1102-
text={"Add Relation"}
1102+
text={"Add relation"}
11031103
intent={Intent.PRIMARY}
11041104
/>
11051105

apps/roam/src/components/settings/ExportSettings.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ const DiscourseGraphExport = () => {
1313
const parentUid = settings.export.exportUid;
1414
return (
1515
<div className="flex flex-col gap-4 p-1">
16+
{/* TODO: Titles kept as lowercase to match legacy readers in getExportSettings.ts.
17+
Update titles to Sentence case once read side is migrated to block props. */}
1618
<div>
1719
<GlobalFlagPanel
1820
title="remove special characters"
1921
description="Whether or not to remove the special characters in a file name"
20-
settingKeys={["Export", "Remove Special Characters"]}
22+
settingKeys={["Export", "Remove special characters"]}
2123
initialValue={exportSettings.removeSpecialCharacters.value}
2224
order={1}
2325
uid={exportSettings.removeSpecialCharacters.uid}
@@ -27,7 +29,7 @@ const DiscourseGraphExport = () => {
2729
<GlobalFlagPanel
2830
title="resolve block references"
2931
description="Replaces block references in the markdown content with the block's content"
30-
settingKeys={["Export", "Resolve Block References"]}
32+
settingKeys={["Export", "Resolve block references"]}
3133
initialValue={exportSettings.optsRefs.value}
3234
order={3}
3335
uid={exportSettings.optsRefs.uid}
@@ -36,7 +38,7 @@ const DiscourseGraphExport = () => {
3638
<GlobalFlagPanel
3739
title="resolve block embeds"
3840
description="Replaces block embeds in the markdown content with the block's content tree"
39-
settingKeys={["Export", "Resolve Block Embeds"]}
41+
settingKeys={["Export", "Resolve block embeds"]}
4042
initialValue={exportSettings.optsEmbeds.value}
4143
order={4}
4244
uid={exportSettings.optsEmbeds.uid}
@@ -46,7 +48,7 @@ const DiscourseGraphExport = () => {
4648
<GlobalFlagPanel
4749
title="append referenced node"
4850
description="If a referenced node is defined in a node's format, it will be appended to the discourse context"
49-
settingKeys={["Export", "Append Referenced Node"]}
51+
settingKeys={["Export", "Append referenced node"]}
5052
initialValue={exportSettings.appendRefNodeContext.value}
5153
order={6}
5254
uid={exportSettings.appendRefNodeContext.uid}
@@ -57,7 +59,7 @@ const DiscourseGraphExport = () => {
5759
<GlobalSelectPanel
5860
title="link type"
5961
description="How to format links that appear in your export."
60-
settingKeys={["Export", "Link Type"]}
62+
settingKeys={["Export", "Link type"]}
6163
initialValue={exportSettings.linkType.value || "alias"}
6264
order={5}
6365
options={["alias", "wikilinks", "roam url"]}
@@ -68,7 +70,7 @@ const DiscourseGraphExport = () => {
6870
<GlobalNumberPanel
6971
title="max filename length"
7072
description="Set the maximum name length for markdown file exports"
71-
settingKeys={["Export", "Max Filename Length"]}
73+
settingKeys={["Export", "Max filename length"]}
7274
initialValue={exportSettings.maxFilenameLength.value || 64}
7375
order={0}
7476
uid={exportSettings.maxFilenameLength.uid}

apps/roam/src/components/settings/GeneralSettings.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const DiscourseGraphHome = () => {
1717
const [isAlertOpen, setIsAlertOpen] = useState(false);
1818
return (
1919
<div className="flex flex-col gap-4 p-1">
20+
{/* TODO: Titles kept as legacy casing to match readers in discourseConfigRef.ts and initializeObserversAndListeners.ts.
21+
Update titles to Sentence case once read side is migrated to block props. */}
2022
<GlobalTextPanel
2123
title="trigger"
2224
description="The trigger to create the node menu."
@@ -29,7 +31,7 @@ const DiscourseGraphHome = () => {
2931
<GlobalTextPanel
3032
title="Canvas Page Format"
3133
description="The page format for canvas pages"
32-
settingKeys={["Canvas Page Format"]}
34+
settingKeys={["Canvas page format"]}
3335
initialValue={
3436
settings.canvasPageFormat.value || DEFAULT_CANVAS_PAGE_FORMAT
3537
}
@@ -40,8 +42,8 @@ const DiscourseGraphHome = () => {
4042
<FeatureFlagPanel
4143
title="(BETA) Left Sidebar"
4244
description="Whether or not to enable the left sidebar."
43-
featureKey="Enable Left Sidebar"
4445
initialValue={settings.leftSidebarEnabled.value}
46+
featureKey="Enable left sidebar"
4547
order={2}
4648
uid={settings.leftSidebarEnabled.uid}
4749
parentUid={settings.settingsUid}

0 commit comments

Comments
 (0)