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.

Merge batch 11-04 b1000: #2876 (#2898)

0xken15e9370630a84d
diff --git a/desktop/lib/super_tabs/activity.dart b/desktop/lib/super_tabs/activity.dart
index f3f1d80f5..0efb80463 100644
--- a/desktop/lib/super_tabs/activity.dart
+++ b/desktop/lib/super_tabs/activity.dart
@@ -23,6 +23,7 @@ class SuperTabNeed {
this.at,
this.decision,
this.mention,
+ this.privateProjectName,
});
final SuperTabNeedKind kind;
@@ -30,12 +31,16 @@ class SuperTabNeed {
final String id;
/// What the row says: the question, `<agent> is waiting on you`, or
- /// `<author> mentioned you in # <project>`.
+ /// `<author> mentioned you in # <project>`; a private project carries its
+ /// name separately for the lock mark.
final String title;
final String conversationId;
final DateTime? at;
final SuperTabDecision? decision;
final SuperTabMention? mention;
+
+ /// When a mention names a private project, its lock replaces the textual #.
+ final String? privateProjectName;
}
/// The reader's Activity in one Swarm: the one place for everything new for
@@ -82,6 +87,12 @@ class SuperTabActivity extends ChangeNotifier {
List<SuperTabNeed> get needsYou {
final snapshot = _snapshot;
if (snapshot == null) return const [];
+ bool isPrivateProject(String projectId) =>
+ snapshot.projects
+ .where((p) => p.id == projectId)
+ .firstOrNull
+ ?.isPrivate ==
+ true;
final epoch = DateTime.fromMillisecondsSinceEpoch(0);
final asked = decisions.open;
final decided = {for (final d in asked) d.conversationId};
@@ -114,10 +125,14 @@ class SuperTabActivity extends ChangeNotifier {
kind: SuperTabNeedKind.mention,
id: 'mention:${m.id}',
title:
- '${people[m.leadId]?.shownName ?? m.leadName} mentioned you in # ${m.projectName}',
+ '${people[m.leadId]?.shownName ?? m.leadName} mentioned you in '
+ '${isPrivateProject(m.projectId) ? '' : '# ${m.projectName}'}',
conversationId: m.conversationId,
at: m.createdAt,
mention: m,
+ privateProjectName: isPrivateProject(m.projectId)
+ ? m.projectName
+ : null,
),
];
}
diff --git a/desktop/lib/super_tabs/activity_view.dart b/desktop/lib/super_tabs/activity_view.dart
index 8f9446788..bdeadc80b 100644
--- a/desktop/lib/super_tabs/activity_view.dart
+++ b/desktop/lib/super_tabs/activity_view.dart
@@ -12,6 +12,7 @@ import 'decisions_view.dart';
import 'machine_status.dart' show superTabAgoShort;
import 'model.dart';
import 'notifications.dart';
+import 'private_project_lock.dart';
import 'section_heading.dart';
/// Activity, the one place for everything new for the reader (Quiet Swarm
@@ -116,6 +117,7 @@ class _SuperTabActivityViewState extends State<SuperTabActivityView> {
glyph: need.kind == SuperTabNeedKind.mention ? '@' : null,
mark: need.kind == SuperTabNeedKind.mention ? null : AppIcons.circleDot,
title: need.title,
+ privateProjectName: need.privateProjectName,
unread: true,
trailing: switch (need.kind) {
SuperTabNeedKind.decision => 'Answer',
@@ -245,6 +247,7 @@ class _Row extends StatefulWidget {
this.mark,
this.glyph,
required this.title,
+ this.privateProjectName,
required this.unread,
required this.trailing,
required this.onTap,
@@ -253,6 +256,7 @@ class _Row extends StatefulWidget {
final IconData? mark;
final String? glyph;
final String title;
+ final String? privateProjectName;
final bool unread;
final String trailing;
final VoidCallback onTap;
@@ -312,12 +316,33 @@ class _RowState extends State<_Row> {
),
),
Expanded(
- child: Text(
- widget.title,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: style,
- ),
+ child: widget.privateProjectName == null
+ ? Text(
+ widget.title,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: style,
+ )
+ : Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(text: widget.title),
+ WidgetSpan(
+ alignment: PlaceholderAlignment.middle,
+ child: PrivateProjectLock(
+ size: 14,
+ color: style.color,
+ ),
+ ),
+ TextSpan(
+ text: ' ${widget.privateProjectName}',
+ ),
+ ],
+ ),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: style,
+ ),
),
const SizedBox(width: grid.AppDesktop.groupGap),
if (action != null && _hovered)
diff --git a/desktop/lib/super_tabs/buddies.dart b/desktop/lib/super_tabs/buddies.dart
index a5eb04023..d5e56869d 100644
--- a/desktop/lib/super_tabs/buddies.dart
+++ b/desktop/lib/super_tabs/buddies.dart
@@ -7,6 +7,7 @@ import '../shared/widgets/app_dialog.dart';
import '../shared/widgets/app_select_field.dart';
import '../state/app_state.dart';
import '../widgets/desktop_chrome.dart';
+import 'private_project_lock.dart';
import 'controller.dart';
import 'buddy_machines.dart';
import 'buddy_model.dart';
@@ -609,14 +610,15 @@ class SuperTabBuddyBar extends StatelessWidget {
final project = c.snapshot!.projects
.where((p) => p.id == chat.projectId)
.firstOrNull;
+ final access = agent.machineOwnerId == c.accountId
+ ? 'only you can read this chat'
+ : '${buddyPersonName(c, agent.machineOwnerId)} can see its terminal';
final where = [
'${buddyEngineName(agent.engine)} on $machine',
if (project != null) '#${project.name}',
// The one Buddy for the whole Swarm (spec 2026-10-31-one-buddy-per-swarm).
if (chat.isSwarmBuddyChat) 'reads all your projects',
- agent.machineOwnerId == c.accountId
- ? 'only you can read this chat'
- : '${buddyPersonName(c, agent.machineOwnerId)} can see its terminal',
+ access,
].join(' · ');
final busy = !c.canWrite || c.saving || c.hasPendingAction;
return Padding(
@@ -635,6 +637,27 @@ class SuperTabBuddyBar extends StatelessWidget {
machine: machine,
rest: where,
)
+ else if (project?.isPrivate == true)
+ Text.rich(
+ TextSpan(
+ style: DesktopChrome.metadata(),
+ children: [
+ TextSpan(
+ text: '${buddyEngineName(agent.engine)} on $machine · ',
+ ),
+ WidgetSpan(
+ alignment: PlaceholderAlignment.middle,
+ child: PrivateProjectLock(
+ size: 12,
+ color: DesktopChrome.muted,
+ ),
+ ),
+ TextSpan(text: ' ${project!.name} · $access'),
+ ],
+ ),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ )
else
Text(where, style: DesktopChrome.metadata()),
if (agent.downSince != null)
diff --git a/desktop/lib/super_tabs/decisions_view.dart b/desktop/lib/super_tabs/decisions_view.dart
index c0705c992..9399928f7 100644
--- a/desktop/lib/super_tabs/decisions_view.dart
+++ b/desktop/lib/super_tabs/decisions_view.dart
@@ -6,6 +6,7 @@ import '../shared/theme/app_theme.dart' as grid;
import '../widgets/desktop_chrome.dart';
import 'decisions.dart';
import 'model.dart';
+import 'private_project_lock.dart';
import 'section_heading.dart';
import '../widgets/laid_out_list.dart';
@@ -51,22 +52,46 @@ class SuperTabDecisionList extends StatelessWidget {
// chat, and is named so (as notifications.dart does).
final c = d.controller;
final hidden = c.snapshot?.conversation(decision.conversationId);
- final place = hidden == null || !c.hiddenByBuddies(hidden)
- ? decision.conversationTitle
- : '#${decision.projectName}';
- yield _note(
- '${decision.askerName} asked $count '
- '${count == 1 ? 'question' : 'questions'} · '
- '${decision.projectName} · $place',
+ final legacyChannel = hidden != null && c.hiddenByBuddies(hidden);
+ final project = c.snapshot?.projects
+ .where((p) => p.id == decision.projectId)
+ .firstOrNull;
+ final privateProject = legacyChannel && project?.isPrivate == true;
+ yield _noteRich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text:
+ '${decision.askerName} asked $count '
+ '${count == 1 ? 'question' : 'questions'} · '
+ '${decision.projectName} · ',
+ ),
+ if (privateProject)
+ WidgetSpan(
+ alignment: PlaceholderAlignment.middle,
+ child: PrivateProjectLock(
+ size: 12,
+ color: DesktopChrome.muted,
+ ),
+ ),
+ TextSpan(
+ text: legacyChannel
+ ? '${privateProject ? ' ' : '#'}${decision.projectName}'
+ : decision.conversationTitle,
+ ),
+ ],
+ ),
);
}
yield SuperTabDecisionCard(decisions: d, decision: decision);
}
}
- static Widget _note(String text) => Padding(
+ static Widget _note(String text) => _noteRich(TextSpan(text: text));
+
+ static Widget _noteRich(TextSpan text) => Padding(
padding: const EdgeInsets.fromLTRB(16, 6, 16, 4),
- child: Text(text, style: DesktopChrome.metadata()),
+ child: Text.rich(text, style: DesktopChrome.metadata()),
);
}
diff --git a/desktop/lib/super_tabs/notifications.dart b/desktop/lib/super_tabs/notifications.dart
index 308646e92..c569e6946 100644
--- a/desktop/lib/super_tabs/notifications.dart
+++ b/desktop/lib/super_tabs/notifications.dart
@@ -11,6 +11,7 @@ import 'controller.dart';
import 'identity.dart';
import 'machine_status.dart' show superTabAgo;
import 'model.dart';
+import 'private_project_lock.dart';
import 'section_heading.dart';
import '../widgets/laid_out_list.dart';
@@ -366,9 +367,16 @@ class _SuperTabNotificationsState extends State<SuperTabNotifications> {
// chat, and is named so; every other place by its title.
final c = widget.mentions.controller;
final hidden = c.snapshot?.conversation(mention.conversationId);
- final place = hidden == null || !c.hiddenByBuddies(hidden)
+ final legacyChannel = hidden != null && c.hiddenByBuddies(hidden);
+ final project = c.snapshot?.projects
+ .where((p) => p.id == mention.projectId)
+ .firstOrNull;
+ final privateProject = legacyChannel && project?.isPrivate == true;
+ final place = !legacyChannel
? mention.conversationTitle
- : '#${c.snapshot?.projects.where((p) => p.id == mention.projectId).firstOrNull?.name ?? mention.projectName}';
+ : privateProject
+ ? project!.name
+ : '#${project?.name ?? mention.projectName}';
// A person who tagged the reader is named as they are now.
final person = c.snapshot?.people
.where((p) => p.id == mention.leadId)
@@ -429,8 +437,21 @@ class _SuperTabNotificationsState extends State<SuperTabNotifications> {
],
],
),
- Text(
- '${mention.projectName} · $place',
+ Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(text: '${mention.projectName} · '),
+ if (privateProject)
+ WidgetSpan(
+ alignment: PlaceholderAlignment.middle,
+ child: PrivateProjectLock(
+ size: 12,
+ color: DesktopChrome.muted,
+ ),
+ ),
+ TextSpan(text: privateProject ? ' $place' : place),
+ ],
+ ),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: DesktopChrome.metadata(),
diff --git a/desktop/lib/super_tabs/private_project_lock.dart b/desktop/lib/super_tabs/private_project_lock.dart
new file mode 100644
index 000000000..303ff80ff
--- /dev/null
+++ b/desktop/lib/super_tabs/private_project_lock.dart
@@ -0,0 +1,20 @@
+import 'package:flutter/material.dart';
+
+import '../shared/theme/app_icons.dart';
+
+/// The channel mark and its accessible name for a private project.
+class PrivateProjectLock extends StatelessWidget {
+ const PrivateProjectLock({super.key, this.size = 14, this.color});
+
+ final double size;
+ final Color? color;
+
+ @override
+ Widget build(BuildContext context) => Tooltip(
+ message: 'Private project',
+ child: Semantics(
+ label: 'Private project',
+ child: Icon(AppIcons.lock, size: size, color: color),
+ ),
+ );
+}
diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dart
index f8b89b667..ef1bd4290 100644
--- a/desktop/lib/super_tabs/project_sidebar.dart
+++ b/desktop/lib/super_tabs/project_sidebar.dart
@@ -33,6 +33,7 @@ import 'task_groups.dart';
import 'task_status.dart';
import 'workgroup_name.dart';
import 'project_github.dart';
+import 'private_project_lock.dart';
import '../widgets/laid_out_list.dart';
import 'swarm_type.dart';
@@ -213,16 +214,18 @@ class ProjectSidebar extends StatelessWidget {
),
);
- /// A project, or the Product Managers' conversation, reads as a channel: "# openharness".
- Widget _channelMark() => Text(
- '#',
- textAlign: TextAlign.center,
- style: SwarmType.sidebar(
- compact: compact,
- color: DesktopChrome.muted,
- medium: true,
- ),
- );
+ /// A project reads as a channel; a private one keeps its lock in this mark slot.
+ Widget _channelMark({required bool isPrivate}) => isPrivate
+ ? PrivateProjectLock(size: 14, color: DesktopChrome.muted)
+ : Text(
+ '#',
+ textAlign: TextAlign.center,
+ style: SwarmType.sidebar(
+ compact: compact,
+ color: DesktopChrome.muted,
+ medium: true,
+ ),
+ );
void _openBuddyChat(String projectId) => onOpenBuddyChat != null
? onOpenBuddyChat!(projectId)
@@ -377,7 +380,7 @@ class ProjectSidebar extends StatelessWidget {
SizedBox(
width: _iconColumn,
child: project != null
- ? _channelMark()
+ ? _channelMark(isPrivate: project.isPrivate)
: label != null
? Icon(
AppIcons.bot,
@@ -513,17 +516,6 @@ class ProjectSidebar extends StatelessWidget {
),
),
],
- if (project?.isPrivate == true) ...[
- const SizedBox(width: 8),
- Tooltip(
- message: 'Private project',
- child: Icon(
- AppIcons.lock,
- size: 14,
- color: DesktopChrome.muted,
- ),
- ),
- ],
],
),
),
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index 53fff7938..029f72ef4 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -29,6 +29,7 @@ import 'recording_notice.dart';
import 'profile_actions.dart';
import 'live_card.dart';
import 'personal_projects.dart';
+import 'private_project_lock.dart';
import 'pull_request_facts.dart';
import 'pull_requests.dart';
import 'attachment_upload.dart' show kSuperTabFolderZipMaxBytes;
@@ -2232,6 +2233,7 @@ class _SuperTabViewState extends State<SuperTabView>
/// [SuperTabWorkgroupName].
Widget _title(SuperTabConversation? group) {
final style = DesktopChrome.text(medium: true);
+ final project = group == null ? null : c.snapshot?.projectFor(group.id);
final name = _manageOpen
? 'Manage'
: _notificationsVisible
@@ -2241,7 +2243,7 @@ class _SuperTabViewState extends State<SuperTabView>
? c.snapshot!.name
: 'Choose a project'
: c.snapshot!.isProjectLead(group.id)
- ? '# ${c.snapshot!.projectFor(group.id)!.name}'
+ ? '${project!.isPrivate ? '' : '# '}${project.name}'
// An older Buddy chat in a project says which, as the menu that opens
// it does; the one Buddy chat is the sidebar's # buddy.
: c.isEarlierBuddyChat(group)
@@ -2260,6 +2262,26 @@ class _SuperTabViewState extends State<SuperTabView>
!_listViewHoldsThePane) {
return _projectMenu(group, name, style);
}
+ if (group != null &&
+ c.snapshot!.isProjectLead(group.id) &&
+ project!.isPrivate) {
+ return Text.rich(
+ TextSpan(
+ children: [
+ WidgetSpan(
+ alignment: PlaceholderAlignment.middle,
+ child: PrivateProjectLock(
+ size: AppIcons.inlineSize,
+ color: DesktopChrome.muted,
+ ),
+ ),
+ TextSpan(text: ' $name', style: style),
+ ],
+ ),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ );
+ }
return Text(
name,
maxLines: 1,
@@ -2273,7 +2295,8 @@ class _SuperTabViewState extends State<SuperTabView>
String _messageHint(SuperTabConversation group) {
final snapshot = c.snapshot!;
if (snapshot.isProjectLead(group.id)) {
- return 'Message #${snapshot.projectFor(group.id)!.name}';
+ final project = snapshot.projectFor(group.id)!;
+ return 'Message ${project.isPrivate ? project.name : '#${project.name}'}';
}
if (_buddyName(group) case final buddy?) {
// A Buddy's name is its person's and long: a phone's one line says Buddy.
@@ -2780,9 +2803,15 @@ class _SuperTabViewState extends State<SuperTabView>
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
+ if (project.isPrivate)
+ PrivateProjectLock(
+ size: AppIcons.inlineSize,
+ color: DesktopChrome.muted,
+ ),
+ if (project.isPrivate) const SizedBox(width: 4),
Flexible(
child: Text(
- name,
+ project.isPrivate ? project.name : name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: style,
diff --git a/desktop/test/super_tab_activity_view_test.dart b/desktop/test/super_tab_activity_view_test.dart
index 7c8c24e41..a509c28ab 100644
--- a/desktop/test/super_tab_activity_view_test.dart
+++ b/desktop/test/super_tab_activity_view_test.dart
@@ -129,6 +129,30 @@ void main() {
});
});
+ testWidgets('a private project mention uses the lock channel mark', (
+ tester,
+ ) async {
+ await withClock(Clock.fixed(_now), () async {
+ final server = full();
+ (server.state['projects'] as List).first['visibility'] = 'private';
+ final activity = await loaded(tester, server);
+ await show(tester, activity);
+
+ final row = find.byKey(
+ const ValueKey('super-activity-row-mention:mention-1'),
+ );
+ final need = activity.needsYou.singleWhere(
+ (need) => need.id == 'mention:mention-1',
+ );
+ expect(need.title, 'Wren mentioned you in ');
+ expect(need.privateProjectName, 'web-project');
+ expect(
+ find.descendant(of: row, matching: find.byIcon(AppIcons.lock)),
+ findsOneWidget,
+ );
+ });
+ });
+
for (final width in [900.0, 360.0]) {
testWidgets('every row stays one line at $width px with long names', (
tester,
diff --git a/desktop/test/super_tab_buddies_test.dart b/desktop/test/super_tab_buddies_test.dart
index efc33991f..3cdafd1ce 100644
--- a/desktop/test/super_tab_buddies_test.dart
+++ b/desktop/test/super_tab_buddies_test.dart
@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/core/models.dart';
+import 'package:harness/shared/theme/app_icons.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/state/app_state.dart';
import 'package:harness/state/harness_activity.dart';
@@ -410,6 +411,32 @@ void main() {
},
);
+ testWidgets('a private Buddy project uses a lock in its project label', (
+ tester,
+ ) async {
+ final server = buddySwarm();
+ server.state['projects'] = [
+ projectFixture('lead', 'Pilot', 'lead', visibility: 'private'),
+ ];
+ giveBuddy(server);
+ final c = await show(tester, server);
+
+ await tester.tap(buddyEntry);
+ await tester.pumpAndSettle();
+
+ final bar = find.byKey(const ValueKey('super-buddy-bar'));
+ expect(
+ find.descendant(of: bar, matching: find.byIcon(AppIcons.lock)),
+ findsOneWidget,
+ );
+ expect(
+ find.descendant(of: bar, matching: find.textContaining('#Pilot')),
+ findsNothing,
+ );
+
+ await close(tester, c);
+ });
+
testWidgets(
'the reader\'s Buddy row says where it runs; other people\'s Buddies appear nowhere',
(tester) async {
diff --git a/desktop/test/super_tab_private_legacy_channel_test.dart b/desktop/test/super_tab_private_legacy_channel_test.dart
new file mode 100644
index 000000000..9b6f7a94c
--- /dev/null
+++ b/desktop/test/super_tab_private_legacy_channel_test.dart
@@ -0,0 +1,72 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/shared/theme/app_icons.dart';
+import 'package:harness/super_tabs/decisions.dart';
+import 'package:harness/super_tabs/decisions_view.dart';
+import 'package:harness/super_tabs/notifications.dart';
+
+import 'support/super_tab_fixture.dart';
+
+ConversationServer privateLegacyChat() {
+ final server = ConversationServer();
+ server.state['projects'] = [
+ projectFixture('lead', 'web-project', 'lead', visibility: 'private'),
+ ];
+ server.state['conversations'] = [
+ {
+ ...conversationFixture('lead', 'Old Chat with PM'),
+ 'audience': {
+ 'people': [
+ {'id': 'owner'},
+ ],
+ },
+ },
+ ];
+ return server;
+}
+
+void main() {
+ testWidgets('private legacy decision channel uses a lock mark', (
+ tester,
+ ) async {
+ final server = privateLegacyChat()..ask(['Ship it?']);
+ final controller = server.controller();
+ addTearDown(controller.dispose);
+ await controller.refresh();
+ final decisions = SuperTabDecisions.of(controller);
+ await decisions.load();
+
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Scaffold(body: SuperTabDecisionList(decisions: decisions)),
+ ),
+ );
+ await tester.pumpAndSettle();
+
+ expect(find.byIcon(AppIcons.lock), findsOneWidget);
+ expect(find.textContaining('#web-project'), findsNothing);
+ });
+
+ testWidgets('private legacy mention channel uses a lock mark', (
+ tester,
+ ) async {
+ final server = privateLegacyChat()..tag('message-1');
+ final controller = server.controller();
+ addTearDown(controller.dispose);
+ await controller.refresh();
+ final mentions = SuperTabMentions.of(controller);
+ await mentions.load();
+
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Scaffold(
+ body: SuperTabNotifications(mentions: mentions, onOpen: (_) {}),
+ ),
+ ),
+ );
+ await tester.pumpAndSettle();
+
+ expect(find.byIcon(AppIcons.lock), findsOneWidget);
+ expect(find.textContaining('#web-project'), findsNothing);
+ });
+}
diff --git a/desktop/test/super_tab_project_rows_shots_test.dart b/desktop/test/super_tab_project_rows_shots_test.dart
index 2ee8ad32a..414204437 100644
--- a/desktop/test/super_tab_project_rows_shots_test.dart
+++ b/desktop/test/super_tab_project_rows_shots_test.dart
@@ -4,10 +4,12 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/super_tabs/attention.dart';
import 'package:harness/super_tabs/view.dart';
import 'support/capture.dart';
import 'support/humans_fixture.dart';
+import 'support/super_tab_fixture.dart';
/// Set to a folder to write the project rows' pictures there: a project
/// collapsed and expanded, in both themes.
@@ -26,12 +28,28 @@ void main() {
tester.view.physicalSize = const Size(2000, 1400);
addTearDown(tester.view.reset);
final server = humansSwarm();
+ server.state['projects'] = [
+ projectFixture('lead', 'public project', 'lead'),
+ projectFixture(
+ 'private',
+ 'private project',
+ 'private-lead',
+ visibility: 'private',
+ ),
+ ];
+ (server.state['conversations'] as List).add({
+ ...conversationFixture('private-lead', 'Private Lead'),
+ 'projectId': 'private',
+ });
addNumberedWorkgroups(server, 11);
final controller = server.controller(
account: 'peer',
initial: {'tabId': 'tab', 'accountId': 'peer', 'selectedId': 'lead'},
);
await controller.refresh();
+ server.tag('sidebar-shot-mention', conversationId: 'lead');
+ await controller.refresh();
+ await SuperTabAttention.of(controller).mentions.load();
// Unread, so the project's dot shows beside its chevron.
server.append('New work', conversationId: 'g11');
await controller.refresh();
diff --git a/desktop/test/super_tab_quiet_polish_test.dart b/desktop/test/super_tab_quiet_polish_test.dart
index 0e1ea38fe..721b02bbe 100644
--- a/desktop/test/super_tab_quiet_polish_test.dart
+++ b/desktop/test/super_tab_quiet_polish_test.dart
@@ -68,7 +68,7 @@ void main() {
);
});
- testWidgets('a private project with mentions keeps its number and lock on '
+ testWidgets('a private project keeps its leading lock and mention number '
'one line, and its row its height', (tester) async {
final server = swarm()..followedThreads = null;
(server.state['projects'] as List).first['visibility'] = 'private';
@@ -77,7 +77,7 @@ void main() {
final number = tester.getCenter(_key('super-mentions-lead'));
final lock = tester.getCenter(find.byIcon(AppIcons.lock).first);
expect((number.dy - lock.dy).abs(), lessThan(2));
- expect(lock.dx, greaterThan(number.dx));
+ expect(lock.dx, lessThan(number.dx));
expect(tester.takeException(), isNull);
});
diff --git a/desktop/test/super_tab_sidebar_test.dart b/desktop/test/super_tab_sidebar_test.dart
index be946bfbc..4cc09183e 100644
--- a/desktop/test/super_tab_sidebar_test.dart
+++ b/desktop/test/super_tab_sidebar_test.dart
@@ -9,6 +9,7 @@ import 'package:harness/shortcuts/app_keymap.dart';
import 'package:harness/state/swarm_catalog.dart';
import 'package:harness/state/app_state.dart';
import 'package:harness/super_tabs/controller.dart';
+import 'package:harness/super_tabs/attention.dart';
import 'package:harness/super_tabs/machines.dart';
import 'package:harness/super_tabs/manage_page.dart';
import 'package:harness/super_tabs/model.dart';
@@ -70,6 +71,7 @@ Future<void> pumpSidebar(
controller: controller,
app: app,
needsHuman: (_) => 0,
+ attention: SuperTabAttention.of(controller),
onSelect: controller.select,
onNewProject: onNewProject ?? () {},
onNotifications: onNotifications ?? () {},
@@ -154,6 +156,67 @@ Future<SuperTabController> projectSidebar(ConversationServer server) async {
}
void main() {
+ testWidgets(
+ 'private projects use a leading lock and keep notifications at the right',
+ (tester) async {
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ final app = createApp(connected: true);
+ addTearDown(app.dispose);
+ final server = ConversationServer();
+ final controller = await projectSidebar(server);
+ server.tag('message-1', conversationId: 'lead');
+ await controller.refresh();
+ final attention = SuperTabAttention.of(controller);
+ await attention.mentions.load();
+ await controller.setNotify('empty-lead', SuperTabNotify.muted);
+ await pumpSidebar(tester, controller, app);
+
+ final privateRow = find.byKey(const ValueKey('super-group-empty-lead'));
+ final privateLock = inRow(
+ 'super-group-empty-lead',
+ find.byIcon(AppIcons.lock),
+ );
+ final privateName = inRow(
+ 'super-group-empty-lead',
+ find.text('sample-project'),
+ );
+ final publicName = inRow('super-group-lead', find.text('web-project'));
+ final badge = inRow(
+ 'super-group-lead',
+ find.byKey(const ValueKey('super-mentions-lead')),
+ );
+ final muted = inRow(
+ 'super-group-empty-lead',
+ find.byKey(const ValueKey('super-muted-empty-lead')),
+ );
+
+ expect(privateRow, findsOneWidget);
+ expect(privateLock, findsOneWidget);
+ expect(
+ inRow('super-group-empty-lead', find.byTooltip('Private project')),
+ findsOneWidget,
+ );
+ expect(inRow('super-group-empty-lead', find.text('#')), findsNothing);
+ expect(inRow('super-group-lead', find.text('#')), findsOneWidget);
+ expect(badge, findsOneWidget);
+ expect(muted, findsOneWidget);
+ expect(
+ tester.getCenter(privateLock).dx,
+ lessThan(tester.getCenter(privateName).dx),
+ );
+ expect(
+ tester.getCenter(badge).dx,
+ greaterThan(tester.getCenter(publicName).dx),
+ );
+ expect(
+ tester.getCenter(muted).dx,
+ greaterThan(tester.getCenter(privateName).dx),
+ );
+
+ await disposeSidebar(tester, controller);
+ },
+ );
+
for (final scale in [1.0, 2.0]) {
testWidgets(
'flat navigation shares text and selection bounds; a project row '
@@ -337,11 +400,17 @@ void main() {
reason: '${order[i - 1]} above ${order[i]}',
);
}
- for (final (key, name) in [
- ('empty-lead', 'sample-project'),
- ('lead', 'web-project'),
+ for (final (key, name, isPrivate) in [
+ ('empty-lead', 'sample-project', true),
+ ('lead', 'web-project', false),
]) {
- expect(inRow('super-group-$key', find.text('#')), findsOneWidget);
+ expect(
+ inRow(
+ 'super-group-$key',
+ isPrivate ? find.byIcon(AppIcons.lock) : find.text('#'),
+ ),
+ findsOneWidget,
+ );
expect(inRow('super-group-$key', find.text(name)), findsOneWidget);
}
expect(find.byKey(const ValueKey('super-group-leads')), findsNothing);
diff --git a/desktop/test/super_tab_view_test.dart b/desktop/test/super_tab_view_test.dart
index 6f28e45ca..c29637661 100644
--- a/desktop/test/super_tab_view_test.dart
+++ b/desktop/test/super_tab_view_test.dart
@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/shared/theme/app_icons.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/super_tabs/model.dart';
import 'package:harness/super_tabs/controller.dart';
@@ -434,6 +435,57 @@ void main() {
controller.dispose();
});
+ testWidgets('a private project uses its lock in the conversation header', (
+ tester,
+ ) async {
+ await tester.binding.setSurfaceSize(const Size(1100, 700));
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ final server = ConversationServer();
+ server.state['projects'] = [
+ projectFixture('lead', 'Pilot', 'lead', visibility: 'private'),
+ ];
+ final controller = server.controller();
+ await controller.refresh();
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Scaffold(
+ body: SuperTabView(
+ controller: controller,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Test Mac',
+ ),
+ ),
+ ),
+ );
+ await tester.pumpAndSettle();
+
+ final header = find.byKey(const ValueKey('super-project-menu'));
+ expect(find.text('# Pilot'), findsNothing);
+ expect(
+ find.descendant(of: header, matching: find.text('Pilot')),
+ findsOneWidget,
+ );
+ expect(
+ find.descendant(of: header, matching: find.byIcon(AppIcons.lock)),
+ findsOneWidget,
+ );
+ expect(
+ tester
+ .widget<TextField>(
+ find.byKey(const ValueKey('super-message-composer')),
+ )
+ .decoration
+ ?.hintText,
+ 'Message Pilot',
+ );
+
+ await tester.pumpWidget(const SizedBox());
+ await controller.flush();
+ controller.dispose();
+ });
+
for (final rename in [true]) {
testWidgets(
'${rename ? 'Rename' : 'New group'} clears its form when account access ends',
diff --git a/docs/plans/2026-11-04-private-project-channel-mark-plan.md b/docs/plans/2026-11-04-private-project-channel-mark-plan.md
new file mode 100644
index 000000000..f93449d35
--- /dev/null
+++ b/docs/plans/2026-11-04-private-project-channel-mark-plan.md
@@ -0,0 +1,58 @@
+# Private Project Channel Mark Implementation Plan
+
+> **For agentic workers:** The assigned Engineer implements this plan task by task in this session, test first. No subagents are needed for this small, connected UI change.
+
+**Goal:** Show a private project's lock in the channel mark position wherever Desktop draws its project channel name, keeping the sidebar's right edge for notifications.
+
+**Architecture:** Reuse the existing project privacy flag and `AppIcons.lock`. Keep `#` for public projects. Inline project channel labels that are currently strings use the same lock widget where an icon must appear; a composer hint keeps the project name without a textual `#`.
+
+**Tech Stack:** Flutter, Dart, existing Super Tab widgets and widget tests.
+
+**Spec:** Swarm task #2568, conversation 1458f891eef26458eb128229.
+
+## Global Constraints
+
+- Keep the change small and leave phone UI untouched.
+- A private sidebar row has a leading lock, no trailing lock, and retains the “Private project” tooltip and screen-reader label.
+- Public rows retain `#`; mention badges and muted bells remain at the right.
+- Show light and dark sidebar screenshots with public and private projects and a mention badge.
+- Use the Desktop memory store and fake sign-in in tests.
+- Run Desktop `check-ui-style` and `laid_out_list_test` before Ready.
+- List every changed project-label surface in the PR; first body line: `Requested by [email protected] through Harness.`
+
+## Review Focus
+
+- Public projects must retain the existing `#` mark.
+- Private projects must not retain a second lock at the row's trailing edge.
+- Notification badges and muted bells must remain the only project-row trailing marks.
+- Header, project menu, Activity, Buddy detail, and legacy Notifications/Decisions channel references must identify private projects with a lock.
+- Accessibility labels and composer hints must still name the project clearly.
+
+---
+
+### Task 1: Private project channel marks
+
+**Files:**
+- Modify: `desktop/lib/super_tabs/project_sidebar.dart`
+- Modify: `desktop/lib/super_tabs/view.dart`
+- Modify: `desktop/lib/super_tabs/private_project_lock.dart`
+- Modify: `desktop/lib/super_tabs/buddies.dart`
+- Modify: `desktop/lib/super_tabs/activity.dart`
+- Modify: `desktop/lib/super_tabs/activity_view.dart`
+- Modify: `desktop/lib/super_tabs/decisions_view.dart` and `desktop/lib/super_tabs/notifications.dart`
+- Test: `desktop/test/super_tab_sidebar_test.dart`, `desktop/test/super_tab_view_test.dart`, `desktop/test/super_tab_activity_view_test.dart`, `desktop/test/super_tab_buddies_test.dart`, `desktop/test/super_tab_private_legacy_channel_test.dart`, and `desktop/test/super_tab_quiet_polish_test.dart`
+- Test: `desktop/test/super_tab_project_rows_shots_test.dart`
+
+**Interfaces:**
+- Consumes: `SuperTabProject.isPrivate`, `AppIcons.lock`, existing Desktop typography and row composition.
+- Produces: visible private-project lock marks at the same position as public `#` marks; notification marks remain trailing.
+
+- [x] Write failing widget tests for private leading lock/no trailing lock, public `#`, and right-side mention badge/muted bell.
+- [x] Run the focused sidebar test and confirm the new assertions fail against the current placement.
+- [x] Write failing view, Activity, Buddy, and legacy Notifications/Decisions tests for private channel marks; ensure the composer hint has no textual `#`.
+- [x] Run the focused tests and confirm they fail because private project labels still use `#`.
+- [x] Move the sidebar lock into the leading mark column, retaining its tooltip and semantics; remove the trailing lock.
+- [x] Render lock marks for private labels in the header, project menu, Activity, Buddy detail, and legacy Notifications/Decisions; keep composer hint text descriptive.
+- [x] Capture light and dark sidebar screenshots showing private and public rows with a mention badge.
+- [x] Run focused private legacy-channel and quiet-polish widget tests, `check-ui-style`, and `laid_out_list_test`; record red/green evidence and screenshots in the PR.
+- [x] Commit the implementation and tests.