Skip to content

Conversation

Grodien
Copy link
Collaborator

@Grodien Grodien commented Oct 16, 2025

No description provided.

@Grodien Grodien marked this pull request as ready for review October 16, 2025 14:52
// THEN
expect(animationData1, isNotNull);
expect(animationData1!.startOffset, 0.0);
expect(animationData1.endOffset, 108.0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

die Zahlen sind ein bisschen magisch -

ich denke ihnen einen Namen zu geben, würde helfen den Test besser zu verstehen, weil aktuell weiss man nicht so ganz was erwartet wird

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... absolut nicht sicher was du für ein Namen hier erwartest. "ExpectedAnimationData1StartOffset = 0.0" würde absolut kein value adden. Ich habe die Titel der Tests noch angepasst, damit sie sprechender sind.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool mit den Tests, ich denke die magischen Zahlen noch einen Namen zu geben oder einen besseren Titel in den Testbeschreibungen hilft zu verstehen, was getestet werden soll.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Titel ist verbessert, variablen Namen sehe ich nicht wie das helfen soll :/

import 'package:sfera/component.dart';
import 'package:sfera/src/model/journey/order_priority.dart';

class GroupedJourneyPoint extends JourneyPoint {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Einerseits verstehe ich den Need, andererseits frage ich mich schon, ob das SFERA Modul wirklich wissen muss, dass bestimmte JourneyPoints gruppiert werden müssen (eigentlich nur wegen Anforderungen an die Anzeige)...

Frage mich das auch schon länger bei den BaliseLevelCrossingGroupings...

Also wir leaken halt recht viel Anzeige Details hier ins Sfera modul..

Copy link
Collaborator Author

@Grodien Grodien Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja du hast wohl mit allen Punkten Recht, jedoch ist das nicht wirklich einfach weg zu bekommen und der Benefit Rechtfertigt ein Riesen Refactoring aktuell meiner Meinung nach nicht. Hatten die Diskussion ja glaub schonmal.

Z.b. base_data_extension liegt auch im sfera drin, was eigentlich das grouping fürs UI macht.

other is LevelCrossing &&
runtimeType == other.runtimeType &&
order == other.order &&
_originalOrder == other._originalOrder &&
Copy link
Collaborator

@smallTrogdor smallTrogdor Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, wenn originalOrder nicht gesetzt ist, wird die order im == berücksichtigt, wenn es gesetzt ist, dann nicht ... das könnte zu ekligen Bugs führen.. lieber dann auch order immer berücksichtigen..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original order ist immer gesetzt (wird im consturctor auf order gesetzt, wenn es nicht mitgegeben wird).

Order wird im == nicht berücksichtigt, damit das equals funktioniert auch wenn die order für die anzeige auf die order der balise gesetzt wird. Ist also intended dass order im vergleich fehlt.

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is BaliseLevelCrossingGroup &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BaliseLevelCrossingGroup ersetzen

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍

required super.order,
required super.kilometre,
}) : super(type: Datatype.levelCrossing);
int? originalOrder,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wozu wird originalOrder eigentlich benötigt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wie im anderen Kommentar: für das equals (damit es in der Gruppe gefunden wird).

@smallTrogdor smallTrogdor self-requested a review October 17, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants