From 898091136ad3417ed6951ce823c54905db332465 Mon Sep 17 00:00:00 2001 From: hami9 Date: Wed, 30 Sep 2026 14:01:56 +0330 Subject: [PATCH] Shorten the profile badge so project names stay readable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a 360dp phone the badge took so much of the card that names were cut to "Tasks SQ..." and "Local Web Da...". The badge now carries a short label — Python, Telegram, HTTP API, Static Web, SQLite — and the full profile name stays where there is room for it, in the card description and in the project settings. Co-Authored-By: Claude Opus 5 --- .../com/runcode/app/domain/models/Models.kt | 18 ++++++++++++------ .../com/runcode/app/ui/screens/HomeScreen.kt | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/runcode/app/domain/models/Models.kt b/app/src/main/java/com/runcode/app/domain/models/Models.kt index 31b715f..eef02fe 100644 --- a/app/src/main/java/com/runcode/app/domain/models/Models.kt +++ b/app/src/main/java/com/runcode/app/domain/models/Models.kt @@ -1,11 +1,17 @@ package com.runcode.app.domain.models -enum class ProjectProfile(val id: String, val displayName: String, val defaultExtension: String) { - PYTHON_SCRIPT("python_script", "Python Script", "py"), - TELEGRAM_BOT("telegram_bot", "Telegram Bot", "py"), - PYTHON_HTTP("python_http", "Python HTTP API", "py"), - STATIC_WEB("static_web", "Static Website", "html"), - SQLITE_APP("sqlite_app", "SQLite Database App", "py") +enum class ProjectProfile( + val id: String, + val displayName: String, + /** Fits the badge on a project card; a phone is about 360dp wide. */ + val shortName: String, + val defaultExtension: String +) { + PYTHON_SCRIPT("python_script", "Python Script", "Python", "py"), + TELEGRAM_BOT("telegram_bot", "Telegram Bot", "Telegram", "py"), + PYTHON_HTTP("python_http", "Python HTTP API", "HTTP API", "py"), + STATIC_WEB("static_web", "Static Website", "Static Web", "html"), + SQLITE_APP("sqlite_app", "SQLite Database App", "SQLite", "py") } enum class RestartPolicy { diff --git a/app/src/main/java/com/runcode/app/ui/screens/HomeScreen.kt b/app/src/main/java/com/runcode/app/ui/screens/HomeScreen.kt index 9fdded8..5142aa2 100644 --- a/app/src/main/java/com/runcode/app/ui/screens/HomeScreen.kt +++ b/app/src/main/java/com/runcode/app/ui/screens/HomeScreen.kt @@ -467,7 +467,7 @@ fun ProfileBadge(profile: ProjectProfile) { .padding(horizontal = 6.dp, vertical = 2.dp) ) { Text( - profile.displayName, + profile.shortName, fontSize = 9.sp, fontWeight = FontWeight.Bold, color = textColor,