fix filtered-tab selection adjustments on project load

This commit is contained in:
Ryan Fleury
2026-05-13 16:01:00 -07:00
parent d207398934
commit ab4a084c9c
4 changed files with 27 additions and 4 deletions
+2 -1
View File
@@ -62,7 +62,7 @@ str8_lit_comp(""),
str8_lit_comp(""),
};
RD_VocabInfo rd_vocab_info_table[358] =
RD_VocabInfo rd_vocab_info_table[359] =
{
{str8_lit_comp("type_view"), str8_lit_comp("type_views"), str8_lit_comp("Type View"), str8_lit_comp("Type Views"), RD_IconKind_Binoculars},
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
@@ -115,6 +115,7 @@ RD_VocabInfo rd_vocab_info_table[358] =
{str8_lit_comp("vtx"), str8_lit_comp("vtxs"), str8_lit_comp("Vertex Buffer"), str8_lit_comp("Vertex Buffers"), RD_IconKind_Null},
{str8_lit_comp("vtx_size"), str8_lit_comp("vtx_sizes"), str8_lit_comp("Vertex Buffer Size"), str8_lit_comp("Vertex Buffer Sizes"), RD_IconKind_Null},
{str8_lit_comp("label"), str8_lit_comp("labels"), str8_lit_comp("Label"), str8_lit_comp("Labels"), RD_IconKind_Null},
{str8_lit_comp("name"), str8_lit_comp("names"), str8_lit_comp("Name"), str8_lit_comp("Names"), RD_IconKind_Null},
{str8_lit_comp("thread"), str8_lit_comp("threads"), str8_lit_comp("Thread"), str8_lit_comp("Threads"), RD_IconKind_Thread},
{str8_lit_comp("threads"), str8_lit_comp(""), str8_lit_comp("Threads"), str8_lit_comp(""), RD_IconKind_Threads},
{str8_lit_comp("process"), str8_lit_comp("processes"), str8_lit_comp("Process"), str8_lit_comp("Processes"), RD_IconKind_Scheduler},
+1 -1
View File
@@ -602,7 +602,7 @@ Z(getting_started)\
C_LINKAGE_BEGIN
extern String8 rd_tab_fast_path_view_name_table[25];
extern String8 rd_tab_fast_path_query_name_table[25];
extern RD_VocabInfo rd_vocab_info_table[358];
extern RD_VocabInfo rd_vocab_info_table[359];
extern RD_NameSchemaInfo rd_name_schema_info_table[39];
extern String8 rd_reg_slot_code_name_table[49];
extern Rng1U64 rd_reg_slot_range_table[49];
+1
View File
@@ -140,6 +140,7 @@ RD_VocabTable:
{vtx _ "Vertex Buffer" _ Null }
{vtx_size _ "Vertex Buffer Size" _ Null }
{label _ "Label" _ Null }
{name _ "Name" _ Null }
{thread _ "Thread" _ Thread }
{threads "" "Threads" "" Threads }
{process processes "Process" "Processes" Scheduler }
+22 -1
View File
@@ -10553,6 +10553,7 @@ rd_frame(void)
CFG_PanelTree panel_tree = cfg_panel_tree_from_cfg(scratch.arena, window);
for(CFG_PanelNode *p = panel_tree.root; p != &cfg_nil_panel_node; p = cfg_panel_node_rec__depth_first_pre(panel_tree.root, p).next)
{
CFG_Node *first_unfiltered_tab = &cfg_nil_node;
for(CFG_NodePtrNode *n = p->tabs.first; n != 0; n = n->next)
{
CFG_Node *tab = n->v;
@@ -10560,8 +10561,16 @@ rd_frame(void)
{
continue;
}
if(first_unfiltered_tab == &cfg_nil_node)
{
first_unfiltered_tab = tab;
}
rd_view_state_from_cfg(tab);
}
if(p->selected_tab == &cfg_nil_node)
{
rd_cmd(RD_CmdKind_FocusTab, .panel = p->cfg->id, .tab = first_unfiltered_tab->id);
}
}
}
scratch_end(scratch);
@@ -12691,7 +12700,7 @@ rd_frame(void)
break;
}
}
rd_cmd(RD_CmdKind_FocusTab, .tab = fallback_tab->id);
rd_cmd(RD_CmdKind_FocusTab, .panel = panel->cfg->id, .tab = fallback_tab->id);
}
}
}
@@ -13408,6 +13417,10 @@ rd_frame(void)
{
CFG_Node *tab = cfg_node_from_id(rd_regs()->tab);
CFG_Node *panel = tab->parent;
if(panel == &cfg_nil_node)
{
panel = cfg_node_from_id(rd_regs()->panel);
}
CFG_PanelTree panel_tree = cfg_panel_tree_from_cfg(scratch.arena, panel);
CFG_PanelNode *panel_node = cfg_panel_node_from_tree_cfg(panel_tree.root, panel);
CFG_Node *selection_cfg = &cfg_nil_node;
@@ -13417,6 +13430,7 @@ rd_frame(void)
if(selection_cfg == &cfg_nil_node)
{
selection_cfg = tab_selection_cfg;
cfg_node_unhook(rd_state->cfg, n->v, selection_cfg);
}
else for(CFG_Node *s = tab_selection_cfg; s != &cfg_nil_node; s = cfg_node_child_from_string(n->v, str8_lit("selected")))
{
@@ -13428,7 +13442,14 @@ rd_frame(void)
selection_cfg = cfg_node_alloc(rd_state->cfg);
cfg_node_equip_string(rd_state->cfg, selection_cfg, str8_lit("selected"));
}
if(tab != &cfg_nil_node)
{
cfg_node_insert_child(rd_state->cfg, tab, &cfg_nil_node, selection_cfg);
}
else
{
cfg_node_release(rd_state->cfg, selection_cfg);
}
}break;
case RD_CmdKind_NextTab:
{