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 the per-pane composer flag that nothing shows

dee4c4365d6e045
diff --git a/mobile/lib/state/app_state.dart b/mobile/lib/state/app_state.dart
index 2dbe8480b..1edc2e82b 100644
--- a/mobile/lib/state/app_state.dart
+++ b/mobile/lib/state/app_state.dart
@@ -912,7 +912,7 @@ class AppNotifier extends ChangeNotifier {
id: _nextPaneId++,
machineId: entry.machineId,
agentId: entry.agentId,
- )..composerVisible = entry.composerVisible,
+ ),
),
);
}
@@ -939,7 +939,7 @@ class AppNotifier extends ChangeNotifier {
id: _nextPaneId++,
machineId: entry.machineId,
agentId: entry.agentId,
- )..composerVisible = entry.composerVisible,
+ ),
);
restored.panes.add(pane);
if (entry.pinnedSlot != null) {
@@ -983,11 +983,11 @@ class AppNotifier extends ChangeNotifier {
p.machineId == agent.machineId && p.agentId == agent.agentId,
)
.firstOrNull ??
- (TerminalPane(
+ TerminalPane(
id: _nextPaneId++,
machineId: agent.machineId,
agentId: agent.agentId,
- )..composerVisible = agent.composerVisible);
+ );
if (!target.panes.contains(pane)) {
final restoreManual =
agent.manualLayout != null &&
@@ -1380,17 +1380,6 @@ class AppNotifier extends ChangeNotifier {
bool isAgentInPane(String machineId, String agentId) =>
paneOfAgent(machineId, agentId) != null;
- /// Show or hide one tile's composer textbox, and remember the choice.
- void toggleComposer(int paneId) {
- for (final pane in panes) {
- if (pane.id != paneId) continue;
- pane.composerVisible = !pane.composerVisible;
- _persistLayout();
- notifyListeners();
- return;
- }
- }
-
void focusPane(int paneId, {bool reveal = false}) {
if (!panes.any((pane) => pane.id == paneId)) return;
final moved = focusedPaneId != paneId;
@@ -6589,14 +6578,11 @@ class AppNotifier extends ChangeNotifier {
final key = '${entry.machineId}\u0000${entry.agentId}';
final pane = pool.putIfAbsent(
key,
- () =>
- TerminalPane(
- id: _nextPaneId++,
- machineId: entry.machineId,
- agentId: entry.agentId,
- )
- ..composerVisible = entry.composerVisible
- ..pinnedSlot = entry.pinnedSlot,
+ () => TerminalPane(
+ id: _nextPaneId++,
+ machineId: entry.machineId,
+ agentId: entry.agentId,
+ )..pinnedSlot = entry.pinnedSlot,
);
if (!swarm.panes.contains(pane)) {
swarm.panes.add(pane);
@@ -6679,12 +6665,10 @@ class AppNotifier extends ChangeNotifier {
for (final entry in entries) {
panes.add(
TerminalPane(
- id: _nextPaneId++,
- machineId: entry.machineId,
- agentId: entry.agentId,
- )
- ..composerVisible = entry.composerVisible
- ..pinnedSlot = entry.pinnedSlot,
+ id: _nextPaneId++,
+ machineId: entry.machineId,
+ agentId: entry.agentId,
+ )..pinnedSlot = entry.pinnedSlot,
);
}
// The saved order already puts everything where it was left, so this is
diff --git a/mobile/lib/state/swarm.dart b/mobile/lib/state/swarm.dart
index 901faddb7..8baed7ae4 100644
--- a/mobile/lib/state/swarm.dart
+++ b/mobile/lib/state/swarm.dart
@@ -107,7 +107,6 @@ class Swarm {
PaneLayoutEntry(
machineId: p.machineId,
agentId: p.agentId!,
- composerVisible: p.composerVisible,
pinnedSlot: pinnedSlots[p.id],
).toJson(),
],
@@ -134,7 +133,6 @@ class ClosedAgent extends ClosedWork {
index = swarm.panes.indexOf(pane),
machineId = pane.machineId,
agentId = pane.agentId!,
- composerVisible = pane.composerVisible,
pinnedSlot = swarm.pinnedSlots[pane.id],
manualLayout = swarm.manualLayout,
remainingAgents = List.unmodifiable([
@@ -146,7 +144,7 @@ class ClosedAgent extends ClosedWork {
final String swarmId, swarmName, machineId, machineName, agentId, name;
final String? engine;
final int index;
- final bool composerVisible, zoomed;
+ final bool zoomed;
final int? pinnedSlot;
final PaneArrangement? manualLayout;
final List<(String, String?)> remainingAgents;
@@ -176,7 +174,6 @@ class ClosedSwarm extends ClosedWork {
(
machineId: pane.machineId,
agentId: pane.agentId,
- composerVisible: pane.composerVisible,
pinnedSlot: swarm.pinnedSlots[pane.id],
),
]),
@@ -192,10 +189,7 @@ class ClosedSwarm extends ClosedWork {
final int zoom;
final Map<int, PanePreset> presets;
final Map<String, PaneArrangement> paneSizes;
- final List<
- ({String machineId, String? agentId, bool composerVisible, int? pinnedSlot})
- >
- panes;
+ final List<({String machineId, String? agentId, int? pinnedSlot})> panes;
final String? replacementId;
bool replacesUntouchedWelcome(Swarm swarm) =>
diff --git a/mobile/lib/state/terminal_pane.dart b/mobile/lib/state/terminal_pane.dart
index 014393e7f..5f3320527 100644
--- a/mobile/lib/state/terminal_pane.dart
+++ b/mobile/lib/state/terminal_pane.dart
@@ -67,13 +67,6 @@ class TerminalPane {
bool get isPinned => pinnedSlot != null;
- /// Whether this tile shows the composer textbox under its terminal.
- ///
- /// Only ever consulted for a remote machine — that is the one where typing straight into the
- /// pane pays a network round trip per keystroke. Off by default, and remembered, so the choice
- /// survives a restart the way the rest of the layout does.
- bool composerVisible = false;
-
/// Whether this tile was opened AHEAD of anyone looking at it — the phone's
/// pager attaching the agents beside the one on screen, so a swipe lands on
/// output rather than on "Attaching…". See `AppNotifier.warmAgentPane`.
@@ -94,19 +87,16 @@ class PaneLayoutEntry {
const PaneLayoutEntry({
required this.machineId,
required this.agentId,
- this.composerVisible = false,
this.pinnedSlot,
});
final String machineId;
final String agentId;
- final bool composerVisible;
final int? pinnedSlot;
Map<String, dynamic> toJson() => {
'machineId': machineId,
'agentId': agentId,
- 'composerVisible': composerVisible,
// Absent for the tiles nobody pinned, which is nearly all of them.
'pinnedSlot': ?pinnedSlot,
};
@@ -117,14 +107,9 @@ class PaneLayoutEntry {
final agentId = raw['agentId'];
if (machineId is! String || machineId.isEmpty) return null;
if (agentId is! String || agentId.isEmpty) return null;
- final composer = raw['composerVisible'];
return PaneLayoutEntry(
machineId: machineId,
agentId: agentId,
- // Absent means a layout written before the composer existed. Those default to OFF, matching a
- // tile the user has never had an opinion about — never to ON, which would read as a setting
- // they chose.
- composerVisible: composer is bool ? composer : false,
// A negative or absurd slot is read as "not pinned" rather than clamped:
// a pin is a place someone chose, and inventing a different one for them
// is worse than forgetting it.