Compare commits

..

No commits in common. "ab398304779c6962b9c3319f444b05917b93c75a" and "2abb8547a51b5731c91602cea9ab0b4539806a8d" have entirely different histories.

4 changed files with 29 additions and 42 deletions

View file

@ -1,8 +0,0 @@
Protocolo de inicio - Lee estos archivos EN PARALELO:
1. CLAUDE.md (contexto de este proyecto específico)
2. /mnt/cello2/arno/re/recode/teamdocs/NORMAS_ESENCIALES.md (normas de trabajo, rutas, compilación)
3. /mnt/cello2/arno/re/recode/teamdocs/LAST_UPDATE.md (cambios recientes del equipo)
4. /mnt/cello2/arno/re/recode/teamdocs/agenda/2025-12_diciembre.md (trabajo del mes)
Después de leer, confirma brevemente qué sabes del proyecto y pregunta en qué puedes ayudar.

5
.gitignore vendored
View file

@ -11,8 +11,3 @@ zig-out/
# OS # OS
.DS_Store .DS_Store
Thumbs.db Thumbs.db
# Claude Code settings (ignorar), pero commands se versionan
.claude/settings*.json
.claude/*.json
!.claude/commands/

View file

@ -4,7 +4,6 @@
//! fuente de datos (WHO, DOC, etc.) //! fuente de datos (WHO, DOC, etc.)
const std = @import("std"); const std = @import("std");
const Style = @import("../../core/style.zig");
/// Dirección de ordenación /// Dirección de ordenación
pub const SortDirection = enum { pub const SortDirection = enum {
@ -126,15 +125,15 @@ pub const VirtualListConfig = struct {
colors: ?Colors = null, colors: ?Colors = null,
pub const Colors = struct { pub const Colors = struct {
background: Style.Color = Style.Color.rgb(255, 255, 255), background: u32 = 0xFFFFFFFF,
header_background: Style.Color = Style.Color.rgb(224, 224, 224), header_background: u32 = 0xFFE0E0E0,
row_normal: Style.Color = Style.Color.rgb(255, 255, 255), row_normal: u32 = 0xFFFFFFFF,
row_alternate: Style.Color = Style.Color.rgb(248, 248, 248), row_alternate: u32 = 0xFFF8F8F8,
row_selected: Style.Color = Style.Color.rgb(0, 120, 212), row_selected: u32 = 0xFF0078D4,
row_selected_unfocus: Style.Color = Style.Color.rgb(208, 208, 208), row_selected_unfocus: u32 = 0xFFD0D0D0,
text: Style.Color = Style.Color.rgb(0, 0, 0), text: u32 = 0xFF000000,
text_selected: Style.Color = Style.Color.rgb(255, 255, 255), text_selected: u32 = 0xFFFFFFFF,
border: Style.Color = Style.Color.rgb(204, 204, 204), border: u32 = 0xFFCCCCCC,
}; };
}; };

View file

@ -245,7 +245,7 @@ fn drawHeader(
const header_h = config.row_height; const header_h = config.row_height;
// Header background // Header background
ctx.pushCommand(Command.rect( ctx.pushCommand(Command.fill(
bounds.x, bounds.x,
bounds.y, bounds.y,
bounds.w, bounds.w,
@ -291,11 +291,11 @@ fn drawHeader(
// Column separator // Column separator
x += @as(i32, @intCast(col.width)); x += @as(i32, @intCast(col.width));
ctx.pushCommand(Command.rect(x - 1, bounds.y, 1, header_h, colors.border)); ctx.pushCommand(Command.fill(x - 1, bounds.y, 1, header_h, colors.border));
} }
// Bottom border // Bottom border
ctx.pushCommand(Command.rect( ctx.pushCommand(Command.fill(
bounds.x, bounds.x,
bounds.y + @as(i32, @intCast(header_h)) - 1, bounds.y + @as(i32, @intCast(header_h)) - 1,
bounds.w, bounds.w,
@ -332,7 +332,7 @@ fn drawRows(
const is_selected = list_state.selected_id != null and row.id == list_state.selected_id.?; const is_selected = list_state.selected_id != null and row.id == list_state.selected_id.?;
const is_alternate = global_idx % 2 == 1; const is_alternate = global_idx % 2 == 1;
const bg_color: Style.Color = if (is_selected) const bg_color: u32 = if (is_selected)
if (list_state.has_focus) colors.row_selected else colors.row_selected_unfocus if (list_state.has_focus) colors.row_selected else colors.row_selected_unfocus
else if (is_alternate) else if (is_alternate)
colors.row_alternate colors.row_alternate
@ -340,7 +340,7 @@ fn drawRows(
colors.row_normal; colors.row_normal;
// Row background // Row background
ctx.pushCommand(Command.rect( ctx.pushCommand(Command.fill(
content_bounds.x, content_bounds.x,
row_y, row_y,
content_bounds.w, content_bounds.w,
@ -380,7 +380,7 @@ fn drawFooter(
list_state: *VirtualListState, list_state: *VirtualListState,
) void { ) void {
// Background // Background
ctx.pushCommand(Command.rect( ctx.pushCommand(Command.fill(
bounds.x, bounds.x,
bounds.y, bounds.y,
bounds.w, bounds.w,
@ -435,7 +435,7 @@ fn drawScrollbar(
// Scrollbar track // Scrollbar track
const track_x = bounds.x + @as(i32, @intCast(bounds.w - scrollbar_w)); const track_x = bounds.x + @as(i32, @intCast(bounds.w - scrollbar_w));
const track_y = bounds.y + @as(i32, @intCast(header_h)); const track_y = bounds.y + @as(i32, @intCast(header_h));
ctx.pushCommand(Command.rect(track_x, track_y, scrollbar_w, content_h, colors.row_alternate)); ctx.pushCommand(Command.fill(track_x, track_y, scrollbar_w, content_h, colors.row_alternate));
// Thumb size and position // Thumb size and position
const visible_ratio = @as(f32, @floatFromInt(visible_rows)) / @as(f32, @floatFromInt(total_rows)); const visible_ratio = @as(f32, @floatFromInt(visible_rows)) / @as(f32, @floatFromInt(total_rows));
@ -446,7 +446,7 @@ fn drawScrollbar(
const thumb_y = track_y + @as(i32, @intFromFloat(scroll_ratio * @as(f32, @floatFromInt(content_h - thumb_h)))); const thumb_y = track_y + @as(i32, @intFromFloat(scroll_ratio * @as(f32, @floatFromInt(content_h - thumb_h))));
// Draw thumb // Draw thumb
ctx.pushCommand(Command.rect(track_x + 2, thumb_y, scrollbar_w - 4, thumb_h, colors.border)); ctx.pushCommand(Command.fill(track_x + 2, thumb_y, scrollbar_w - 4, thumb_h, colors.border));
} }
// ============================================================================= // =============================================================================
@ -464,17 +464,18 @@ fn handleKeyboard(
_ = provider; _ = provider;
_ = result; _ = result;
// Usar navKeyPressed() para soportar key repeat (tecla mantenida pulsada) if (ctx.input.keyPressed(.up)) {
if (ctx.input.navKeyPressed()) |key| { list_state.moveUp();
switch (key) { } else if (ctx.input.keyPressed(.down)) {
.up => list_state.moveUp(), list_state.moveDown(visible_rows);
.down => list_state.moveDown(visible_rows), } else if (ctx.input.keyPressed(.page_up)) {
.page_up => list_state.pageUp(visible_rows), list_state.pageUp(visible_rows);
.page_down => list_state.pageDown(visible_rows, total_rows), } else if (ctx.input.keyPressed(.page_down)) {
.home => list_state.goToStart(), list_state.pageDown(visible_rows, total_rows);
.end => list_state.goToEnd(visible_rows, total_rows), } else if (ctx.input.keyPressed(.home)) {
else => {}, list_state.goToStart();
} } else if (ctx.input.keyPressed(.end)) {
list_state.goToEnd(visible_rows, total_rows);
} }
} }