Skip to content

Commit b7eb803

Browse files
Refactor: resolve UI architecture tech debt and accessibility bugs (fixes #196) (#197)
1 parent 456b578 commit b7eb803

165 files changed

Lines changed: 2405 additions & 1730 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/app/app.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ class QueryaApp extends StatelessWidget {
4848
scale: scale,
4949
child: MediaQuery(
5050
data: (mq ?? const MediaQueryData()).copyWith(
51-
textScaler: TextScaler.linear(scale),
51+
textScaler: TextScaler.linear(
52+
(mq ?? const MediaQueryData())
53+
.textScaler
54+
.scale(1.0) *
55+
scale,
56+
),
5257
),
5358
child: QueryaThemeScope(
5459
data: queryaTheme,

lib/core/database/mongodb_connection.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ class MongoConnection {
9494
// fall back to "admin" (Mongo's default authSource).
9595
final existingAuthSource = uri.queryParameters['authSource'];
9696
final hasCredentials =
97-
uri.userInfo.isNotEmpty ||
98-
(username != null && username!.isNotEmpty);
97+
uri.userInfo.isNotEmpty || (username != null && username!.isNotEmpty);
9998

10099
Map<String, String>? newQueryParams;
101100
if (existingAuthSource == null && hasCredentials) {

lib/core/database/mongodb_service.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,16 @@ class MongoService {
126126

127127
return _withDb(connection, database, (db) async {
128128
final coll = db.collection(collection);
129-
129+
130130
final selector = where;
131131
if (filter != null && filter.isNotEmpty) {
132132
selector.raw(filter);
133133
}
134134
if (sort != null && sort.isNotEmpty) {
135135
for (final entry in sort.entries) {
136-
final isDesc = entry.value == -1 || entry.value == 'desc' || entry.value == 'DESC';
136+
final isDesc = entry.value == -1 ||
137+
entry.value == 'desc' ||
138+
entry.value == 'DESC';
137139
selector.sortBy(entry.key, descending: isDesc);
138140
}
139141
}

lib/core/database/postgres_connection.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,7 @@ ORDER BY grantee, privilege_type
700700
.toList();
701701
}
702702

703-
static String _quoteIdent(String id) =>
704-
'"${id.replaceAll('"', '""')}"';
703+
static String _quoteIdent(String id) => '"${id.replaceAll('"', '""')}"';
705704

706705
static bool _parsePgBool(Object? v) {
707706
if (v is bool) return v;

lib/core/database/postgres_connection_pool.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class PostgresConnectionPool {
7979
entry.refs++;
8080
if (!entry.connection.isConnected) {
8181
await entry.connection.connect();
82-
await entry.connection.setSessionReadOnly(mode == PgSessionMode.readOnly);
82+
await entry.connection
83+
.setSessionReadOnly(mode == PgSessionMode.readOnly);
8384
}
8485
return PgLease._(this, k, entry.connection);
8586
}

lib/core/database/postgres_sql.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,3 @@ String injectSqlLimit(String sql, int limit) {
7373

7474
return '$body\nLIMIT $limit$suffix';
7575
}
76-

lib/core/database/redis_connection.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ class RedisConnection {
125125
final result = await sendCommand(args);
126126
if (result is List && result.length == 2) {
127127
final nextCursor = int.tryParse(result[0].toString()) ?? 0;
128-
final keys = (result[1] as List?)
129-
?.map((e) => e.toString())
130-
.toList() ??
131-
[];
128+
final keys =
129+
(result[1] as List?)?.map((e) => e.toString()).toList() ?? [];
132130
return (nextCursor, keys);
133131
}
134132
return (0, <String>[]);

lib/core/editor/querya_code_editor.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ class _QueryaCodeEditorState extends State<QueryaCodeEditor> {
309309
decoration: material.InputDecoration(
310310
border: material.InputBorder.none,
311311
hintText: widget.hintText,
312-
contentPadding: widget.contentPadding ??
313-
const material.EdgeInsets.all(12),
312+
contentPadding:
313+
widget.contentPadding ?? const material.EdgeInsets.all(12),
314314
),
315315
onChanged: widget.onChanged,
316316
);

lib/core/editor/querya_highlight_controller.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ class QueryaHighlightController extends TextEditingController {
4343
required bool withComposing,
4444
}) {
4545
final brightness = Theme.of(context).brightness;
46-
final themeConfig = brightness == Brightness.light
47-
? lightThemeConfig
48-
: darkThemeConfig;
46+
final themeConfig =
47+
brightness == Brightness.light ? lightThemeConfig : darkThemeConfig;
4948

5049
if (_cachedText == text &&
5150
_cachedBrightness == brightness &&

lib/core/editor/syntax_highlight_isolate.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ TextStyle? _styleFromSegment(HighlightSegment s, TextStyle? base) {
113113
return (base ?? const TextStyle()).copyWith(
114114
color: s.colorArgb != null ? Color(s.colorArgb!) : null,
115115
fontWeight: _fontWeightFromValue(s.fontWeightValue),
116-
fontStyle: s.fontStyleIndex != null
117-
? FontStyle.values[s.fontStyleIndex!]
118-
: null,
116+
fontStyle:
117+
s.fontStyleIndex != null ? FontStyle.values[s.fontStyleIndex!] : null,
119118
);
120119
}
121120

0 commit comments

Comments
 (0)