Skip to content

Commit

Permalink
fix: fix time span settings with identical names colliding
Browse files Browse the repository at this point in the history
  • Loading branch information
Kageetai committed Nov 28, 2023
1 parent 2571ceb commit a6285a6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "journal-review",
"name": "Journal Review",
"version": "2.0.7",
"version": "2.0.8",
"minAppVersion": "0.15.0",
"description": "Review your daily notes on their anniversaries, like \"what happened today last year\".",
"author": "Kageetai",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-plugin-journal-review",
"version": "2.0.7",
"version": "2.0.8",
"description": "Review your daily notes on their anniversaries, like \"what happened today last year\"\n\n",
"main": "main.js",
"scripts": {
Expand Down
21 changes: 13 additions & 8 deletions src/settingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,25 @@ export class SettingsTab extends PluginSettingTab {
const timeSpanContainer = container.createEl("li");

new Setting(timeSpanContainer)
.setName(getTimeSpanTitle({ number, unit, recurring }))
.setName(`Time span #${index + 1}`)
.setDesc(getTimeSpanTitle({ number, unit, recurring }))
.addSlider((slider) =>
slider
.setValue(number)
.setLimits(1, getMaxTimeSpan(unit), 1)
.setDynamicTooltip()
.onChange(
debounce((value) => {
this.plugin.settings.timeSpans[
index
].number = value;
this.plugin.saveSettings();
this.display();
}, DEBOUNCE_DELAY),
debounce(
(value) => {
this.plugin.settings.timeSpans[
index
].number = value;
this.plugin.saveSettings();
this.display();
},
DEBOUNCE_DELAY,
true,
),
),
)
.addDropdown((dropdown) =>
Expand Down
13 changes: 13 additions & 0 deletions src/styles-settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,18 @@
gap: 1rem;
padding-top: 0;
border-top: none;

/* hide setting name */
& .setting-item-name {
display: none;
}

/* display description instead */
& .setting-item-description {
color: var(--text-normal);
font-size: var(--font-ui-medium);
padding-top: 0;
line-height: var(--line-height-normal);
}
}
}
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"2.0.4": "0.15.0",
"2.0.5": "0.15.0",
"2.0.6": "0.15.0",
"2.0.7": "0.15.0"
"2.0.7": "0.15.0",
"2.0.8": "0.15.0"
}

0 comments on commit a6285a6

Please sign in to comment.