iOS/Sources/App/Settings/DatabaseExplorer
Copilot b3888c527e
Improve database explorer column ordering for better readability (#4182)
## Summary
Database explorer in settings now displays priority columns first (`id`,
`entityId`, `serverId`, `name`, `areaId`, `uniqueId`) followed by
remaining columns alphabetically, improving information density and
scannability.

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
N/A - Backend sorting logic only, UI layout unchanged

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes

**Implementation:**
- Added private `Dictionary` extension with `sortedKeys()` method for
`[String: String]`
- Applied to both list view (first 3 columns) and detail view (all
columns)
- Priority keys maintain specified order; remaining keys sorted
alphabetically

**Before:**
```swift
ForEach(row.keys.sorted(), id: \.self) { key in
    // Keys sorted alphabetically: areaId, entityId, id, name, other, serverId
}
```

**After:**
```swift
ForEach(row.sortedKeys(), id: \.self) { key in
    // Keys sorted by priority: id, entityId, serverId, name, areaId, other
}
```

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> In database explorer inside settings, improve the information
readability, prefer displaying table columns named "id", "entityId,
"serverId", "name", "areaId, "uniqueId" first


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/home-assistant/iOS/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
2026-01-08 10:08:27 +00:00
..