Skip to content

Commit

Permalink
Rolled in iOS fixes and other changes from Limbo
Browse files Browse the repository at this point in the history
  • Loading branch information
limbo-app-dev committed Jun 24, 2023
1 parent 39cf61c commit 79a607f
Show file tree
Hide file tree
Showing 37 changed files with 875 additions and 401 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## v0.9.11+13 - 2023-06-24
- Merged in iOS support
- Added clickthrough for NSFW content, and associated setting.
- Added option to hide Everything feed as this was v confusing to new users.
- Improved messaging when interacting with content delivered via non-signed instances.
- Added 'via' information on posts to help with above.
- Limit total size of rich text field in post bodies as v large images
could fill pages.
- Replaced DELETE account (from instance) button with a Remove account (from app) button to prevent
risk of death threats :-)
- Limited width of main body components for a more reasonable feel on iPad.
- Minor UI tweaks



## v0.9.11 - 2023-06-24
- Updated api client to better support 0.18.x
- Fixes login stalling on 0.18.x instances
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ Join us on the matrix for support in contributions! [#liftoff-dev:matrix.org](ht
- Clone this repo: `git clone https://github.com/liftoff-app/liftoff`
- Enter the repo: `cd liftoff`

### iOS

Visual Studio Code build configurations are provided for development testing.

For final release, run:

1. `flutter build ipa --flavor prod`

The .api will be in `build/ios/ipa`


### Android

1. Build: `flutter build apk --flavor prod --target lib/main_prod.dart --release`
Expand Down
6 changes: 5 additions & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
"@show_nsfw": {},
"send_notifications_to_email": "Send notifications to Email",
"@send_notifications_to_email": {},
"remove_account": "Remove account",
"@remove_account": {},
"delete_account": "Delete account",
"@delete_account": {},
"saved": "Saved",
Expand Down Expand Up @@ -276,7 +278,9 @@
"@messages": {},
"banned_users": "Banned users",
"@banned_users": {},
"delete_account_confirm": "Warning: this will permanently delete all of your data from this instance. Your data may not be deleted on other, existing instances. Enter your password to confirm.",
"remove_account_confirm": "This will delete your account and data from this app. Your account and data will remain on the instance.",
"@remove_account_confirm": {},
"delete_account_confirm": "Warning: this will permanently delete your account and all of your data from the app AND instance. Your data may not be deleted on other, existing instances. Enter your password to confirm.",
"@delete_account_confirm": {},
"new_password": "New password",
"@new_password": {},
Expand Down
2 changes: 1 addition & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MyApp extends StatelessWidget {
return KeyboardDismisser(
child: ObserverBuilder<ConfigStore>(
builder: (context, store) => MaterialApp(
title: 'liftoff',
title: 'Liftoff',
supportedLocales: L10n.supportedLocales,
localizationsDelegates: L10n.localizationsDelegates,
themeMode: store.theme,
Expand Down
6 changes: 4 additions & 2 deletions lib/hooks/logged_in_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ VoidCallback Function(
if (store.hasNoAccount) {
return () {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(message ?? 'you have to be logged in to do that'),
content: Text(
message ?? 'You have to add an account and log in to do that'),
action: SnackBarAction(
label: 'log in',
onPressed: () => goTo(context, (_) => AccountsConfigPage())),
Expand All @@ -45,7 +46,8 @@ VoidCallback Function(
if (store.isAnonymousFor(instanceHost)) {
return () {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(message ?? 'you have to be logged in to do that'),
content: Text(message ??
'This thread was retrieved via $instanceHost.\nYou are not logged in there.'),
action: SnackBarAction(
label: 'log in',
onPressed: () => goTo(context, (_) => AccountsConfigPage())),
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ extension NumberFormatExtensions on num {
/// returns `this` as a formatted compact number
String compact(BuildContext context) => NumberFormat.compact(
locale: Localizations.localeOf(context).toLanguageTag(),
).format(this);
).format(this < 1000 ? this : num.parse(toStringAsPrecision(2)));
}
6 changes: 6 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'app_config.dart';
import 'main_common.dart';

void main() {
mainCommon(const AppConfig(debugMode: false));
}
117 changes: 63 additions & 54 deletions lib/pages/create_post/create_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class CreatePostPage extends HookWidget {
},
child: Scaffold(
appBar: AppBar(
title: const Text('Create post'),
actions: [
ObserverBuilder<CreatePostStore>(
builder: (context, store) => IconButton(
Expand All @@ -81,68 +82,76 @@ class CreatePostPage extends HookWidget {
),
],
),
body: Stack(
children: [
SafeArea(
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(5),
child: Form(
key: formKey,
child: Column(
children: [
if (!context.read<CreatePostStore>().isEdit) ...const [
CreatePostInstancePicker(),
CreatePostCommunityPicker(),
],
CreatePostUrlField(titleFocusNode),
title,
body,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
body: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 600),
child: Stack(
children: [
SafeArea(
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(5),
child: Form(
key: formKey,
child: Column(
children: [
ObserverBuilder<CreatePostStore>(
builder: (context, store) => GestureDetector(
onTap: () => store.nsfw = !store.nsfw,
child: Row(
children: [
Checkbox(
value: store.nsfw,
onChanged: (val) {
if (val != null) store.nsfw = val;
},
if (!context
.read<CreatePostStore>()
.isEdit) ...const [
CreatePostInstancePicker(),
CreatePostCommunityPicker(),
],
CreatePostUrlField(titleFocusNode),
title,
body,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ObserverBuilder<CreatePostStore>(
builder: (context, store) => GestureDetector(
onTap: () => store.nsfw = !store.nsfw,
child: Row(
children: [
Checkbox(
value: store.nsfw,
onChanged: (val) {
if (val != null) store.nsfw = val;
},
),
Text(L10n.of(context).nsfw)
],
),
Text(L10n.of(context).nsfw)
],
),
),
),
ObserverBuilder<CreatePostStore>(
builder: (context, store) => TextButton(
onPressed: store.submitState.isLoading
? () {}
: loggedInAction(handleSubmit),
child: store.submitState.isLoading
? const CircularProgressIndicator
.adaptive()
: Text(
store.isEdit
? L10n.of(context).edit
: L10n.of(context).post,
),
),
)
],
),
ObserverBuilder<CreatePostStore>(
builder: (context, store) => TextButton(
onPressed: store.submitState.isLoading
? () {}
: loggedInAction(handleSubmit),
child: store.submitState.isLoading
? const CircularProgressIndicator.adaptive()
: Text(
store.isEdit
? L10n.of(context).edit
: L10n.of(context).post,
),
),
)
],
EditorToolbar.safeArea,
].spaced(6),
),
EditorToolbar.safeArea,
].spaced(6),
),
),
),
),
),
BottomSticky(
child: EditorToolbar(editorController),
BottomSticky(
child: EditorToolbar(editorController),
),
],
),
],
),
),
),
);
Expand Down
Loading

0 comments on commit 79a607f

Please sign in to comment.