Skip to content

Commit a4236fa

Browse files
committed
refactor: Extract Settings screen components and enhance UI
This commit refactors the `SettingsScreen` by extracting its UI components into separate, reusable composables within a new `components` package. This improves code organization, modularity, and maintainability. The "Data & Privacy" section has been temporarily commented out, and the website link has been updated for better accuracy. Additionally, the `readableFileSize` utility now explicitly uses `Locale.US` to ensure consistent formatting. ### Key Changes: * **Component Extraction (`presentation/screen/setting/components`):** * `SettingsSection`: A wrapper for grouping related settings under a title. * `PathSettingItem`: A card for displaying and managing a file path setting, including validation status, reset, and edit actions. * `LinkSettingItem`: A clickable card for settings that link to external URLs. * `SwitchSettingItem`: A card with a label, description, and a toggle switch. * `SocialLinkButton`: A dedicated button for social media links. * `PathPickerDialog`: A dialog for selecting directory paths, using `filekit` for the file picker UI. * **UI & Logic Updates (`SettingsScreen.kt`):** * The `SettingsScreen` now uses the newly extracted composable components, simplifying its structure. * The "Data & Privacy" section, which contained the crash reporting toggle, has been commented out. * The value for the "Website" link has been updated to the full URL. * **Utility Enhancement (`Utils.kt`):** * The `readableFileSize` function now uses `Locale.US` to ensure consistent decimal formatting across different system locales.
1 parent 305b5a4 commit a4236fa

File tree

9 files changed

+497
-367
lines changed

9 files changed

+497
-367
lines changed

composeApp/src/jvmMain/kotlin/com/meet/dev/analyzer/core/utility/Utils.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import io.github.z4kn4fein.semver.VersionFormatException
77
import io.github.z4kn4fein.semver.toVersion
88
import java.awt.Desktop
99
import java.io.File
10+
import java.util.Locale
1011
import kotlin.math.log10
1112
import kotlin.math.pow
1213

@@ -84,6 +85,7 @@ object Utils {
8485
val base = 1000.0 // Decimal (1000): 6.33 GB Binary (1024): 5.90 GB
8586
val digitGroups = (log10(bytes.toDouble()) / log10(base)).toInt()
8687
return String.format(
88+
Locale.US,
8789
"%.2f %s",
8890
bytes / base.pow(digitGroups.toDouble()),
8991
units[digitGroups]

0 commit comments

Comments
 (0)