Skip to content

Commit 71046b3

Browse files
authored
ENG-805 - Set default font to sans for Discourse Nodes on Canvas (#432)
* Refactor font settings in Export and Discourse components to use "sans" and size "s" for consistency across the application. * Update Export component to set default size to "s" for consistency in export settings.
1 parent bbb3c9a commit 71046b3

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

apps/roam/src/components/Export.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ const ExportDialog: ExportDialogComponent = ({
351351
uid: r.uid,
352352
title: String(r[firstColumnKey]),
353353
imageUrl,
354-
size: "m",
355-
fontFamily: "draw",
354+
size: "s",
355+
fontFamily: "sans",
356356
},
357357
parentId: pageKey,
358358
y: shapeY,

apps/roam/src/components/canvas/DiscourseNodeUtil.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export const createNodeShapeTools = (
122122
type: this.shapeType,
123123
x: currentPagePoint.x,
124124
y: currentPagePoint.y,
125+
props: { fontFamily: "sans", size: "s" },
125126
});
126127
this.editor.setEditingShape(shapeId);
127128
this.editor.setCurrentTool("select");
@@ -200,8 +201,8 @@ export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
200201
h: 64,
201202
uid: window.roamAlphaAPI.util.generateUID(),
202203
title: "",
203-
size: "m",
204-
fontFamily: "draw",
204+
size: "s",
205+
fontFamily: "sans",
205206
};
206207
}
207208

apps/roam/src/components/canvas/DiscourseToolPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const DiscourseGraphPanel = ({
157157
type: current.item.id,
158158
x: pagePoint.x,
159159
y: pagePoint.y,
160+
props: { fontFamily: "sans", size: "s" },
160161
});
161162
editor.setEditingShape(shapeId);
162163
editor.setCurrentTool("select");

apps/roam/src/components/canvas/Tldraw.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ const TldrawCanvas = ({ title }: { title: string }) => {
502502
props: {
503503
uid: e.detail.uid,
504504
title: e.detail.val,
505-
size: "m",
506-
fontFamily: "draw",
505+
size: "s",
506+
fontFamily: "sans",
507507
},
508508
...position,
509509
},

apps/roam/src/components/canvas/uiOverrides.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ const convertToDiscourseNode = async ({
103103
{
104104
type,
105105
id: createShapeId(),
106-
props: { uid, title: nodeText, h, w, imageUrl },
106+
props: {
107+
uid,
108+
title: nodeText,
109+
h,
110+
w,
111+
imageUrl,
112+
fontFamily: "sans",
113+
size: "s",
114+
},
107115
x,
108116
y,
109117
},

0 commit comments

Comments
 (0)