From 0b517d7e1626e64c85093c26d2155fcd0e6b4fff Mon Sep 17 00:00:00 2001 From: James Maes Date: Thu, 15 Oct 2026 14:12:56 -0500 Subject: [PATCH] fix(nav): a distinct icon per table and a storage app icon Every db_perf_ table used the speed icon, which repeats in the nav and clashes with web performance (kof22's nav icon uniqueness check). Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + .../metadata/DbPerfMetaData.java | 29 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3cb7bd..fdcea70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes are documented here. This project follows Keep a Changelog a ## [Unreleased] ### Fixed +- Each table has its own icon (the app icon is now `storage`), so nav entries are distinguishable and do not repeat icons used elsewhere. - Home tables keep at most four columns with plain headers (readable at every width): secondary facts such as calls and mean time, the session's query text, and a unit's kind and top table move into a second line of the first cell. ### Added diff --git a/src/main/java/com/kingsrook/qbits/dbperformance/metadata/DbPerfMetaData.java b/src/main/java/com/kingsrook/qbits/dbperformance/metadata/DbPerfMetaData.java index 20265aa..f2ac119 100644 --- a/src/main/java/com/kingsrook/qbits/dbperformance/metadata/DbPerfMetaData.java +++ b/src/main/java/com/kingsrook/qbits/dbperformance/metadata/DbPerfMetaData.java @@ -23,6 +23,7 @@ package com.kingsrook.qbits.dbperformance.metadata; import java.util.ArrayList; import java.util.List; +import java.util.Map; import com.kingsrook.qbits.dbperformance.DbPerfPermissions; import com.kingsrook.qbits.dbperformance.DbPerfQBitConfig; import com.kingsrook.qbits.dbperformance.model.DbPerfActivitySample; @@ -669,7 +670,7 @@ public final class DbPerfMetaData child(instance, "db_perf_statement", "db_perf_finding", "statementId"); child(instance, "db_perf_table_stat", "db_perf_finding", "tableStatId"); child(instance, "db_perf_statement", "db_perf_explain", "statementId"); - QAppMetaData app = new QAppMetaData().withName(config.getAppName()).withLabel("Database Performance").withIcon(new QIcon("speed")) + QAppMetaData app = new QAppMetaData().withName(config.getAppName()).withLabel("Database Performance").withIcon(new QIcon("storage")) .withPermissionRules(DbPerfPermissions.rules(config.getPermissionBaseName() + ".view")) .withSection(new QAppSection().withName("data").withLabel("Data").withIcon(new QIcon("table_rows")) .withTables(List.of("db_perf_finding", "db_perf_statement", "db_perf_table_stat", "db_perf_index_stat", "db_perf_snapshot", "db_perf_settings", "db_perf_rule"))); @@ -681,12 +682,36 @@ public final class DbPerfMetaData } + /******************************************************************************* + ** A distinct icon per table, so nav entries are told apart at a glance. + *******************************************************************************/ + static final Map TABLE_ICONS = Map.ofEntries( + Map.entry("db_perf_finding", "tips_and_updates"), + Map.entry("db_perf_statement", "query_stats"), + Map.entry("db_perf_table_stat", "grid_on"), + Map.entry("db_perf_index_stat", "bookmarks"), + Map.entry("db_perf_snapshot", "photo_camera"), + Map.entry("db_perf_settings", "settings_suggest"), + Map.entry("db_perf_rule", "playlist_add_check"), + Map.entry("db_perf_explain", "device_hub"), + Map.entry("db_perf_query_snapshot", "timeline"), + Map.entry("db_perf_query_daily", "calendar_month"), + Map.entry("db_perf_table_snapshot", "stacked_line_chart"), + Map.entry("db_perf_table_daily", "date_range"), + Map.entry("db_perf_activity_sample", "monitor_heart"), + Map.entry("db_perf_connection_sample", "lan"), + Map.entry("db_perf_attribution", "hub"), + Map.entry("db_perf_attribution_daily", "event_note"), + Map.entry("db_perf_repeat_pattern", "repeat")); + + + /******************************************************************************* ** Common storage, permissions and write guard. *******************************************************************************/ private static QTableMetaData base(DbPerfQBitConfig config, String name, String label, Class entity) throws QException { - QTableMetaData table = new QTableMetaData().withName(name).withLabel(label).withIcon(new QIcon("speed")) + QTableMetaData table = new QTableMetaData().withName(name).withLabel(label).withIcon(new QIcon(TABLE_ICONS.getOrDefault(name, "table_rows"))) .withBackendName(config.getBackendName()).withBackendDetails(new RDBMSTableBackendDetails().withTableName(name)) .withPrimaryKeyField("id").withFieldsFromEntity(entity) .withPermissionRules(DbPerfPermissions.rules(config.getPermissionBaseName() + ".view")); -- 2.54.0