Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ben-improve-emoji-ux
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunicorn committed Aug 28, 2024
2 parents 4c784bf + 0c65e6a commit d0468ba
Show file tree
Hide file tree
Showing 52 changed files with 1,391 additions and 650 deletions.
1 change: 1 addition & 0 deletions .changes/chat-input-text-disappear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Chat: fix bug where text disappears when try to tap on field in edit/reply state.
2 changes: 1 addition & 1 deletion .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
- uses: subosito/flutter-action@v2
name: Set up flutter
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'

- name: Flutter info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'

- name: Install supported toolchain
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-flutter-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
# - uses: subosito/flutter-action@v2
# name: Set up flutter
# with:
# flutter-version: '3.22'
# flutter-version: '3.24'
# channel: 'stable'

# - uses: actions/setup-python@v4
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
# - uses: subosito/flutter-action@v2
# name: Set up flutter
# with:
# flutter-version: '3.22'
# flutter-version: '3.24'
# channel: 'stable'

# - uses: actions/setup-python@v4
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
- uses: subosito/flutter-action@v2
name: Set up flutter
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'
- uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -397,7 +397,7 @@ jobs:
- uses: subosito/flutter-action@v2
name: Set up flutter
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'

- uses: actions/setup-python@v4
Expand Down Expand Up @@ -548,7 +548,7 @@ jobs:
# - uses: subosito/flutter-action@v2
# name: Set up flutter
# with:
# flutter-version: '3.22'
# flutter-version: '3.24'
# channel: 'stable'

# - uses: actions/setup-python@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: subosito/flutter-action@v2
if: ${{matrix.needs_flutter}}
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'
- name: Run Clippy
run: cargo clippy -p ${{matrix.package}} ${{matrix.clippy_extras}} -- -D warnings
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- uses: subosito/flutter-action@v2
if: ${{matrix.needs_flutter}}
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'
- name: Release Build
run: cargo build -p ${{matrix.package}} --release
Expand All @@ -91,7 +91,7 @@ jobs:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'
- name: Install supported rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22'
flutter-version: '3.24'
channel: 'stable'

- name: Generate env
Expand Down
2 changes: 1 addition & 1 deletion app/.env
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ RAGESHAKE_APP_VERSION=DEV

#enven:const
#enven:type=String
RAGESHAKE_URL=http://localhost:8003/api/submit
RAGESHAKE_URL=



Expand Down
1 change: 1 addition & 0 deletions app/integration_test/tests/bug_reporter.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:acter/features/bug_report/actions/open_bug_report.dart';
import 'package:acter/features/bug_report/pages/bug_report_page.dart';
import 'package:acter/features/home/data/keys.dart';
import 'package:acter/config/app_shell.dart';
Expand Down
2 changes: 0 additions & 2 deletions app/integration_test/tests/tasks.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:acter/common/utils/utils.dart';
import 'package:acter/features/home/data/keys.dart';
import 'package:acter/features/search/model/keys.dart';
import 'package:acter/features/space/providers/space_navbar_provider.dart';
Expand All @@ -24,7 +23,6 @@ typedef TaskListCreateResult = ({

extension ActerTasks on ConvenientTest {
Future<void> ensureTasksAreEnabled(String? spaceId) async {
await ensureLabEnabled(LabsFeature.tasks);
if (spaceId != null) {
await gotoSpace(spaceId);

Expand Down
4 changes: 2 additions & 2 deletions app/lib/common/pages/fatal_fail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class _FatalFailPageState extends ConsumerState<FatalFailPage> {
],
),
if (showStack) Text(stack),
ButtonBar(
alignment: MainAxisAlignment.center,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ActerDangerActionButton.icon(
icon: const Icon(
Expand Down
4 changes: 2 additions & 2 deletions app/lib/common/pages/not_found.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class NotFoundPage extends ConsumerWidget {
Text(
'How did you get here? There is nothing to see at `$currentLocation`...',
),
ButtonBar(
alignment: MainAxisAlignment.center,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
OutlinedButton.icon(
icon: const Icon(Atlas.home_thin),
Expand Down
3 changes: 0 additions & 3 deletions app/lib/common/providers/common_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import 'package:riverpod/riverpod.dart';

final _log = Logger('a3::common::common_providers');

// Loading Providers
final loadingProvider = StateProvider<bool>((ref) => false);

final genericUpdatesStream =
StreamProvider.family<int, String>((ref, key) async* {
final client = ref.watch(alwaysClientProvider);
Expand Down
6 changes: 6 additions & 0 deletions app/lib/common/providers/space_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ final spaceProvider =
throw 'Space not found';
});

final spaceIsBookmarkedProvider =
FutureProvider.family<bool, String>((ref, spaceId) async {
final space = await ref.watch(spaceProvider(spaceId).future);
return space.isBookmarked();
});

/// Attempts to map a spaceId to the space, but could come back empty (null) rather than throw.
/// keeps up to date with underlying client even if the space wasn't found initially,
final maybeSpaceProvider =
Expand Down
217 changes: 217 additions & 0 deletions app/lib/common/toolkit/errors/error_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
import 'package:acter/common/toolkit/errors/util.dart';
import 'package:acter/features/bug_report/actions/open_bug_report.dart';
import 'package:acter/features/bug_report/providers/bug_report_providers.dart';
import 'package:flutter/material.dart';
import 'package:quickalert/widgets/quickalert_buttons.dart';
import 'package:quickalert/widgets/quickalert_container.dart';
import 'package:quickalert/models/quickalert_options.dart';
import 'package:quickalert/quickalert.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';

class ActerErrorDialog extends StatelessWidget {
static const retryBtn = Key('error-dialog-retry-btn');

final Object error;
final StackTrace stack;
final VoidCallback? onRetryTap;

final String? title;
final String? text;
final String Function(Object error)? textBuilder;
final bool includeBugReportButton;

/// Dialog Border Radius
final double borderRadius;

const ActerErrorDialog({
super.key,
required this.error,
required this.stack,
this.onRetryTap,
this.title,
this.text,
this.textBuilder,
this.includeBugReportButton = true,
this.borderRadius = 15.0,
});

static Future show({
/// BuildContext
required BuildContext context,
required Object error,
required StackTrace stack,

/// Title of the dialog
String? title,

/// Text of the dialog
String? text,
VoidCallback? onRetryTap,
String Function(Object error)? textBuilder,
bool includeBugReportButton = true,

/// Dialog Border Radius
double borderRadius = 15.0,
}) {
return showGeneralDialog(
context: context,
pageBuilder: (context, anim1, __) => ActerErrorDialog(
error: error,
stack: stack,
title: title,
text: text,
textBuilder: textBuilder,
onRetryTap: onRetryTap,
borderRadius: borderRadius,
includeBugReportButton: includeBugReportButton,
),
);
}

@override
Widget build(BuildContext context) {
return AlertDialog(
contentPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius),
),
content: errorDialog(context),
);
}

Widget errorDialog(BuildContext context) {
final theme = Theme.of(context);
final lang = L10n.of(context);
final err = ErrorCode.guessFromError(error);
QuickAlertOptions options = QuickAlertOptions(
title: title ??
switch (err) {
ErrorCode.notFound => lang.notFound,
_ => lang.fatalError,
},
text: text ?? (textBuilder != null ? textBuilder!(error) : null),
type: switch (err) {
ErrorCode.notFound => QuickAlertType.warning,
_ => QuickAlertType.error,
},
showCancelBtn: true,
showConfirmBtn: false,
cancelBtnText: lang.back,
borderRadius: borderRadius,
);
if (onRetryTap != null) {
options.showConfirmBtn = true;
options.confirmBtnColor = theme.primaryColor;
options.confirmBtnText = lang.retry;
options.onConfirmBtnTap = () {
onRetryTap!();
};
}

return _ActerErrorAlert(
error: error,
stack: stack,
options: options,
includeBugReportButton: includeBugReportButton,
);
}
}

class _ActerErrorAlert extends QuickAlertContainer {
final bool includeBugReportButton;
final Object error;
final StackTrace stack;

const _ActerErrorAlert({
required super.options,
required this.error,
required this.stack,
this.includeBugReportButton = true,
});

@override
Widget buildButtons() {
return _ActerErrorActionButtons(options: options);
}

@override
Widget buildHeader(context) {
final orginalHeader = super.buildHeader(context);
if (!includeBugReportButton || !isBugReportingEnabled) {
return orginalHeader;
}
return Stack(
children: [
orginalHeader,
Positioned(
right: 10,
top: 10,
child: TextButton(
child: Text(L10n.of(context).reportBug),
onPressed: () => openBugReport(
context,
queryParams: {
'error': error.toString(),
'stack': stack.toString(),
},
),
),
),
],
);
}
}

class _ActerErrorActionButtons extends QuickAlertButtons {
const _ActerErrorActionButtons({required super.options});

@override
Widget buildButton({
BuildContext? context,
required bool isOkayBtn,
required String text,
VoidCallback? onTap,
}) {
final btnText = Text(
text,
style: defaultTextStyle(isOkayBtn),
);
if (isOkayBtn) {
return buildOkayBtn(context: context, btnText: btnText, onTap: onTap);
}
return buildCancelBtn(btnText: btnText, onTap: onTap);
}

Widget buildOkayBtn({
BuildContext? context,
required Widget btnText,
VoidCallback? onTap,
}) {
return MaterialButton(
key: ActerErrorDialog.retryBtn,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
color: options.confirmBtnColor ?? Theme.of(context!).primaryColor,
onPressed: onTap,
child: Center(
child: Padding(
padding: const EdgeInsets.all(7.5),
child: btnText,
),
),
);
}

Widget buildCancelBtn({
required Widget btnText,
VoidCallback? onTap,
}) {
return GestureDetector(
onTap: onTap,
child: Center(
child: btnText,
),
);
}
}
Loading

0 comments on commit d0468ba

Please sign in to comment.