Skip to content

Commit 123adb1

Browse files
authored
Merge pull request #78 from romejoe/pr-responses
fix: address remaining ObsidianReviewBot violations (PR #11614 rescan)
2 parents 74f0f40 + d85b64a commit 123adb1

7 files changed

Lines changed: 14 additions & 37 deletions

File tree

eslint.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default tseslint.config(
88
languageOptions: {
99
globals: {
1010
...globals.browser,
11+
Buffer: 'readonly',
1112
},
1213
parserOptions: {
1314
projectService: {

src/attachment-chip.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ export function buildAttachmentChipElement(token: ParsedVcToken, plugin: VaultCr
459459
new Notice('Failed to save: filesystem API unavailable');
460460
return;
461461
}
462-
// eslint-disable-next-line no-undef -- Buffer is a Node.js global available in Electron
463462
await fs.writeFile(result.filePath, Buffer.from(data));
464463
new Notice(`Saved to ${result.filePath}`);
465464
} catch (err) {

src/chip-component.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function buildSecretChipElement(token: ParsedVcToken, plugin: VaultCryptPlugin):
137137

138138
if (Platform.isDesktop) {
139139
menu.addItem(item => item
140-
.setTitle('Open in KeePassXC')
140+
.setTitle('Open database file')
141141
.setIcon('external-link')
142142
.onClick(async () => {
143143
const config = peek(profileConfig);
@@ -654,29 +654,6 @@ function copyField(
654654
}
655655

656656
navigator.clipboard.writeText(value).then(onCopySuccess).catch(() => {
657-
// Fallback for mobile WebViews where the Clipboard API may be unavailable
658-
let textarea: HTMLTextAreaElement|null = null;
659-
try {
660-
textarea = document.createElement('textarea');
661-
textarea.value = value;
662-
// eslint-disable-next-line obsidianmd/no-static-styles-assignment
663-
textarea.style.cssText = 'position:fixed;opacity:0;';
664-
document.body.appendChild(textarea);
665-
textarea.focus();
666-
textarea.select();
667-
// eslint-disable-next-line @typescript-eslint/no-deprecated
668-
const ok = document.execCommand('copy');
669-
document.body.removeChild(textarea);
670-
if (ok) {
671-
onCopySuccess();
672-
} else {
673-
new Notice('Failed to copy to clipboard');
674-
}
675-
} catch {
676-
if(textarea !== null){
677-
textarea.remove();
678-
}
679-
new Notice('Failed to copy to clipboard');
680-
}
657+
new Notice('Failed to copy to clipboard');
681658
});
682659
}

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export default class VaultCryptPlugin extends Plugin {
152152
});
153153

154154
// Ribbon icon → unlock modal (prefers keyring when available)
155-
this.addRibbonIcon('lock', 'VaultCrypt', () => {
155+
this.addRibbonIcon('lock', 'Manage secrets', () => {
156156
if (this.shouldUseKeyringUnlock()) {
157157
new KeyringUnlockModal(this.app, this, () => {
158158
// Chain to per-profile unlock for non-managed locked profiles
@@ -312,7 +312,7 @@ export default class VaultCryptPlugin extends Plugin {
312312
this.registerEvent(
313313
this.app.workspace.on('editor-menu', (menu: Menu, editor: Editor) => {
314314
menu.addItem(item => item
315-
.setTitle('VaultCrypt: insert secret here')
315+
.setTitle('Insert secret here')
316316
.setIcon('key')
317317
.onClick(() => new InsertSecretModal(this.app, this, editor).open()));
318318
})
@@ -425,7 +425,7 @@ export default class VaultCryptPlugin extends Plugin {
425425
return;
426426
}
427427
if (profiles.length === 0) {
428-
this.statusBarItem.setText('🔒 VaultCrypt');
428+
this.statusBarItem.setText('No profiles');
429429
return;
430430
}
431431
const parts = profiles.map(p => (p.isLocked ? '🔒 ' : '🔓 ') + p.name);

src/modals/profile-modals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export class EditProfileModal extends Modal {
216216
this.titleEl.setText("Edit profile");
217217

218218
new Setting(contentEl).setName("Profile name").setDesc(this.profileName);
219-
new Setting(contentEl).setName("KDBX version").setDesc(String(this.config.kdbxVersion));
219+
new Setting(contentEl).setName('Database version').setDesc(String(this.config.kdbxVersion));
220220
new Setting(contentEl).setName("Path").setDesc(this.config.path);
221221

222222
new Setting(contentEl)

src/modals/vault-dir-modals.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class SyncWarningModal extends Modal {
1717
const {contentEl} = this;
1818
const currentDir = this.plugin.settings.general.vaultCryptDir;
1919

20-
this.titleEl.setText('VaultCrypt sync notice');
20+
this.titleEl.setText('Sync notice');
2121

2222
contentEl.createEl('p', {
2323
text: `Your VaultCrypt folder ("${currentDir}") starts with a dot. `
@@ -26,18 +26,18 @@ export class SyncWarningModal extends Modal {
2626
});
2727

2828
contentEl.createEl('p', {
29-
text: 'Would you like to move it to "VaultCrypt" (a visible folder that Obsidian Sync will include)?',
29+
text: 'Would you like to move it to a visible folder so Obsidian Sync can include it?',
3030
});
3131

3232
new Setting(contentEl)
3333
.addButton(btn => btn
34-
.setButtonText('Move to "VaultCrypt"')
34+
.setButtonText('Move to visible folder')
3535
.setCta()
3636
.onClick(async () => {
3737
this.close();
3838
try {
3939
await this.plugin.profileService.moveVaultDir('VaultCrypt');
40-
new Notice('VaultCrypt: directory moved to "VaultCrypt".');
40+
new Notice('Directory moved to visible location.');
4141
} catch {
4242
// moveVaultDir already shows a Notice on failure
4343
}
@@ -87,7 +87,7 @@ export class MoveVaultDirModal extends Modal {
8787
const {contentEl} = this;
8888
const currentDir = this.plugin.settings.general.vaultCryptDir;
8989

90-
this.titleEl.setText('Change VaultCrypt directory');
90+
this.titleEl.setText('Change storage directory');
9191

9292
new Setting(contentEl)
9393
.setName('New directory path')
@@ -101,7 +101,7 @@ export class MoveVaultDirModal extends Modal {
101101

102102
new Setting(contentEl)
103103
.setName('Move existing files')
104-
.setDesc('Move .KDBX databases and other files from the current directory to the new location.')
104+
.setDesc('Move database files and attachments from the current directory to the new location.')
105105
.addToggle(toggle => toggle
106106
.setValue(this.moveFiles)
107107
.onChange(value => {

src/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class VaultCryptSettingTab extends PluginSettingTab {
223223
new Setting(containerEl).setName("Vault").setHeading();
224224

225225
new Setting(containerEl)
226-
.setName('VaultCrypt directory path')
226+
.setName('Storage directory')
227227
.setDesc(`Current: ${this.plugin.settings.general.vaultCryptDir} — Folder where .kdbx databases are stored.`)
228228
.addButton(btn => btn
229229
.setButtonText('Change directory')

0 commit comments

Comments
 (0)