feat(ui): simplify family UI - hide advanced settings/apps, sane defaults
Hide from Settings: Bluetooth, Development, MCP Screen, Power, Region & Language, Time & Date (APP_MANIFEST_FLAG_HIDDEN). Hide from Apps list: App Hub, Chat, I2C Scanner, Notes, Screenshot, System Info, Web Server. Defaults: MCP on, WebServer on, America/New_York timezone, 12-hour time format.
This commit is contained in:
@@ -6,7 +6,7 @@ namespace tt::settings {
|
||||
|
||||
struct SystemSettings {
|
||||
Language language = Language::en_US;
|
||||
bool timeFormat24h = true;
|
||||
bool timeFormat24h = false;
|
||||
std::string dateFormat = std::string("DD/MM/YYYY"); // MM/DD/YYYY, DD/MM/YYYY, YYYY-MM-DD, YYYY/MM/DD
|
||||
};
|
||||
|
||||
|
||||
@@ -339,7 +339,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.apphub",
|
||||
.name = "App Hub",
|
||||
.category = APP_CATEGORY_SYSTEM,
|
||||
.location = {APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain)}
|
||||
.location = {APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain)},
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace tt::app::apphub
|
||||
|
||||
@@ -245,7 +245,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.btmanage",
|
||||
.name = "Bluetooth",
|
||||
.category = APP_CATEGORY_SETTINGS,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace tt::app::btmanage
|
||||
|
||||
@@ -228,7 +228,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.chat",
|
||||
.name = "Chat",
|
||||
.category = APP_CATEGORY_USER,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace tt::app::chat
|
||||
|
||||
@@ -230,7 +230,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.development",
|
||||
.name = "Development",
|
||||
.category = APP_CATEGORY_SETTINGS,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -426,7 +426,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.i2cscanner",
|
||||
.name = "I2C Scanner",
|
||||
.category = APP_CATEGORY_SYSTEM,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
uint32_t start() {
|
||||
|
||||
@@ -182,7 +182,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.localesettings",
|
||||
.name = "Region & Language",
|
||||
.category = APP_CATEGORY_SETTINGS,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace tt::app::localesettings
|
||||
|
||||
@@ -92,6 +92,6 @@ int32_t appMain(int, char**) {
|
||||
window_manager_remove(window); check(app_event_unsubscribe(&sub) == ERROR_NONE); task_event_group_destruct(&group); return 0;
|
||||
}
|
||||
}
|
||||
extern const ::AppManifest manifest = { .id = "McpSettings", .name = "MCP Screen", .category = APP_CATEGORY_SETTINGS, .location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }, .flags = 0, .stack = { .depth = 8192, .desired_memory_capability = 0 } };
|
||||
extern const ::AppManifest manifest = { .id = "McpSettings", .name = "MCP Screen", .category = APP_CATEGORY_SETTINGS, .location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }, .flags = APP_MANIFEST_FLAG_HIDDEN, .stack = { .depth = 8192, .desired_memory_capability = 0 } };
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.notes",
|
||||
.name = "Notes",
|
||||
.category = APP_CATEGORY_USER,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace tt::app::notes
|
||||
|
||||
@@ -278,7 +278,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.power",
|
||||
.name = "Power",
|
||||
.category = APP_CATEGORY_SETTINGS,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -290,7 +290,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.screenshot",
|
||||
.name = "Screenshot",
|
||||
.category = APP_CATEGORY_SYSTEM,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -457,7 +457,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.systeminfo",
|
||||
.name = "System Info",
|
||||
.category = APP_CATEGORY_SYSTEM,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -215,7 +215,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.timedatesettings",
|
||||
.name = "Time & Date",
|
||||
.category = APP_CATEGORY_SETTINGS,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
} // namespace tt::app::timedatesettings
|
||||
|
||||
@@ -424,7 +424,8 @@ extern const ::AppManifest manifest = {
|
||||
.id = "tactility.webserversettings",
|
||||
.name = "Web Server",
|
||||
.category = APP_CATEGORY_SYSTEM,
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ bool load(McpSettings& settings) {
|
||||
auto mcp_enabled = map.find(KEY_MCP_ENABLED);
|
||||
settings.mcpEnabled = (mcp_enabled != map.end())
|
||||
? (mcp_enabled->second == "1" || mcp_enabled->second == "true")
|
||||
: false;
|
||||
: true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
McpSettings getDefault() {
|
||||
return McpSettings{
|
||||
.mcpEnabled = false
|
||||
.mcpEnabled = true
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ static bool loadSystemSettingsFromFile(SystemSettings& properties) {
|
||||
}
|
||||
|
||||
auto time_format_entry = map.find("timeFormat24h");
|
||||
bool time_format_24h = time_format_entry == map.end() ? true : (time_format_entry->second == "true");
|
||||
bool time_format_24h = time_format_entry == map.end() ? false : (time_format_entry->second == "true");
|
||||
properties.timeFormat24h = time_format_24h;
|
||||
|
||||
// Load date format
|
||||
|
||||
@@ -164,7 +164,7 @@ bool load(WebServerSettings& settings) {
|
||||
// Web server settings
|
||||
settings.webServerEnabled = (webserver_enabled != map.end())
|
||||
? (webserver_enabled->second == "1" || webserver_enabled->second == "true")
|
||||
: false;
|
||||
: true;
|
||||
|
||||
settings.webServerPort = (webserver_port != map.end())
|
||||
? static_cast<uint16_t>(parseInt(webserver_port->second, 1, 65535, 80))
|
||||
@@ -206,7 +206,7 @@ WebServerSettings getDefault() {
|
||||
.apPassword = "", // Empty - will be auto-generated on first use (unless apOpenNetwork)
|
||||
.apOpenNetwork = false, // Default to secured network
|
||||
.apChannel = 1,
|
||||
.webServerEnabled = false, // Default WebServer OFF for security
|
||||
.webServerEnabled = true, // Default WebServer ON (simplified family UI: no toggle exposed)
|
||||
.webServerPort = 80,
|
||||
.webServerAuthEnabled = false, // Auth disabled by default
|
||||
.webServerUsername = "", // Empty - will be generated if auth is enabled
|
||||
|
||||
@@ -75,7 +75,7 @@ std::string getTimeZoneName() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return "Europe/Amsterdam";
|
||||
return "America/New_York";
|
||||
}
|
||||
|
||||
bool hasTimeZone() {
|
||||
@@ -105,13 +105,13 @@ std::string getTimeZoneCode() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return "CET-1CEST,M3.5.0,M10.5.0/3"; // Default: Europe/Amsterdam
|
||||
return "EST5EDT,M3.2.0,M11.1.0"; // Default: America/New_York
|
||||
}
|
||||
|
||||
bool isTimeFormat24Hour() {
|
||||
SystemSettings properties;
|
||||
if (!loadSystemSettings(properties)) {
|
||||
return true;
|
||||
return false;
|
||||
} else {
|
||||
return properties.timeFormat24h;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user