feat(core): appstate

This commit is contained in:
2025-05-19 08:48:50 +02:00
parent 4eda4d335b
commit cbeed4003a
14 changed files with 454 additions and 103 deletions

View File

@@ -0,0 +1,17 @@
pub fn handle(action: Action, appState: *AppState) !void {
switch (action) {
.GoUp => {
if (appState.currentTab.currentLocation) |currentLocation| {
const parent = currentLocation.item.parent;
if (parent) |p| {
try appState.currentTab.setCurrentLocation(.{ .path = p.path.path });
} else return error.NoParent;
} else return error.NoCurrentLocation;
},
.Enter => unreachable,
}
}
const Action = @import("action.zig").Action;
const AppState = @import("../app_state.zig").AppState;
const RootProvider = @import("../provider/root.zig").RootProvider;