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.

fix(mobile): Privacy shows its shared fields under their button, as labelled lines

Dev jacobd166f8b33ceb
diff --git a/mobile/lib/phone/privacy_page.dart b/mobile/lib/phone/privacy_page.dart
index 18911ef37..2e359ade3 100644
--- a/mobile/lib/phone/privacy_page.dart
+++ b/mobile/lib/phone/privacy_page.dart
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../shared/widgets/product_feedback.dart';
+import 'privacy_shared_fields.dart';
typedef UsagePreferenceRequest = Future<Map<String, dynamic>> Function({
bool? enabled,
@@ -58,71 +59,67 @@ class _PrivacyPageState extends State<PrivacyPage> {
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const Text('Privacy')),
- body: ListView(
+ // Not a lazy list: the feedback below the shared fields must keep its answer when scrolled away.
+ body: SingleChildScrollView(
padding: const EdgeInsets.all(20),
- children: [
- if (_enabled == null)
- ListTile(
- contentPadding: EdgeInsets.zero,
- title: const Text('Share product usage data'),
- subtitle: Text(
- _busy ? 'Checking your saved preference…' : 'Setting unavailable',
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ if (_enabled == null)
+ ListTile(
+ contentPadding: EdgeInsets.zero,
+ title: const Text('Share product usage data'),
+ subtitle: Text(
+ _busy
+ ? 'Checking your saved preference…'
+ : 'Setting unavailable',
+ ),
+ )
+ else
+ SwitchListTile.adaptive(
+ contentPadding: EdgeInsets.zero,
+ title: const Text('Share product usage data'),
+ subtitle: const Text(
+ 'Help improve Harness by sharing usage counts and duration statistics. '
+ 'Your prompts, code, files, and conversations are never included.',
+ ),
+ value: _enabled!,
+ onChanged: _busy ? null : (value) => _read(enabled: value),
),
- )
- else
- SwitchListTile.adaptive(
- contentPadding: EdgeInsets.zero,
- title: const Text('Share product usage data'),
- subtitle: const Text(
- 'Help improve Harness by sharing usage counts and duration statistics. '
- 'Your prompts, code, files, and conversations are never included.',
- ),
- value: _enabled!,
- onChanged: _busy ? null : (value) => _read(enabled: value),
- ),
- if (_busy) const LinearProgressIndicator(),
- const SizedBox(height: 12),
- const Text(
- 'Applies to every computer and app signed in to this account. '
- 'Turning this off stops new product usage reports. Essential service and security records are separate.',
- ),
- if (_error != null) ...[
+ if (_busy) const LinearProgressIndicator(),
const SizedBox(height: 12),
- Text(_error!),
- TextButton(
- onPressed: _busy ? null : () => _read(),
- child: const Text('Reload'),
- ),
- ],
- TextButton(
- onPressed: () => setState(() {
- _details = !_details;
- }),
- child: Text(_details ? 'Hide shared fields' : 'See what’s shared'),
- ),
- if (_enabled == true && widget.feedback != null)
- ProductFeedback(send: widget.feedback!),
- if (_details)
const Text(
- 'Shared fields: UTC day, a random retry receipt, protocol and preference revisions; '
- 'active/working computer counts, first/repeat work, desktop/terminal opens, '
- 'the days you used Harness, which apps you used, whether an agent worked and your sign-up day (a coded ID instead of your account, kept 10 days, then only as combined totals), '
- 'turns started/ended/interrupted (including automation), and duration buckets '
- '(under 10 seconds, 10–60 seconds, 1–5 minutes, over 5 minutes). '
- 'Also: request outcomes and fixed failure categories for launch/resume/restart/model changes/history, '
- 'response wait buckets, missing responses and error-event counts, and first-launch 24-hour response counts and D1/D7/D28 working-day returns. '
- 'Fixed setup, sign-in, connection, viewer and update-stage outcomes; first/repeat feature use and monthly returns. '
- 'Feedback sends only your selected task outcome or reason. '
- 'Older apps contribute connection, remote-session and turn-start totals separately.\n\n'
- 'Sign-in checks your preference. Account, computer and agent identifiers are not stored '
- 'with the combined totals. The 10-day daily records use a coded ID instead of your account '
- 'and are deleted when you turn sharing off. Queued local counters older than 35 days are discarded when Harness next runs. '
- 'Server retry receipts are scheduled to expire after 36 days; combined totals after 13 months. Background cleanup may lag. '
- 'Combined totals cannot be removed for one person. '
- 'Previously collected activity records expire after 35 days. '
- 'A turn ending does not establish task success.',
+ 'Applies to every computer and app signed in to this account. '
+ 'Turning this off stops new product usage reports. Essential service and security records are separate.',
),
- ],
+ if (_error != null) ...[
+ const SizedBox(height: 12),
+ Text(_error!),
+ TextButton(
+ onPressed: _busy ? null : () => _read(),
+ child: const Text('Reload'),
+ ),
+ ],
+ Align(
+ alignment: Alignment.centerLeft,
+ child: TextButton(
+ style: TextButton.styleFrom(padding: EdgeInsets.zero),
+ onPressed: () => setState(() {
+ _details = !_details;
+ }),
+ child: Text(
+ _details ? 'Hide shared fields' : 'See what’s shared',
+ ),
+ ),
+ ),
+ if (_details) const PrivacySharedFields(),
+ if (_enabled == true && widget.feedback != null) ...[
+ const SizedBox(height: 12),
+ const Divider(),
+ ProductFeedback(send: widget.feedback!),
+ ],
+ ],
+ ),
),
);
}
diff --git a/mobile/lib/phone/privacy_shared_fields.dart b/mobile/lib/phone/privacy_shared_fields.dart
new file mode 100644
index 000000000..5177098c2
--- /dev/null
+++ b/mobile/lib/phone/privacy_shared_fields.dart
@@ -0,0 +1,151 @@
+import 'package:flutter/material.dart';
+
+/// One labelled line of what product usage sharing sends or keeps.
+typedef _Field = ({String label, String text});
+
+const List<_Field> _sent = [
+ (
+ label: 'Each report',
+ text: 'UTC day, a random retry receipt, protocol and preference revisions.',
+ ),
+ (
+ label: 'Activity',
+ text:
+ 'Active/working computer counts, first/repeat work, desktop/terminal opens, '
+ 'first/repeat feature use and monthly returns.',
+ ),
+ (
+ label: 'Days you used Harness',
+ text:
+ 'Which apps you used, whether an agent worked and your sign-up day, under a coded ID '
+ 'instead of your account, kept 10 days, then only as combined totals.',
+ ),
+ (
+ label: 'Turns',
+ text:
+ 'Started/ended/interrupted (including automation), and duration buckets '
+ '(under 10 seconds, 10–60 seconds, 1–5 minutes, over 5 minutes).',
+ ),
+ (
+ label: 'Reliability',
+ text:
+ 'Request outcomes and fixed failure categories for launch/resume/restart/model changes/history, '
+ 'response wait buckets, missing responses and error-event counts, '
+ 'first-launch 24-hour response counts and D1/D7/D28 working-day returns.',
+ ),
+ (
+ label: 'Setup and connections',
+ text:
+ 'Fixed setup, sign-in (and which button: scan, Google, Apple or email), '
+ 'connection, viewer and update-stage outcomes.',
+ ),
+ (
+ label: 'Phone setup steps',
+ text:
+ 'Waiting for a computer, opening its session, sending a first message, '
+ 'answering the notification prompt: outcomes and duration buckets.',
+ ),
+ (label: 'Feedback', text: 'Only your selected task outcome or reason.'),
+ (
+ label: 'Older apps',
+ text:
+ 'Connection, remote-session and turn-start totals, counted separately.',
+ ),
+];
+
+const List<_Field> _kept = [
+ (
+ label: 'Identity',
+ text:
+ 'Sign-in checks your preference. Account, computer and agent identifiers '
+ 'are not stored with the combined totals.',
+ ),
+ (
+ label: 'Daily records',
+ text: 'Use a coded ID instead of your account and are deleted when you turn sharing off.',
+ ),
+ (
+ label: 'Expiry',
+ text:
+ 'Queued local counters older than 35 days are discarded when Harness next runs. '
+ 'Server retry receipts are scheduled to expire after 36 days; combined totals after 13 months. '
+ 'Background cleanup may lag. Previously collected activity records expire after 35 days.',
+ ),
+ (
+ label: 'Limits',
+ text:
+ 'Combined totals cannot be removed for one person. '
+ 'A turn ending does not establish task success.',
+ ),
+];
+
+/// "See what's shared": what a report carries, then how long it is kept, as short labelled lines.
+class PrivacySharedFields extends StatelessWidget {
+ const PrivacySharedFields({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final theme = Theme.of(context);
+ return Card(
+ margin: const EdgeInsets.only(top: 4),
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(16, 14, 16, 6),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ _Heading('What is shared', theme: theme),
+ for (final field in _sent) _FieldLine(field, theme: theme),
+ const SizedBox(height: 8),
+ _Heading('How it is kept', theme: theme),
+ for (final field in _kept) _FieldLine(field, theme: theme),
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class _Heading extends StatelessWidget {
+ const _Heading(this.text, {required this.theme});
+ final String text;
+ final ThemeData theme;
+
+ @override
+ Widget build(BuildContext context) => Padding(
+ padding: const EdgeInsets.only(bottom: 6),
+ child: Text(
+ text.toUpperCase(),
+ style: theme.textTheme.labelMedium?.copyWith(
+ color: theme.colorScheme.primary,
+ fontWeight: FontWeight.w700,
+ letterSpacing: .6,
+ ),
+ ),
+ );
+}
+
+class _FieldLine extends StatelessWidget {
+ const _FieldLine(this.field, {required this.theme});
+ final _Field field;
+ final ThemeData theme;
+
+ @override
+ Widget build(BuildContext context) => Padding(
+ padding: const EdgeInsets.only(bottom: 10),
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: '${field.label}\n',
+ style: const TextStyle(fontWeight: FontWeight.w600),
+ ),
+ TextSpan(
+ text: field.text,
+ style: TextStyle(color: theme.colorScheme.onSurfaceVariant),
+ ),
+ ],
+ ),
+ style: theme.textTheme.bodyMedium,
+ ),
+ );
+}
diff --git a/mobile/lib/shared/widgets/product_feedback.dart b/mobile/lib/shared/widgets/product_feedback.dart
index c8e64cb7c..cfe50fff7 100644
--- a/mobile/lib/shared/widgets/product_feedback.dart
+++ b/mobile/lib/shared/widgets/product_feedback.dart
@@ -71,6 +71,15 @@ class _ProductFeedbackState extends State<ProductFeedback> {
}
}
+ static ButtonStyle _chosen(BuildContext context) {
+ final primary = Theme.of(context).colorScheme.primary;
+ return OutlinedButton.styleFrom(
+ foregroundColor: primary,
+ disabledForegroundColor: primary,
+ side: BorderSide(color: primary),
+ );
+ }
+
@override
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.only(top: 20),
@@ -94,6 +103,8 @@ class _ProductFeedbackState extends State<ProductFeedback> {
children: [
for (final choice in (widget.outcome ? outcomes : choices).entries)
OutlinedButton(
+ // The answer given stays marked after it is sent; the others step back.
+ style: _answer == choice.key ? _chosen(context) : null,
onPressed:
_busy || _sent || (_answer != null && _answer != choice.key)
? null
@@ -102,7 +113,10 @@ class _ProductFeedbackState extends State<ProductFeedback> {
),
],
),
- if (_status != null) Text(_status!),
+ if (_status != null) ...[
+ const SizedBox(height: 8),
+ Text(_status!),
+ ],
],
),
);
diff --git a/mobile/test/privacy_page_test.dart b/mobile/test/privacy_page_test.dart
index f1fd9b631..31bca06b3 100644
--- a/mobile/test/privacy_page_test.dart
+++ b/mobile/test/privacy_page_test.dart
@@ -20,6 +20,14 @@ void main() {
);
await tester.pumpAndSettle();
expect(find.text('How did your latest task go?'), findsOneWidget);
+ await tester.tap(find.text('Useful'));
+ await tester.pumpAndSettle();
+ await tester.tap(find.text('See what’s shared'));
+ await tester.pumpAndSettle();
+ // Opening the shared fields above the feedback keeps the answer already sent.
+ expect(find.text('Feedback sent. Thank you.'), findsOneWidget);
+ await tester.tap(find.text('Hide shared fields'));
+ await tester.pumpAndSettle();
await tester.tap(find.byType(Switch));
await tester.pumpAndSettle();
expect(changes, [false]);