Skip to content

Commit 618f4fa

Browse files
committed
address PR comments
1 parent 67f7bab commit 618f4fa

File tree

5 files changed

+20
-87
lines changed

5 files changed

+20
-87
lines changed

apps/obsidian/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
"author": "",
1717
"license": "Apache-2.0",
1818
"devDependencies": {
19-
"@codemirror/state": "^6.5.2",
20-
"@codemirror/view": "^6.38.2",
2119
"@octokit/core": "^6.1.2",
2220
"@repo/eslint-config": "workspace:*",
2321
"@repo/typescript-config": "workspace:*",

apps/obsidian/src/components/GeneralSettings.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ const GeneralSettings = () => {
299299
placeholder="\\"
300300
maxLength={1}
301301
className="setting-item-control"
302-
style={{ width: "60px" }}
303302
/>
304303
</div>
305304
</div>

apps/obsidian/src/components/NodeTagSuggestModal.tsx

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,8 @@ export class NodeTagSuggestPopover {
7474

7575
private createPopover(): HTMLElement {
7676
const popover = document.createElement("div");
77-
popover.className = "node-tag-suggest-popover";
78-
popover.style.cssText = `
79-
position: fixed;
80-
z-index: 10000;
81-
background: var(--background-primary);
82-
border: 1px solid var(--background-modifier-border);
83-
border-radius: 6px;
84-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
85-
max-height: 300px;
86-
overflow-y: auto;
87-
min-width: 200px;
88-
max-width: 400px;
89-
`;
77+
popover.className =
78+
"node-tag-suggest-popover fixed z-[10000] bg-primary border border-modifier-border rounded-md shadow-[0_4px_12px_rgba(0,0,0,0.15)] max-h-[300px] overflow-y-auto min-w-[200px] max-w-[400px]";
9079

9180
const itemsContainer = document.createElement("div");
9281
itemsContainer.className = "node-tag-items-container";
@@ -102,68 +91,36 @@ export class NodeTagSuggestPopover {
10291

10392
if (this.items.length === 0) {
10493
const noResults = document.createElement("div");
105-
noResults.style.cssText = `
106-
padding: 12px;
107-
text-align: center;
108-
color: var(--text-muted);
109-
font-size: 14px;
110-
`;
94+
noResults.className = "p-3 text-center text-muted text-sm";
11195
noResults.textContent = "No node tags available";
11296
container.appendChild(noResults);
11397
return;
11498
}
11599

116100
this.items.forEach((item, index) => {
117101
const itemEl = document.createElement("div");
118-
itemEl.className = "node-tag-item";
102+
itemEl.className = `node-tag-item px-3 py-2 cursor-pointer flex items-center gap-2 border-b border-[var(--background-modifier-border-hover)]${
103+
index === this.selectedIndex ? " bg-modifier-hover" : ""
104+
}`;
119105
itemEl.dataset.index = index.toString();
120-
itemEl.style.cssText = `
121-
padding: 8px 12px;
122-
cursor: pointer;
123-
display: flex;
124-
align-items: center;
125-
gap: 8px;
126-
border-bottom: 1px solid var(--background-modifier-border-hover);
127-
`;
128-
129-
if (index === this.selectedIndex) {
130-
itemEl.style.backgroundColor = "var(--background-modifier-hover)";
131-
}
132106

133107
if (item.nodeType.color) {
134108
const colorDot = document.createElement("div");
135-
colorDot.style.cssText = `
136-
width: 12px;
137-
height: 12px;
138-
border-radius: 50%;
139-
background-color: ${item.nodeType.color};
140-
flex-shrink: 0;
141-
`;
109+
colorDot.className = `w-3 h-3 rounded-full shrink-0`;
110+
colorDot.style.backgroundColor = item.nodeType.color;
142111
itemEl.appendChild(colorDot);
143112
}
144113

145114
const textContainer = document.createElement("div");
146-
textContainer.style.cssText = `
147-
display: flex;
148-
flex-direction: column;
149-
gap: 2px;
150-
flex: 1;
151-
`;
115+
textContainer.className = "flex flex-col gap-0.5 flex-1";
152116

153117
const tagText = document.createElement("div");
154118
tagText.textContent = `#${item.tag}`;
155-
tagText.style.cssText = `
156-
font-weight: 500;
157-
color: var(--text-normal);
158-
font-size: 14px;
159-
`;
119+
tagText.className = "font-medium text-normal text-sm";
160120

161121
const nodeTypeText = document.createElement("div");
162122
nodeTypeText.textContent = item.nodeType.name;
163-
nodeTypeText.style.cssText = `
164-
font-size: 12px;
165-
color: var(--text-muted);
166-
`;
123+
nodeTypeText.className = "text-xs text-muted";
167124

168125
textContainer.appendChild(tagText);
169126
textContainer.appendChild(nodeTypeText);
@@ -190,7 +147,7 @@ export class NodeTagSuggestPopover {
190147
`.node-tag-item[data-index="${this.selectedIndex}"]`,
191148
) as HTMLElement;
192149
if (prevSelected) {
193-
prevSelected.style.backgroundColor = "";
150+
prevSelected.classList.remove("bg-modifier-hover");
194151
}
195152

196153
this.selectedIndex = newIndex;
@@ -199,7 +156,7 @@ export class NodeTagSuggestPopover {
199156
`.node-tag-item[data-index="${this.selectedIndex}"]`,
200157
) as HTMLElement;
201158
if (newSelected) {
202-
newSelected.style.backgroundColor = "var(--background-modifier-hover)";
159+
newSelected.classList.add("bg-modifier-hover");
203160
}
204161
}
205162

apps/obsidian/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ export default class DiscourseGraphPlugin extends Plugin {
194194
}
195195

196196
private setupNodeTagHotkey() {
197-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
198197
const nodeTagHotkeyExtension = EditorView.domEventHandlers({
199198
keydown: (event: KeyboardEvent) => {
200199
// Access settings dynamically to handle changes

pnpm-lock.yaml

Lines changed: 7 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)