Ungoing refactoring

This commit is contained in:
2026-02-04 18:47:40 +01:00
parent 2097997372
commit 6cf9d2eec1
19 changed files with 749 additions and 451 deletions

View File

@@ -22,7 +22,7 @@ use crate::state::{
MuteState, OptionsState, PanelState, PatternField, PatternPropsField, PatternsNav,
PlaybackState, ProjectState, StagedChange, StagedPropChange, UiState,
};
use crate::views::{dict_view, help_view};
use crate::model::{categories, docs};
const STEPS_PER_PAGE: usize = 32;
@@ -1240,11 +1240,11 @@ impl App {
};
}
AppCommand::HelpNextTopic(n) => {
let count = help_view::topic_count();
let count = docs::topic_count();
self.ui.help_topic = (self.ui.help_topic + n) % count;
}
AppCommand::HelpPrevTopic(n) => {
let count = help_view::topic_count();
let count = docs::topic_count();
self.ui.help_topic = (self.ui.help_topic + count - (n % count)) % count;
}
AppCommand::HelpScrollDown(n) => {
@@ -1264,7 +1264,7 @@ impl App {
}
AppCommand::HelpSearchInput(c) => {
self.ui.help_search_query.push(c);
if let Some((topic, line)) = help_view::find_match(&self.ui.help_search_query) {
if let Some((topic, line)) = docs::find_match(&self.ui.help_search_query) {
self.ui.help_topic = topic;
self.ui.help_scrolls[topic] = line;
}
@@ -1274,7 +1274,7 @@ impl App {
if self.ui.help_search_query.is_empty() {
return;
}
if let Some((topic, line)) = help_view::find_match(&self.ui.help_search_query) {
if let Some((topic, line)) = docs::find_match(&self.ui.help_search_query) {
self.ui.help_topic = topic;
self.ui.help_scrolls[topic] = line;
}
@@ -1291,11 +1291,11 @@ impl App {
};
}
AppCommand::DictNextCategory => {
let count = dict_view::category_count();
let count = categories::category_count();
self.ui.dict_category = (self.ui.dict_category + 1) % count;
}
AppCommand::DictPrevCategory => {
let count = dict_view::category_count();
let count = categories::category_count();
self.ui.dict_category = (self.ui.dict_category + count - 1) % count;
}
AppCommand::DictScrollDown(n) => {