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-03 bc: #2658 (#2671)

0xken15969b3b59746a
diff --git a/mobile/integration_test/swarm_project_count_shots_test.dart b/mobile/integration_test/swarm_project_count_shots_test.dart
new file mode 100644
index 000000000..5e2d26e33
--- /dev/null
+++ b/mobile/integration_test/swarm_project_count_shots_test.dart
@@ -0,0 +1,122 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+
+import 'package:harness_mobile/notify/system_notices.dart';
+import 'package:harness_mobile/settings/experimental_features.dart';
+import 'package:harness_mobile/shared/theme/app_theme.dart' as grid;
+import 'package:harness_mobile/swarm/swarm_page.dart';
+import 'package:harness_mobile/swarm/swarm_session.dart';
+import 'package:harness_mobile/swarm/swarm_unread.dart';
+
+import '../test/swarm/swarm_fixture.dart';
+import '../test/voice_fakes.dart' show MemoryKeyValueStore;
+
+/// Simulator evidence with in-memory accounts, requests and read marks only.
+/// Run through test_driver/journey_driver.dart. PROJECT_COUNT_BASELINE captures
+/// the old behavior with this identical fixture before applying the fix.
+void main() {
+ final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ const baseline = bool.fromEnvironment('PROJECT_COUNT_BASELINE');
+ testWidgets('reading a project clears only its own number', (tester) async {
+ const derived = {'mentionsWaiting': 2, 'decisionsWaiting': 0};
+ final fake = FakeSwarm();
+ fake.routes['/api/super-tabs/list'] = (_) => {
+ 'tabs': [
+ {'id': tab, 'name': 'Phone Swarm', 'ownerId': me},
+ ],
+ 'next': null,
+ };
+ fake.routes['/api/super-tabs/$tab/parts'] = (_) => firstLoad(
+ derived: derived,
+ groups: [
+ groupData(leadChat, title: 'Mobile', lastMessageSequence: 4),
+ groupData('g1', title: 'Fix login', number: 51, lastMessageSequence: 4),
+ ],
+ );
+ fake.routes['/api/super-tabs/$tab/changes'] = (_) =>
+ changes(cursor: 'c2', derived: derived);
+ fake.routes['/api/super-tabs/$tab/mentions?state=waiting'] = (_) => {
+ 'mentions': [
+ for (final chat in [leadChat, 'g1'])
+ {
+ 'id': 'tag-$chat',
+ 'projectId': project,
+ 'projectName': 'Mobile',
+ 'conversationId': chat,
+ 'conversationTitle': chat == leadChat ? 'Mobile' : 'Fix login',
+ 'messageId': 'message-$chat',
+ 'messageSequence': 4,
+ 'leadName': 'River',
+ 'text': 'Please review the update.',
+ 'createdAt': '2026-11-02T17:00:00.000Z',
+ },
+ ],
+ };
+ fake.routes['/api/super-tabs/$tab/decisions?state=open'] = (_) => {
+ 'decisions': <Object>[],
+ };
+ fake.routes['/api/super-tabs/$tab/conversations/'] = (body) => {
+ 'sequence': body?['sequence'],
+ 'messages': <Object>[],
+ 'next': null,
+ };
+ final features = ExperimentalFeaturesStore(storage: MemoryKeyValueStore())
+ ..value = {PhoneExperiment.swarm};
+ final account = ValueNotifier<String?>(me);
+ final host = SwarmHost(
+ accountId: () => me,
+ account: account,
+ request: fake.request,
+ notices: SilentSystemNotices(),
+ features: features,
+ readMarks: MemoryKeyValueStore(),
+ )..foreground = false;
+ addTearDown(host.dispose);
+ addTearDown(account.dispose);
+ await tester.pumpWidget(
+ grid.BrightnessScope(
+ child: MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ builder: (_, child) => SwarmScope(notifier: host, child: child!),
+ home: const SwarmPage(),
+ ),
+ ),
+ );
+ final projectRow = find.byKey(
+ const ValueKey('swarm-project-$tab-$project'),
+ );
+ for (var i = 0; i < 200; i++) {
+ await tester.pump(const Duration(milliseconds: 100));
+ if (projectRow.evaluate().isNotEmpty &&
+ host.session!.inbox.asks(tab)?.mentions.length == 2) {
+ break;
+ }
+ }
+ expect(projectRow, findsOneWidget);
+ final reader = host.session!.inbox.reader(tab)!;
+ final asks = host.session!.inbox.asks(tab)!;
+ expect(swarmProjectNews(reader, asks)[project]?.tags, baseline ? 2 : 1);
+ await binding.takeScreenshot(
+ '${baseline ? 'before' : 'after'}-project-number',
+ );
+
+ // The same mark opening the project's chat sends; task marks stay intact.
+ reader.readMarks!.markRead(leadChat, 4);
+ for (var i = 0; i < 10; i++) {
+ await tester.pump(const Duration(milliseconds: 100));
+ }
+ expect(
+ swarmProjectNews(reader, asks)[project]?.tags ?? 0,
+ baseline ? 1 : 0,
+ );
+ expect(
+ swarmChatCount(reader, asks, reader.snapshot!.conversation('g1')!),
+ 1,
+ );
+ await binding.takeScreenshot(
+ '${baseline ? 'before' : 'after'}-project-read',
+ );
+ });
+}
diff --git a/mobile/lib/swarm/swarm_home_list.dart b/mobile/lib/swarm/swarm_home_list.dart
index 911bb5d22..34ede7fb9 100644
--- a/mobile/lib/swarm/swarm_home_list.dart
+++ b/mobile/lib/swarm/swarm_home_list.dart
@@ -26,13 +26,13 @@ class SwarmHomeProject {
required this.swarmId,
required this.project,
this.active,
- this.news = swarmNoNews,
+ this.news = swarmNoProjectNews,
});
final String swarmId;
final SuperTabProject project;
final DateTime? active;
- final SwarmRowNews news;
+ final SwarmProjectNews news;
String get key => swarmHomeProjectKey(swarmId, project.id);
}
@@ -97,7 +97,8 @@ SwarmHomeLists swarmHomeLists(
return (pinned: newest(pinned), recent: newest(recent), quiet: newest(quiet));
}
-bool _hasNews(SwarmHomeProject p) => p.news.bold || p.news.tags > 0;
+bool _hasNews(SwarmHomeProject p) =>
+ p.news.bold || p.news.tags > 0 || p.news.hasWaitingTag;
/// [lists] under Home's [filter] (`SwarmHomePrefs.filter`; unread is the
/// desktop's `_hasUnread`), pinned ones too. None with something new was
@@ -110,7 +111,7 @@ SwarmHomeLists swarmHomeFiltered(SwarmHomeLists lists, SwarmHomeFilter filter) {
case SwarmHomeFilter.unread:
keep = _hasNews;
case SwarmHomeFilter.mentions:
- keep = (p) => p.news.tags > 0;
+ keep = (p) => p.news.hasWaitingTag || p.news.tags > 0;
}
return (
pinned: lists.pinned.where(keep).toList(),
diff --git a/mobile/lib/swarm/swarm_home_rows.dart b/mobile/lib/swarm/swarm_home_rows.dart
index fb553e9b2..036215940 100644
--- a/mobile/lib/swarm/swarm_home_rows.dart
+++ b/mobile/lib/swarm/swarm_home_rows.dart
@@ -317,10 +317,10 @@ class SwarmOtherProjectsRow extends StatelessWidget {
/// How a project's team is, as its dot on Home: red with someone down,
/// yellow with someone waiting or a tag waiting on the person, green with
/// someone working, faint otherwise.
-Color swarmProjectColor(SwarmTeamGlance glance, SwarmRowNews news) =>
+Color swarmProjectColor(SwarmTeamGlance glance, SwarmProjectNews news) =>
glance.down > 0
? swarmStateColor(SwarmAgentState.down)
- : glance.waiting > 0 || news.tags > 0
+ : glance.waiting > 0 || news.tags > 0 || news.hasWaitingTag
? swarmStateColor(SwarmAgentState.waiting)
: glance.working > 0
? swarmStateColor(SwarmAgentState.working)
diff --git a/mobile/lib/swarm/swarm_page.dart b/mobile/lib/swarm/swarm_page.dart
index 05afa8672..784b9f7fe 100644
--- a/mobile/lib/swarm/swarm_page.dart
+++ b/mobile/lib/swarm/swarm_page.dart
@@ -585,11 +585,12 @@ class _SwarmPageState extends State<SwarmPage> {
final news = swarmProjectNews(reader, inbox.asks(swarm.id));
final activity = swarmProjectActivity(snapshot, reader.buddies);
for (final project in snapshot.projects) {
+ final projectNews = news[project.id];
final row = SwarmHomeProject(
swarmId: swarm.id,
project: project,
active: activity[project.id],
- news: news[project.id] ?? swarmNoNews,
+ news: projectNews ?? swarmNoProjectNews,
);
projects.add(row);
glances[row.key] = swarmTeamGlance(snapshot, projectId: project.id);
diff --git a/mobile/lib/swarm/swarm_unread.dart b/mobile/lib/swarm/swarm_unread.dart
index 2fe1850ee..3b851ab46 100644
--- a/mobile/lib/swarm/swarm_unread.dart
+++ b/mobile/lib/swarm/swarm_unread.dart
@@ -9,8 +9,17 @@ import 'swarm_reader.dart';
/// of them at its trailing edge ([tags]).
typedef SwarmRowNews = ({bool bold, int tags});
+/// Project-level chat counts, plus whether any open project chat has a tag
+/// waiting. The project number counts only what opening its own chat clears.
+typedef SwarmProjectNews = ({bool bold, int tags, bool hasWaitingTag});
+
/// Nothing new.
const SwarmRowNews swarmNoNews = (bold: false, tags: 0);
+const SwarmProjectNews swarmNoProjectNews = (
+ bold: false,
+ tags: 0,
+ hasWaitingTag: false,
+);
/// [group]'s row: bold while it is unread ([SwarmReader.readMarks]) and not
/// muted, or while something counts in it ([swarmChatCount]), with that count.
@@ -83,10 +92,11 @@ bool swarmUnreadShown(SwarmReader reader, SuperTabConversation group) =>
/// project chat or any of its open work shows unread, as the desktop's
/// sidebar reads a collapsed project — never for closed work, a private chat
/// or the person's Buddy chat, which has a row of its own — or while tags
-/// count there, with the sum of those chats' counts ([swarmChatCount]). A tag
-/// counts only in a chat this Swarm lists, under that chat's own project.
+/// count there. Its number counts only its project chat ([swarmChatCount]),
+/// which opening the project reads. Task tags stay on their own rows and in
+/// Activity. A tag counts only in a listed chat under its own project.
/// One pass over the Swarm's chats for every project.
-Map<String, SwarmRowNews> swarmProjectNews(
+Map<String, SwarmProjectNews> swarmProjectNews(
SwarmReader reader,
SwarmAsks? asks,
) {
@@ -102,6 +112,7 @@ Map<String, SwarmRowNews> swarmProjectNews(
}
final unread = <String>{};
final tags = <String, int>{};
+ final hasWaitingTag = <String>{};
for (final group in snapshot.conversations) {
if (group.closed ||
group.audience != null ||
@@ -118,10 +129,20 @@ Map<String, SwarmRowNews> swarmProjectNews(
waiting[group.id] ?? const [],
asked[group.id] ?? 0,
);
- if (count > 0) tags[projectId] = (tags[projectId] ?? 0) + count;
+ if (count > 0) {
+ unread.add(projectId);
+ hasWaitingTag.add(projectId);
+ if (group.id == snapshot.projectById(projectId)?.leadConversationId) {
+ tags[projectId] = count;
+ }
+ }
}
return {
for (final id in {...unread, ...tags.keys})
- id: (bold: true, tags: tags[id] ?? 0),
+ id: (
+ bold: true,
+ tags: tags[id] ?? 0,
+ hasWaitingTag: hasWaitingTag.contains(id),
+ ),
};
}
diff --git a/mobile/test/swarm/swarm_chat_notify_test.dart b/mobile/test/swarm/swarm_chat_notify_test.dart
index e9d825b01..694ab0195 100644
--- a/mobile/test/swarm/swarm_chat_notify_test.dart
+++ b/mobile/test/swarm/swarm_chat_notify_test.dart
@@ -319,7 +319,7 @@ void main() {
final r = await unreadAndTagged();
expect(news(r), (bold: true, tags: 1));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 1),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
final held = hold(r.swarm);
diff --git a/mobile/test/swarm/swarm_home_list_test.dart b/mobile/test/swarm/swarm_home_list_test.dart
index 624cbfcfa..62d84d645 100644
--- a/mobile/test/swarm/swarm_home_list_test.dart
+++ b/mobile/test/swarm/swarm_home_list_test.dart
@@ -193,7 +193,7 @@ void main() {
String id, {
int? minutes,
String swarmId = tab,
- SwarmRowNews news = swarmNoNews,
+ SwarmProjectNews news = swarmNoProjectNews,
}) => SwarmHomeProject(
swarmId: swarmId,
project: SuperTabProject.fromJson({
@@ -280,8 +280,16 @@ void main() {
final lists = swarmHomeLists(
[
project('a', minutes: 5),
- project('b', minutes: 60 * 30, news: (bold: false, tags: 1)),
- project('c', minutes: 60 * 31, news: (bold: true, tags: 0)),
+ project(
+ 'b',
+ minutes: 60 * 30,
+ news: (bold: false, tags: 1, hasWaitingTag: true),
+ ),
+ project(
+ 'c',
+ minutes: 60 * 31,
+ news: (bold: true, tags: 0, hasWaitingTag: false),
+ ),
project('d', minutes: 60 * 32),
],
pins: const {},
diff --git a/mobile/test/swarm/swarm_home_test.dart b/mobile/test/swarm/swarm_home_test.dart
index 98e0da84e..00258ea93 100644
--- a/mobile/test/swarm/swarm_home_test.dart
+++ b/mobile/test/swarm/swarm_home_test.dart
@@ -13,6 +13,7 @@ import 'package:harness_mobile/shared/theme/app_theme.dart'
show AppFont, AppPalette;
import 'package:harness_mobile/shared/widgets/skeleton.dart';
import 'package:harness_mobile/swarm/swarm_conversation_page.dart';
+import 'package:harness_mobile/swarm/swarm_home_list.dart';
import 'package:harness_mobile/swarm/swarm_home_rows.dart';
import 'package:harness_mobile/swarm/swarm_inbox.dart';
import 'package:harness_mobile/swarm/swarm_leaderboard.dart';
@@ -28,6 +29,7 @@ import 'package:harness_mobile/swarm/swarm_row.dart';
import 'package:harness_mobile/swarm/swarm_session.dart';
import 'package:harness_mobile/swarm/swarm_start.dart';
import 'package:harness_mobile/swarm/swarm_style.dart';
+import 'package:harness_mobile/swarm/team_glance.dart';
import 'package:harness_mobile/theme/app_theme.dart' show AppColors;
import '../voice_fakes.dart';
@@ -886,8 +888,8 @@ void main() {
expect(inside(publicRow, find.byType(SwarmAvatar)), findsNothing);
});
- testWidgets('a project the Lead tagged the person in is bold and bright '
- 'with @N filled; the rest are quiet; each has how many people read '
+ testWidgets('a project with a task-chat tag stays bold without a number; '
+ 'the rest are quiet; each has how many people read '
'it and when it last moved', (tester) async {
final semantics = tester.ensureSemantics();
await pump(tester, backend());
@@ -895,11 +897,8 @@ void main() {
const mobileRow = 'swarm-project-$tab-$project';
const webRow = 'swarm-project-$tab-$web';
expect(weightOf(tester, mobileRow, 'Mobile'), AppFont.semibold);
- final tags = tester.widget<SwarmTags>(
- inside(mobileRow, find.byType(SwarmTags)),
- );
- expect((tags.count, tags.filled), (1, true));
- expect(find.bySemanticsLabel(RegExp('1 mention')), findsOneWidget);
+ expect(inside(mobileRow, find.byType(SwarmTags)), findsNothing);
+ expect(find.bySemanticsLabel(RegExp('1 mention')), findsNothing);
expect(weightOf(tester, webRow, 'Web'), isNot(AppFont.semibold));
expect(inside(webRow, find.textContaining('@')), findsNothing);
for (final row in [mobileRow, webRow]) {
@@ -1274,6 +1273,30 @@ void main() {
expect(find.text('Nothing needs you.'), findsOneWidget);
});
+ testWidgets('a task-chat tag keeps its project under Mentions without a '
+ 'project-chat count', (tester) async {
+ final fake = backend();
+ final load = fake.routes['/api/super-tabs/$tab/parts']!;
+ fake.routes['/api/super-tabs/$tab/parts'] = (body) async => {
+ ...await load(body) as Map<String, dynamic>,
+ 'agents': <Object>[],
+ };
+ final host = await pump(tester, fake);
+ host.session!.home.setFilter(SwarmHomeFilter.mentions);
+ await tester.pumpAndSettle();
+
+ final row = key('swarm-project-$tab-$project');
+ expect(row, findsOneWidget);
+ expect(
+ inside('swarm-project-$tab-$project', find.byType(SwarmTags)),
+ findsNothing,
+ );
+ expect(
+ dotOf(tester, 'swarm-project-$tab-$project'),
+ swarmStateColor(SwarmAgentState.waiting),
+ );
+ });
+
testWidgets('back from a project, Home still has its title, and it opens '
'the switcher', (tester) async {
await pump(tester, backend());
@@ -2665,7 +2688,11 @@ void main() {
await tester.pumpAndSettle();
expect(key('swarm-project-tags-loading'), findsNothing);
- expect(inside(mobileRow, find.byType(SwarmTags)), findsOneWidget);
+ expect(
+ inside(mobileRow, find.byType(SwarmTags)),
+ findsNothing,
+ reason: "the tag is in a task chat, not the project chat",
+ );
expect(inside(webRow, find.byType(SwarmTags)), findsNothing);
expect(
tester.getSize(key(mobileRow)).height,
diff --git a/mobile/test/swarm/swarm_home_view_test.dart b/mobile/test/swarm/swarm_home_view_test.dart
index 1725228cb..c10e153d1 100644
--- a/mobile/test/swarm/swarm_home_view_test.dart
+++ b/mobile/test/swarm/swarm_home_view_test.dart
@@ -37,7 +37,7 @@ class _FailingStore extends MemoryKeyValueStore {
/// does to the Projects list, that it is kept on this phone, and that the menu
/// goes with the account or the Swarms it sorts.
void main() {
- const SwarmRowNews bold = (bold: true, tags: 0);
+ const SwarmProjectNews bold = (bold: true, tags: 0, hasWaitingTag: false);
const web = 'project-2';
const webLead = 'group-lead-web';
final now = DateTime.utc(2030, 1, 2, 12);
@@ -45,7 +45,7 @@ void main() {
SwarmHomeProject row(
String id, {
DateTime? active,
- SwarmRowNews news = swarmNoNews,
+ SwarmProjectNews news = swarmNoProjectNews,
}) => SwarmHomeProject(
swarmId: tab,
project: SuperTabProject.fromJson({
@@ -74,7 +74,7 @@ void main() {
row(
'tagged',
active: now.subtract(hour * 2),
- news: (bold: true, tags: 2),
+ news: (bold: true, tags: 2, hasWaitingTag: true),
),
row('pinned-read', active: now.subtract(hour * 72)),
];
diff --git a/mobile/test/swarm/swarm_project_line_test.dart b/mobile/test/swarm/swarm_project_line_test.dart
index 7ebad0378..abac5ce32 100644
--- a/mobile/test/swarm/swarm_project_line_test.dart
+++ b/mobile/test/swarm/swarm_project_line_test.dart
@@ -40,8 +40,10 @@ void main() {
);
}
- SwarmTeamGlance glance({int running = 0, int idle = 0}) =>
- swarmTeamGlance(read(running: running, idle: idle), now: now);
+ SwarmTeamGlance glance({int running = 0, int idle = 0}) => swarmTeamGlance(
+ read(running: running, idle: idle),
+ now: now,
+ );
const line = ValueKey('swarm-project-line');
@@ -69,7 +71,7 @@ void main() {
swarmId: 'tab',
project: snapshot.projects.first,
active: null,
- news: swarmNoNews,
+ news: swarmNoProjectNews,
),
glance: swarmTeamGlance(snapshot, now: now),
humans: humans,
diff --git a/mobile/test/swarm/swarm_screens_test.dart b/mobile/test/swarm/swarm_screens_test.dart
index 7a718c83f..e652058ad 100644
--- a/mobile/test/swarm/swarm_screens_test.dart
+++ b/mobile/test/swarm/swarm_screens_test.dart
@@ -252,8 +252,8 @@ void main() {
final row = key('swarm-project-$tab-$project');
expect(
find.descendant(of: row, matching: find.text('@1')),
- findsOneWidget,
- reason: "River's tag, waiting in it",
+ findsNothing,
+ reason: "River's task-chat tag stays on its own row",
);
expect(
find.descendant(of: row, matching: find.text('1 human')),
diff --git a/mobile/test/swarm/swarm_unread_test.dart b/mobile/test/swarm/swarm_unread_test.dart
index 4954ca0d4..9d2e196b4 100644
--- a/mobile/test/swarm/swarm_unread_test.dart
+++ b/mobile/test/swarm/swarm_unread_test.dart
@@ -190,7 +190,7 @@ void main() {
expect(chat(r, 'g1'), (bold: true, tags: 0));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 0),
+ project: (bold: true, tags: 0, hasWaitingTag: false),
});
});
@@ -210,12 +210,41 @@ void main() {
expect(chat(r, leadChat), (bold: false, tags: 0));
});
+ test('a project counts only tags opening its chat clears, while task tags stay on their own row', () async {
+ final r = await rig(
+ tags: [
+ mentionRow('project-tag', conversationId: leadChat, messageSequence: 4),
+ mentionRow('task-tag', messageSequence: 4),
+ ],
+ );
+ await moveOn(r, {
+ leadChat: groupData(leadChat, title: 'Mobile', lastMessageSequence: 4),
+ 'g1': groupData('g1', title: 'Fix login', lastMessageSequence: 4),
+ });
+ expect(swarmProjectNews(r.reader, r.asks)[project]?.tags, 1);
+ expect(chat(r, 'g1'), (bold: true, tags: 1));
+
+ r.reader.readMarks!.markRead(leadChat, 4);
+ await settle();
+ expect(swarmProjectNews(r.reader, r.asks)[project], (
+ bold: true,
+ tags: 0,
+ hasWaitingTag: true,
+ ));
+ expect(chat(r, 'g1'), (bold: true, tags: 1));
+ expect(
+ r.asks.mentions,
+ hasLength(2),
+ reason: 'Activity retains waiting tags',
+ );
+ });
+
test('a project is bold while its project chat or open work is unread, '
- 'and counts every tag waiting in it', () async {
+ 'without counting tags in task chats', () async {
final r = await rig(tags: [mentionRow('t1'), mentionRow('t2')]);
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 2),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
final quiet = await rig();
@@ -234,8 +263,8 @@ void main() {
});
expect(swarmProjectNews(quiet.reader, quiet.asks), {
- project: (bold: true, tags: 0),
- other: (bold: true, tags: 0),
+ project: (bold: true, tags: 0, hasWaitingTag: false),
+ other: (bold: true, tags: 0, hasWaitingTag: false),
});
});
@@ -291,7 +320,7 @@ void main() {
expect(chat(r, 'g1'), (bold: true, tags: 1));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 1),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
r.reader.readMarks!.markRead('g1', 4);
@@ -307,7 +336,7 @@ void main() {
expect(chat(r, 'g1'), (bold: true, tags: 1));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 1),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
// The person reads the chat as far as the first read had marked it.
@@ -393,7 +422,7 @@ void main() {
expect(swarmProjectNews(r.reader, r.asks), isEmpty);
});
- test('a tag in a reply also sent to the chat counts in the chat and its '
+ test('a tag in a reply also sent to a task chat counts there, not on its '
'project', () async {
// The server names no thread for a reply also in the chat
// (backend mentions.ts threadsOf).
@@ -404,7 +433,7 @@ void main() {
expect(chat(r, 'g1'), (bold: true, tags: 1));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 1),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
});
@@ -424,7 +453,7 @@ void main() {
expect(chat(r, 'g1'), (bold: false, tags: 0));
expect(chat(r, 'g2'), (bold: true, tags: 1));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 1),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
expect(r.asks.mentions, hasLength(2));
});
@@ -443,7 +472,7 @@ void main() {
);
expect(swarmProjectNews(r.reader, r.asks), {
- other: (bold: true, tags: 1),
+ other: (bold: true, tags: 1, hasWaitingTag: true),
});
// The private chat's own row still counts its tag, as the desktop's.
expect(chat(r, 'private'), (bold: true, tags: 1));
@@ -498,7 +527,7 @@ void main() {
expect(chat(r, 'g1'), (bold: true, tags: 1));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 1),
+ project: (bold: true, tags: 0, hasWaitingTag: true),
});
},
);
@@ -526,7 +555,7 @@ void main() {
expect(chat(r, 'g1'), (bold: true, tags: 0));
expect(swarmProjectNews(r.reader, r.asks), {
- project: (bold: true, tags: 0),
+ project: (bold: true, tags: 0, hasWaitingTag: false),
});
expect(
r.swarm.paths.where((p) => p.endsWith('/parts')),