Skip to content

Commit 7490564

Browse files
authored
Merge pull request #648 from multiplex55/codex/rename-todo-widget-to-todos-and-merge-ui
Rename `todo` widget to `todos`, merge burndown UI, and remove unused note widgets
2 parents 71d7809 + 5e3cfec commit 7490564

7 files changed

Lines changed: 81 additions & 306 deletions

File tree

dashboard.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
},
5050
{
5151
"id": "Todos",
52-
"widget": "todo",
52+
"widget": "todos",
5353
"row": 2,
5454
"col": 0,
5555
"row_span": 1,
5656
"col_span": 1
5757
},
5858
{
5959
"id": "Notes",
60-
"widget": "notes_open",
60+
"widget": "notes_recent",
6161
"row": 2,
6262
"col": 1,
6363
"row_span": 1,

src/dashboard/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl Default for DashboardConfig {
118118
slots: vec![
119119
SlotConfig::with_widget("weather_site", 0, 0),
120120
SlotConfig::with_widget("pinned_commands", 0, 1),
121-
SlotConfig::with_widget("todo", 0, 2),
121+
SlotConfig::with_widget("todos", 0, 2),
122122
SlotConfig::with_widget("recent_commands", 1, 0),
123123
SlotConfig::with_widget("frequent_commands", 1, 1),
124124
SlotConfig::with_widget("recent_notes", 1, 2),
@@ -190,16 +190,16 @@ impl DashboardConfig {
190190

191191
fn migrate_todo_widgets(&mut self, registry: &WidgetRegistry, warnings: &mut Vec<String>) {
192192
for slot in &mut self.slots {
193-
let Some(default_settings) = registry.default_settings("todo") else {
193+
let Some(default_settings) = registry.default_settings("todos") else {
194194
continue;
195195
};
196196
match slot.widget.as_str() {
197-
"todo_list" | "todo_summary" => {
197+
"todo" | "todo_list" | "todo_summary" | "todo_burndown" => {
198198
let legacy_name = slot.widget.clone();
199-
slot.widget = "todo".into();
199+
slot.widget = "todos".into();
200200
slot.settings = merge_json(&default_settings, &slot.settings);
201201
warnings.push(format!(
202-
"dashboard widget '{}' migrated to 'todo'",
202+
"dashboard widget '{}' migrated to 'todos'",
203203
legacy_name
204204
));
205205
}

src/dashboard/widgets/mod.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ mod browser_tabs;
1212
mod clipboard_recent;
1313
mod clipboard_snippets;
1414
mod frequent_commands;
15-
mod note_meta;
1615
mod notes_recent;
1716
mod notes_tags;
18-
mod notes_open;
1917
mod now_playing;
2018
mod pinned_commands;
2119
mod pinned_query_results;
@@ -27,7 +25,6 @@ mod recent_notes;
2725
mod snippets_favorites;
2826
mod system_actions;
2927
mod system_status;
30-
mod todo_burndown;
3128
mod todo_focus;
3229
mod todo;
3330
mod weather_site;
@@ -40,10 +37,8 @@ pub use browser_tabs::BrowserTabsWidget;
4037
pub use clipboard_recent::ClipboardRecentWidget;
4138
pub use clipboard_snippets::ClipboardSnippetsWidget;
4239
pub use frequent_commands::FrequentCommandsWidget;
43-
pub use note_meta::NoteMetaWidget;
4440
pub use notes_recent::NotesRecentWidget;
4541
pub use notes_tags::NotesTagsWidget;
46-
pub use notes_open::NotesOpenWidget;
4742
pub use now_playing::NowPlayingWidget;
4843
pub use pinned_commands::PinnedCommandsWidget;
4944
pub use pinned_query_results::PinnedQueryResultsWidget;
@@ -55,7 +50,6 @@ pub use recent_notes::RecentNotesWidget;
5550
pub use snippets_favorites::SnippetsFavoritesWidget;
5651
pub use system_actions::SystemWidget;
5752
pub use system_status::SystemStatusWidget;
58-
pub use todo_burndown::TodoBurndownWidget;
5953
pub use todo_focus::TodoFocusWidget;
6054
pub use todo::TodoWidget;
6155
pub use weather_site::WeatherSiteWidget;
@@ -203,14 +197,6 @@ impl WidgetRegistry {
203197
WidgetFactory::new(PluginHomeWidget::new)
204198
.with_settings_ui(PluginHomeWidget::settings_ui),
205199
);
206-
reg.register(
207-
"notes_open",
208-
WidgetFactory::new(NotesOpenWidget::new).with_settings_ui(NotesOpenWidget::settings_ui),
209-
);
210-
reg.register(
211-
"note_meta",
212-
WidgetFactory::new(NoteMetaWidget::new).with_settings_ui(NoteMetaWidget::settings_ui),
213-
);
214200
reg.register(
215201
"recent_commands",
216202
WidgetFactory::new(RecentCommandsWidget::new)
@@ -222,7 +208,7 @@ impl WidgetRegistry {
222208
.with_settings_ui(FrequentCommandsWidget::settings_ui),
223209
);
224210
reg.register(
225-
"todo",
211+
"todos",
226212
WidgetFactory::new(TodoWidget::new).with_settings_ui(TodoWidget::settings_ui),
227213
);
228214
reg.register(
@@ -309,11 +295,6 @@ impl WidgetRegistry {
309295
"todo_focus",
310296
WidgetFactory::new(TodoFocusWidget::new).with_settings_ui(TodoFocusWidget::settings_ui),
311297
);
312-
reg.register(
313-
"todo_burndown",
314-
WidgetFactory::new(TodoBurndownWidget::new)
315-
.with_settings_ui(TodoBurndownWidget::settings_ui),
316-
);
317298
reg.register(
318299
"quick_tools",
319300
WidgetFactory::new(QuickToolsWidget::new).with_settings_ui(QuickToolsWidget::settings_ui),

src/dashboard/widgets/note_meta.rs

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/dashboard/widgets/notes_open.rs

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)