Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

refactor(mobile): drop thisMachineName and the OS hostname helper

dee0b868b64d166
diff --git a/mobile/lib/core/local_hostname.dart b/mobile/lib/core/local_hostname.dart
deleted file mode 100644
index 8d96d271c..000000000
--- a/mobile/lib/core/local_hostname.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-import 'dart:io';
-
-/// The machine's name exactly as the OS gives it, or null when it has none.
-///
-/// Guarded because `localHostname` throws where the OS refuses to answer, and
-/// its callers run inside builds — not a place to take an exception over a
-/// label.
-String? localHostnameOrNull() {
- try {
- final host = Platform.localHostname.trim();
- return host.isEmpty ? null : host;
- } catch (_) {
- return null;
- }
-}
diff --git a/mobile/lib/state/app_state.dart b/mobile/lib/state/app_state.dart
index e79803249..1489be09b 100644
--- a/mobile/lib/state/app_state.dart
+++ b/mobile/lib/state/app_state.dart
@@ -21,7 +21,6 @@ import '../core/config.dart';
import '../core/agent_preference.dart';
import '../core/engine_availability.dart';
import '../core/device_name.dart';
-import '../core/local_hostname.dart';
import '../core/permission_modes.dart';
import '../core/local_git_projects.dart';
import '../core/last_opened_agent.dart';
@@ -3939,24 +3938,6 @@ class AppNotifier extends ChangeNotifier {
return [for (final answer in answers) ?answer];
}
- /// What to call THIS computer wherever a usage figure has to say whose it is.
- ///
- /// The same `displayName` the sidebar prints and `_readMachineUsage` labels
- /// every remote machine with, so a panel listing one local and one remote
- /// account names them in one vocabulary rather than setting a hostname
- /// beside the words "this computer".
- ///
- /// Falls back to the OS hostname when the local machine has not been fetched
- /// yet — the rail can open before `refreshMachines` lands — and to null when
- /// even that is empty, which the caller renders by dropping the caption
- /// rather than printing a blank one.
- String? get thisMachineName {
- for (final state in machineStates.values) {
- if (state.isLocalMachine) return state.machine.displayName;
- }
- return localHostnameOrNull();
- }
-
Future<MachineUsage?> _readMachineUsage(MachineState machine) async {
try {
final reply = await _conn(machine.machine.machineId)