Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Typos and UI issues addressed. #1640

Merged
merged 20 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
aa8b699
chore: app messages updated in english.
CurtlyCritchlow Dec 16, 2024
a5e09b9
core: app texts updated to for improved clarity, punctuation, consist…
CurtlyCritchlow Dec 16, 2024
dbfe287
chore: missing local port string added.
CurtlyCritchlow Dec 18, 2024
e7227ec
fix: extra space removed and unused empty string removed.
CurtlyCritchlow Dec 18, 2024
f672a50
fix: extra space removed and unused empty string removed.
CurtlyCritchlow Dec 18, 2024
8022cb8
fix: profile relay field maintains size when validation error is show…
CurtlyCritchlow Dec 18, 2024
42d2672
fix: @ is prefixed to field if not entered by the user.
CurtlyCritchlow Dec 18, 2024
a0398cd
fix: setting icon button in app bar replaced with Text Icon button.
CurtlyCritchlow Dec 18, 2024
31a34e2
fix: settings button on dashboard screen realigned to match logo padd…
CurtlyCritchlow Dec 19, 2024
d4e2068
fix: dashboard view toggle active color changed to black.
CurtlyCritchlow Dec 19, 2024
4048ea6
fix: default relay selection switch left aligned.
CurtlyCritchlow Dec 19, 2024
e4203fa
fix: logging switch shows check box then text.
CurtlyCritchlow Dec 19, 2024
a997975
fix: custom relay buttons updated and title "Custom" added to the rel…
CurtlyCritchlow Dec 19, 2024
8dae8e3
fix: screen contents are centered and stops resizing beyond a certain…
CurtlyCritchlow Jan 6, 2025
b36d306
chore: backupYourKey english translation updated.
CurtlyCritchlow Jan 6, 2025
d4a3f11
fix: trailing white space is automatically removed from device atsign…
CurtlyCritchlow Jan 8, 2025
6e5fd8e
chore: all rights reserved updated to 2025.
CurtlyCritchlow Jan 8, 2025
98e237c
Merge branch 'trunk' into 1493-fix-typos-and-ui-issues
CurtlyCritchlow Jan 8, 2025
87ac13d
fix: removed print statement.
CurtlyCritchlow Jan 8, 2025
ddabc3c
chore: updates due to flutter 3.27.1
CurtlyCritchlow Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,51 +48,50 @@ class ProfileHeaderView extends StatelessWidget {
return null;
},
builder: (BuildContext context, PreferredViewLayout? viewLayout) {
return switch (viewLayout) {
null => const Center(child: Spinner()),
PreferredViewLayout.minimal => CustomCard.profileHeader(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: Sizes.p10),
child: Row(
children: [
const ProfileSelectAllBox(),
gapW10,
ProfileHeaderColumn(title: strings.profileName, layout: PreferredViewLayout.minimal),
gapW10,
Text(strings.status),
// gapW10,
// //Run button
// gapW40,
// gapW10,
// favorite button
],
print('header rebuild');
CurtlyCritchlow marked this conversation as resolved.
Show resolved Hide resolved
return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
final width = SizeConfig.setProfileFieldWidth();
return switch (viewLayout) {
null => const Center(child: Spinner()),
PreferredViewLayout.minimal => CustomCard.profileHeader(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: Sizes.p10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const ProfileSelectAllBox(),
gapW10,
ProfileHeaderColumn(title: strings.profileName, width: width),
gapW10,
ProfileHeaderColumn(title: strings.status, width: width),
],
),
),
),
),
PreferredViewLayout.sshStyle => CustomCard.profileHeader(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: Sizes.p10),
child: Row(
children: [
const ProfileSelectAllBox(),
gapW10,
ProfileHeaderColumn(title: strings.profileName),
gapW10,
ProfileHeaderColumn(title: strings.deviceName),
gapW10,
ProfileHeaderColumn(title: strings.serviceMapping),
gapW10,
Text(strings.status),
// gapW10,
// //Run button
// gapW40,
// gapW10,
// favorite button
],
PreferredViewLayout.sshStyle => CustomCard.profileHeader(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: Sizes.p10),
child: Row(
children: [
const ProfileSelectAllBox(),
gapW10,
ProfileHeaderColumn(
title: strings.profileName,
width: width,
),
gapW10,
ProfileHeaderColumn(title: strings.deviceName, width: width),
gapW10,
ProfileHeaderColumn(title: strings.serviceMapping, width: width),
gapW10,
ProfileHeaderColumn(
title: strings.status, width: SizeConfig.setProfileFieldWidth(statusField: true)),
],
),
),
),
),
};
};
});
},
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import 'package:flutter/material.dart';
import 'package:npt_flutter/features/profile/profile.dart';
import 'package:npt_flutter/features/settings/models/settings.dart';
import 'package:npt_flutter/styles/sizes.dart';

class ProfileViewMinimal extends StatelessWidget {
const ProfileViewMinimal({super.key});

@override
Widget build(BuildContext context) {
return const Row(children: [
ProfileSelectBox(),
gapW10,
ProfileDisplayName(layout: PreferredViewLayout.minimal),
gapW10,
ProfileStatusIndicator(),
gapW10,
ProfileRunButton(),
gapW10,
ProfileFavoriteButton(),
gapW10,
ProfilePopupMenuButton(),
gapW20,
]);
return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
final width = SizeConfig.setProfileFieldWidth();

return Row(children: [
const ProfileSelectBox(),
gapW10,
ProfileDisplayName(width: width),
gapW10,
ProfileStatusIndicator(width: SizeConfig.setProfileFieldWidth(statusField: true)),
const Spacer(),
const ProfileRunButton(),
gapW10,
const ProfileFavoriteButton(),
gapW10,
const ProfilePopupMenuButton(),
gapW20,
]);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@ class ProfileViewSshStyle extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const Row(children: [
ProfileSelectBox(),
gapW10,
ProfileDisplayName(),
gapW10,
ProfileDeviceName(),
gapW10,
ProfileServiceView(),
gapW10,
ProfileStatusIndicator(),
gapW10,
ProfileRunButton(),
gapW10,
ProfileFavoriteButton(),
gapW10,
ProfilePopupMenuButton(),
gapW20,
]);
return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
final width = SizeConfig.setProfileFieldWidth();
return Row(mainAxisSize: MainAxisSize.min, children: [
const ProfileSelectBox(),
gapW10,
ProfileDisplayName(width: width),
gapW10,
ProfileDeviceName(width: width),
gapW10,
ProfileServiceView(width: width),
gapW10,
ProfileStatusIndicator(width: SizeConfig.setProfileFieldWidth(statusField: true)),
gapW10,
const Flexible(child: ProfileRunButton()),
gapW10,
const Flexible(child: ProfileFavoriteButton()),
gapW10,
const Flexible(child: ProfilePopupMenuButton()),
gapW10
]);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import 'package:npt_flutter/features/profile/profile.dart';
import '../../../styles/sizes.dart';

class ProfileDeviceName extends StatelessWidget {
const ProfileDeviceName({super.key});

const ProfileDeviceName({required this.width, super.key});
final double width;
@override
Widget build(BuildContext context) {
final deviceWidth = MediaQuery.of(context).size.width;
return SizedBox(
width: deviceWidth * Sizes.profileFieldsWidthFactor,
width: width,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: BlocSelector<ProfileBloc, ProfileState, (String, String)?>(selector: (state) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:npt_flutter/features/profile/profile.dart';
import 'package:npt_flutter/features/settings/models/settings.dart';

import '../../../styles/sizes.dart';

class ProfileDisplayName extends StatelessWidget {
const ProfileDisplayName({super.key, this.layout = PreferredViewLayout.sshStyle});
const ProfileDisplayName({
required this.width,
super.key,
});

final PreferredViewLayout layout;
final double width;

@override
Widget build(BuildContext context) {
final deviceWidth = MediaQuery.of(context).size.width;
final double widthFactor =
layout == PreferredViewLayout.sshStyle ? Sizes.profileFieldsWidthFactor : Sizes.profileFieldsWidthFactorAlt;
return SizedBox(
width: deviceWidth * widthFactor,
width: SizeConfig.setProfileFieldWidth(),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: BlocSelector<ProfileBloc, ProfileState, String?>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import 'package:flutter/material.dart';
import 'package:npt_flutter/features/settings/models/settings.dart';
import 'package:npt_flutter/styles/sizes.dart';

class ProfileHeaderColumn extends StatelessWidget {
const ProfileHeaderColumn({super.key, required this.title, this.layout = PreferredViewLayout.sshStyle});
const ProfileHeaderColumn({super.key, required this.title, required this.width});

final String title;
final PreferredViewLayout layout;
final double width;

@override
Widget build(BuildContext context) {
final deviceWidth = MediaQuery.of(context).size.width;
final double widthFactor =
layout == PreferredViewLayout.sshStyle ? Sizes.profileFieldsWidthFactor : Sizes.profileFieldsWidthFactorAlt;

return SizedBox(width: deviceWidth * widthFactor, child: Text(title));
return SizedBox(width: width, child: Text(title));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import 'package:npt_flutter/features/profile/profile.dart';
import '../../../styles/sizes.dart';

class ProfileServiceView extends StatelessWidget {
const ProfileServiceView({super.key});

const ProfileServiceView({required this.width, super.key});
final double width;
@override
Widget build(BuildContext context) {
final deviceWidth = MediaQuery.of(context).size.width;
return SizedBox(
width: deviceWidth * Sizes.profileFieldsWidthFactor,
width: width,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: BlocSelector<ProfileBloc, ProfileState, (int, String, int)?>(selector: (state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import 'package:npt_flutter/styles/sizes.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';

class ProfileStatusIndicator extends StatelessWidget {
const ProfileStatusIndicator({super.key});

const ProfileStatusIndicator({required this.width, super.key});
final double width;
@override
Widget build(BuildContext context) {
final strings = AppLocalizations.of(context)!;
return Expanded(

return SizedBox(
width: width,
child: BlocBuilder<ProfileBloc, ProfileState>(builder: (BuildContext context, ProfileState state) {
log(state.runtimeType.toString());
if (state is ProfileLoading) {
Expand Down Expand Up @@ -105,6 +107,7 @@ class StatusMessage extends StatelessWidget {
return Tooltip(
message: tooltip,
child: ListTile(
contentPadding: EdgeInsets.zero,
leading: PhosphorIcon(
icon,
color: color,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ProfileFormView extends StatelessWidget {
Align(
alignment: Alignment.topCenter,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
CustomCard.profileFormContent(
Expand All @@ -37,16 +37,16 @@ class ProfileFormView extends StatelessWidget {
child: Form(
key: formkey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const ProfileDisplayNameTextField(),
gapH10,
const Padding(
padding: EdgeInsets.symmetric(horizontal: Sizes.p50),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ProfileDeviceAtSignTextField(),
gapW143,
ProfileDeviceNameTextField(),
],
),
Expand All @@ -57,10 +57,12 @@ class ProfileFormView extends StatelessWidget {
const Padding(
padding: EdgeInsets.symmetric(horizontal: Sizes.p50),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.start,
children: [
ProfileLocalPortSelector(),
gapW103,
ProfileRemoteHostTextField(),
gapW103,
ProfileRemotePortSelector(),
],
),
Expand All @@ -69,23 +71,21 @@ class ProfileFormView extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: Sizes.p50),
child: Builder(
builder: (context) => Center(
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () {
if (!formkey.currentState!.validate()) return;
builder: (context) => SizedBox(
width: Sizes.p743,
child: ElevatedButton(
onPressed: () {
if (!formkey.currentState!.validate()) return;

var localBloc = context.read<ProfileBloc>();
if (localBloc.state is! ProfileLoadedState) return;
var localBloc = context.read<ProfileBloc>();
if (localBloc.state is! ProfileLoadedState) return;

/// Now take the localBloc and upload it back to the global bloc
context.read<ProfileCacheCubit>().getProfileBloc(uuid).add(ProfileSaveEvent(
profile: (localBloc.state as ProfileLoadedState).profile,
));
},
child: Text(strings.submit),
),
/// Now take the localBloc and upload it back to the global bloc
context.read<ProfileCacheCubit>().getProfileBloc(uuid).add(ProfileSaveEvent(
profile: (localBloc.state as ProfileLoadedState).profile,
));
},
child: Text(strings.submit),
),
),
),
Expand Down
Loading
Loading