chore: cleanup

portion of #5
This commit is contained in:
Jeremy Wall 2024-11-26 17:09:57 -05:00
parent fd52a40587
commit eee260824a
3 changed files with 1 additions and 7 deletions

View File

@ -23,8 +23,6 @@ pub struct Book {
pub(crate) model: Model, pub(crate) model: Model,
pub current_sheet: u32, pub current_sheet: u32,
pub location: crate::ui::Address, pub location: crate::ui::Address,
// TODO(zaphar): Because the ironcalc model is sparse we need to track our render size
// separately
} }
impl Book { impl Book {

View File

@ -162,8 +162,6 @@ impl<'ws> Workspace<'ws> {
/// Handle input in our ui loop. /// Handle input in our ui loop.
pub fn handle_input(&mut self, evt: Event) -> Result<Option<ExitCode>> { pub fn handle_input(&mut self, evt: Event) -> Result<Option<ExitCode>> {
// TODO(jwall): We probably want to separate this out into
// a pure function so we can script various testing scenarios.
if let Event::Key(key) = evt { if let Event::Key(key) = evt {
let result = match self.state.modality() { let result = match self.state.modality() {
Modality::Navigate => self.handle_navigation_input(key)?, Modality::Navigate => self.handle_navigation_input(key)?,

View File

@ -60,7 +60,7 @@ impl<'book> Viewport<'book> {
} }
pub(crate) fn get_visible_rows(&self, height: u16, state: &ViewportState) -> Vec<usize> { pub(crate) fn get_visible_rows(&self, height: u16, state: &ViewportState) -> Vec<usize> {
// TODO(jeremy): For now the row default height is 1. We'll have // NOTE(jeremy): For now the row default height is 1. We'll have
// to adjust that if this changes. // to adjust that if this changes.
let mut length = 1; let mut length = 1;
let start_row = std::cmp::min(self.selected.row, state.prev_corner.row); let start_row = std::cmp::min(self.selected.row, state.prev_corner.row);
@ -189,8 +189,6 @@ impl<'book> Viewport<'book> {
let count = if i == 26 { 1 } else { (i / 26) + 1 }; let count = if i == 26 { 1 } else { (i / 26) + 1 };
Cell::new(COLNAMES[(i - 1) % 26].repeat(count)) Cell::new(COLNAMES[(i - 1) % 26].repeat(count))
})); }));
// TODO(zaphar): We should calculate the length from the length of the stringified version of the
// row indexes.
let mut col_constraints = vec![Constraint::Length(5)]; let mut col_constraints = vec![Constraint::Length(5)];
col_constraints.extend(constraints.into_iter()); col_constraints.extend(constraints.into_iter());
Ok(Table::new(rows, col_constraints) Ok(Table::new(rows, col_constraints)