Merge branch 'main' into show-subspace-parents

This commit is contained in:
ggurdin 2024-06-14 13:20:12 -04:00 committed by GitHub
commit 3925a700d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 8 deletions

View file

@ -55,6 +55,9 @@ class IgcController {
try {
if (choreographer.currentText.isEmpty) return clear();
// the error spans are going to be reloaded, so clear the cache
_clearCache();
debugPrint('getIGCTextData called with ${choreographer.currentText}');
debugPrint('getIGCTextData called with tokensOnly = $tokensOnly');
@ -287,6 +290,7 @@ class IgcController {
clear() {
igcTextData = null;
_clearCache();
// Not sure why this is here
// MatrixState.pAnyState.closeOverlay();
}

View file

@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:collection/collection.dart';
import 'package:fluffychat/pangea/config/environment.dart';
import 'package:fluffychat/pangea/enum/span_choice_type.dart';
import 'package:fluffychat/pangea/enum/span_data_type.dart';
@ -80,15 +81,39 @@ class SpanDetailsRepoReqAndRes {
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! SpanDetailsRepoReqAndRes) return false;
return toJson().toString() == other.toJson().toString();
if (other.userL1 != userL1) return false;
if (other.userL2 != userL2) return false;
if (other.enableIT != enableIT) return false;
if (other.enableIGC != enableIGC) return false;
if (other.span.choices
?.firstWhere(
(choice) => choice.type == SpanChoiceType.bestCorrection,
)
.value !=
span.choices
?.firstWhere(
(choice) => choice.type == SpanChoiceType.bestCorrection,
)
.value) return false;
return true;
}
/// Overrides the hashCode getter to generate a hash code for the [SpanDetailsRepoReqAndRes] object.
/// Used as keys in response cache in igc_controller.
@override
int get hashCode {
return toJson().toString().hashCode;
return Object.hashAll([
userL1.hashCode,
userL2.hashCode,
enableIT.hashCode,
enableIGC.hashCode,
span.choices
?.firstWhereOrNull(
(choice) => choice.type == SpanChoiceType.bestCorrection,
)
?.value
.hashCode,
]);
}
}

View file

@ -19,11 +19,7 @@ class BotStyle {
AppConfig.fontSizeFactor *
(big == true ? 1.2 : 1),
fontStyle: italics ? FontStyle.italic : null,
color: setColor
? Theme.of(context).brightness == Brightness.dark
? AppConfig.primaryColorLight
: AppConfig.primaryColor
: null,
color: setColor ? Theme.of(context).colorScheme.primary : null,
inherit: true,
);