mirror of
https://github.com/asyouplz/SpeechNote.git
synced 2026-07-22 06:43:33 +00:00
feat: add support section to settings page (#30)
Add a dedicated support section at the bottom of the settings page that includes: - Visual separator to distinguish from other settings - Thank you message to users - "Buy me a coffee" button with CTA styling - Opens support link in new tab This provides users with an easy way to support the plugin development while maintaining a non-intrusive placement. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
23280d82af
commit
67d05c9239
2 changed files with 42 additions and 6 deletions
|
|
@ -78,7 +78,12 @@ export class SettingsTab extends PluginSettingTab {
|
|||
console.log('Creating Advanced section...');
|
||||
this.createAdvancedSection(containerEl);
|
||||
console.log('Advanced section created');
|
||||
|
||||
|
||||
// Support Section
|
||||
console.log('Creating Support section...');
|
||||
this.createSupportSection(containerEl);
|
||||
console.log('Support section created');
|
||||
|
||||
console.log('=== Settings tab rendered successfully ===');
|
||||
console.log('Total child elements:', containerEl.children.length);
|
||||
|
||||
|
|
@ -516,7 +521,7 @@ export class SettingsTab extends PluginSettingTab {
|
|||
|
||||
private createAdvancedSection(containerEl: HTMLElement): void {
|
||||
containerEl.createEl('h3', { text: 'Advanced Settings' });
|
||||
|
||||
|
||||
// Enable cache
|
||||
new Setting(containerEl)
|
||||
.setName('Enable cache')
|
||||
|
|
@ -527,7 +532,7 @@ export class SettingsTab extends PluginSettingTab {
|
|||
this.plugin.settings.enableCache = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
|
||||
// Debug mode
|
||||
new Setting(containerEl)
|
||||
.setName('Debug mode')
|
||||
|
|
@ -537,12 +542,12 @@ export class SettingsTab extends PluginSettingTab {
|
|||
.onChange(async (value) => {
|
||||
this.plugin.settings.debugMode = value;
|
||||
await this.plugin.saveSettings();
|
||||
|
||||
|
||||
if (value) {
|
||||
new Notice('Debug mode enabled. Check console for logs.');
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
// Reset settings button
|
||||
new Setting(containerEl)
|
||||
.setName('Reset to defaults')
|
||||
|
|
@ -557,7 +562,7 @@ export class SettingsTab extends PluginSettingTab {
|
|||
const { DEFAULT_SETTINGS } = await import('../../domain/models/Settings');
|
||||
this.plugin.settings = { ...DEFAULT_SETTINGS };
|
||||
await this.plugin.saveSettings();
|
||||
|
||||
|
||||
// Refresh the display
|
||||
this.display();
|
||||
new Notice('Settings reset to defaults');
|
||||
|
|
@ -565,6 +570,30 @@ export class SettingsTab extends PluginSettingTab {
|
|||
}));
|
||||
}
|
||||
|
||||
private createSupportSection(containerEl: HTMLElement): void {
|
||||
// 구분선 추가
|
||||
containerEl.createEl('hr', { cls: 'speech-to-text-separator' });
|
||||
|
||||
containerEl.createEl('h3', { text: 'Support' });
|
||||
|
||||
// 감사 메시지
|
||||
containerEl.createEl('p', {
|
||||
text: 'Thank you for using Speech to Text! Your support helps keep this plugin free and actively maintained.',
|
||||
cls: 'setting-item-description'
|
||||
});
|
||||
|
||||
// Buy me a coffee 버튼
|
||||
new Setting(containerEl)
|
||||
.setName('Support Development')
|
||||
.setDesc('If you find this plugin helpful, consider buying me a coffee ☕')
|
||||
.addButton(button => button
|
||||
.setButtonText('☕ Buy me a coffee')
|
||||
.setCta()
|
||||
.onClick(() => {
|
||||
window.open('https://buymeacoffee.com/asyouplz', '_blank');
|
||||
}));
|
||||
}
|
||||
|
||||
private maskApiKey(key: string): string {
|
||||
if (!key || key.length < 10) {
|
||||
return '';
|
||||
|
|
|
|||
|
|
@ -3,6 +3,13 @@
|
|||
/* Import settings styles */
|
||||
@import url('./src/ui/settings/settings.css');
|
||||
|
||||
/* Support Section */
|
||||
.speech-to-text-separator {
|
||||
margin: 2em 0 1.5em 0;
|
||||
border: none;
|
||||
border-top: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
|
||||
/* File Picker Modal */
|
||||
.speech-to-text-file-list {
|
||||
max-height: 400px;
|
||||
|
|
|
|||
Loading…
Reference in a new issue