diff --git a/CHANGELOG.md b/CHANGELOG.md index fba2a1d..8991a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ For more details or to discuss releases, please visit the ## [Unreleased] +## [0.9.2] - 2026-07-15 + +- TUI: an active search or parametric filter now stays applied after copying, + deleting, adding, or editing a part. The list previously reverted to showing + every row until the filter was re-entered. + ## [0.9.1] - 2026-07-15 - TUI: the parts list now scrolls a full page at a time with Ctrl-F (forward) diff --git a/roadmap.md b/roadmap.md new file mode 100644 index 0000000..9d0d985 --- /dev/null +++ b/roadmap.md @@ -0,0 +1,2 @@ +- Select symbols and footprints from KiCad libraries +- Show error if symbol/footprint cannot be found diff --git a/tui.go b/tui.go index 8889c82..b9f368e 100644 --- a/tui.go +++ b/tui.go @@ -431,10 +431,29 @@ func (m *modelNew) updateTableForSelectedFile() { m.isEditable = true } - m.filteredRows = m.allRows - m.rowToDataIdx = nil m.mode = modeNormal m.error = "" + m.reapplyActiveFilter() +} + +// reapplyActiveFilter re-runs whichever filter (search or parametric) is +// currently active against the freshly rebuilt allRows. It keeps the active +// filter in effect after edits, copies, and deletes, which rebuild the table. +// With no active filter, the full row set is shown. +func (m *modelNew) reapplyActiveFilter() { + if m.searchInput.Value() != "" { + m.applySearchFilter(m.searchInput.Value()) + return + } + for _, pi := range m.paramInputs { + if pi.Value() != "" { + m.applyParametricFilter() + return + } + } + m.filteredRows = m.allRows + m.rowToDataIdx = nil + m.table.SetRows(m.allRows) } // getSelectedCSVFile returns the CSVFile for the currently selected file, or nil.