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

More progress on broadcast feature #944

Merged
merged 105 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
29eca30
add a new screen with tabs for broadcast screen, move the broadcast r…
julien4215 Aug 16, 2024
c1ddc11
add a dropdown menu to choose tournament in a group and round
julien4215 Aug 22, 2024
82063f6
use user defined locale instead of default locale
julien4215 Aug 23, 2024
1eaae20
add broadcast board screen
julien4215 Aug 19, 2024
b292db3
use adaptive circular progress indicator for broadcast list screen
julien4215 Aug 25, 2024
acf391f
tweak start round date on broadcast cards
julien4215 Aug 26, 2024
4c69c2c
make status of game nullable
julien4215 Aug 27, 2024
8ba6d4d
fix round date starts show on broadcast grid card
julien4215 Aug 27, 2024
8474de8
add a link for broadcast in nb of hours and minutes translations
julien4215 Aug 28, 2024
1913546
handle case where tournament description is null
julien4215 Aug 29, 2024
92e4da1
use Cupertino style for the broadcast screen
julien4215 Aug 29, 2024
af05482
add eval bar to board
julien4215 Aug 31, 2024
0b05ebe
add broadcast own game analysis screen with player and clock widget
julien4215 Aug 31, 2024
996b7e7
update comments and hide eval bar until it is ready
julien4215 Sep 1, 2024
da08315
fix timer by moving it in the controller
julien4215 Sep 6, 2024
25dcbc6
merge main into broadcast branch to fix android impeller issue
julien4215 Sep 6, 2024
5adb49a
rename broadcast game screeen to broadcast analysis screen
julien4215 Sep 6, 2024
f9ff0c4
refactor player widget and fix negative clocks
julien4215 Sep 6, 2024
488d520
fix text overflow and rating null case
julien4215 Sep 6, 2024
9ff8f79
fix broadcast analysis screen, live move are now played on the analys…
julien4215 Sep 7, 2024
34428a1
fix linting
julien4215 Sep 7, 2024
b0d1c32
fix formatting
julien4215 Sep 7, 2024
10fca53
add an orange border around the latest move of a broadcast game
julien4215 Sep 7, 2024
040eca0
show correct clocks on analysis screen board
julien4215 Sep 8, 2024
b012e4c
improve player widget design on broadcast analysis screen and show on…
julien4215 Sep 8, 2024
83ca78e
fix negative duration case
julien4215 Sep 9, 2024
971a430
merge main into broadcast branch to fix conflicts
julien4215 Sep 10, 2024
d30d5a8
revert format change to avoid conflict
julien4215 Sep 17, 2024
b66c827
merge upstream into broadcast
julien4215 Sep 17, 2024
954e2c9
revert the sync of date formatting with selected user locale
julien4215 Sep 17, 2024
5fde6b4
remove Intl.getCurentLocale() to complete the revert
julien4215 Sep 17, 2024
f1c1e95
fix deprecation warnings
julien4215 Sep 17, 2024
f6666b9
add a try/catch when getting broadcast preferences
julien4215 Sep 17, 2024
958c7d4
fix null clock on broadcast analysis screen
julien4215 Sep 21, 2024
7815bdb
remove isUtc since local time is used
julien4215 Sep 22, 2024
c3e36c0
fix test
julien4215 Sep 22, 2024
931efe4
merge upstream main into broadcast
julien4215 Oct 7, 2024
2eace64
format code
julien4215 Oct 7, 2024
2c9be6f
tweak scroll behavior of overview tab
julien4215 Oct 7, 2024
037d4f2
merge main into broadcast to fix tree view conflict
julien4215 Oct 11, 2024
db604ca
merge main into broadcast-feature
julien4215 Oct 20, 2024
1dadbc2
tweak shimmer loading
julien4215 Oct 20, 2024
c62052a
fix broadcast live move
julien4215 Oct 20, 2024
b7c1493
tweak tree rebuilding with broadcast live moves
julien4215 Oct 20, 2024
1bf7445
revert wip file added by mistake
julien4215 Oct 20, 2024
effcb5d
merge branch main into broadcast-feature to fix tree view conflict
julien4215 Oct 21, 2024
5de2157
rename broadcast path variable
julien4215 Oct 21, 2024
e450613
merge main to resolve conflicts
julien4215 Oct 31, 2024
854798b
follow riverpod depreciation notice
julien4215 Oct 31, 2024
275f40d
merge main to get broadcast translation
julien4215 Nov 1, 2024
7c38df7
translate broadcast tabs
julien4215 Nov 1, 2024
ae4bf2f
refactor broadcast analysis screen
julien4215 Nov 1, 2024
891b3d4
correct debug messages related to broadcast id
julien4215 Nov 4, 2024
afdfcaf
correct broadcast analysis option id
julien4215 Nov 4, 2024
3903d79
rename BroadcastAnalysisScreen to BroadcastGameAnalysisScreen
julien4215 Nov 4, 2024
c666bb1
use strong type for broadcast game result
julien4215 Nov 4, 2024
d805ac3
make the request directly rather than through a provider
julien4215 Nov 5, 2024
7053dc5
fix typo
julien4215 Nov 5, 2024
6f64494
create a new broadcast game controller that implements everything tha…
julien4215 Nov 7, 2024
3de1483
merge main into broadcast
julien4215 Nov 12, 2024
7c3bbd3
recreate the broadcast analysis screen that uses the new broadcast ga…
julien4215 Nov 13, 2024
05ddc9a
cleaning code
julien4215 Nov 13, 2024
50c2433
simplify broadcast game controller
julien4215 Nov 14, 2024
8ad1393
remove unused methods in broadcast state
julien4215 Nov 14, 2024
d785d98
remove useless broadcast game state parameters
julien4215 Nov 14, 2024
c8c818b
remove menu to keep only the flip board action
julien4215 Nov 18, 2024
0630064
remove the opening header and the opening screen in bottom bar
julien4215 Nov 18, 2024
dcfa4a0
remove engine depth on broadcast game screen
julien4215 Nov 18, 2024
99eb758
add patch for dropdown menu widget
julien4215 Nov 18, 2024
3232880
merge upstream to get the new clock widget
julien4215 Nov 18, 2024
a855430
use the new clock wigdet
julien4215 Nov 19, 2024
c1dd281
fix conflicts with upstream
julien4215 Nov 19, 2024
751cff1
fix clock test
julien4215 Nov 19, 2024
aaa0e67
cleaning code
julien4215 Nov 20, 2024
47455ae
fix local evaluation setting and tweak broadcast game controller
julien4215 Nov 20, 2024
7aebb8c
rename variables and fix game clock when game ends
julien4215 Nov 20, 2024
5182881
rename variable
julien4215 Nov 20, 2024
7a4dd38
more tweaks
julien4215 Nov 21, 2024
9462117
optimize rebuilds by listening to state in children widgets
julien4215 Nov 21, 2024
4a58a9c
remove rounded borders
julien4215 Nov 21, 2024
a85a608
really fix this time the clock not updating correctly at the end of a…
julien4215 Nov 21, 2024
7af00eb
use the switch syntax instead of when for AsyncValue
julien4215 Nov 21, 2024
ee33372
should fix some rare occurrences where clocks are not appearing on th…
julien4215 Nov 21, 2024
28d8323
fix format
julien4215 Nov 21, 2024
e03e0b4
fix new boards not being added to the round
julien4215 Nov 21, 2024
fd7a0c6
hopefully really really fix the clock not updating at the end of a game
julien4215 Nov 21, 2024
8b43cf6
still play broadcast received moves even if the game ended
julien4215 Nov 21, 2024
e887151
some tweaks
julien4215 Nov 21, 2024
943e003
fix conflicts with upstream
julien4215 Nov 22, 2024
3081d45
use the new AnalysisLayout widget
julien4215 Nov 22, 2024
825dde5
add again rounded borders
julien4215 Nov 22, 2024
dd822ad
fix lint error
julien4215 Nov 23, 2024
80ea3ca
fix last move not highlighted when opening a broadcast game
julien4215 Nov 23, 2024
6459547
really fix last move not highlighted
julien4215 Nov 23, 2024
a364245
restore the PostFrameCallback for tree view removed by mistake
julien4215 Nov 23, 2024
c72c703
add translations
julien4215 Nov 23, 2024
5b3dda4
add animation for boards thumbnails
julien4215 Nov 23, 2024
ba243e1
remove eval bar from this branch as it will not be part of broadcast …
julien4215 Nov 23, 2024
85be210
watch whole state instead of using select
julien4215 Nov 23, 2024
7cd047d
add dropdown_menu fixed widget
julien4215 Nov 26, 2024
0236f6d
merge upstream to get new search time analysis option
julien4215 Nov 27, 2024
be74940
fix linting
julien4215 Nov 27, 2024
669c7c4
fix current node taking a wrong value
julien4215 Nov 27, 2024
9b0aca0
fix wrong broadcast path when not on current broadcast path
julien4215 Nov 27, 2024
1db183e
remove old TODO and renaming
julien4215 Nov 27, 2024
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
67 changes: 54 additions & 13 deletions lib/src/model/broadcast/broadcast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ typedef BroadcastsList = ({
int? nextPage,
});

enum BroadcastResult { whiteWins, blackWins, draw, ongoing, noResultPgnTag }

@freezed
class Broadcast with _$Broadcast {
const Broadcast._();

const factory Broadcast({
required BroadcastTournament tour,
required BroadcastTournamentData tour,
required BroadcastRound round,
required String? group,

Expand All @@ -32,9 +34,42 @@ class Broadcast with _$Broadcast {
String get title => group ?? tour.name;
}

typedef BroadcastTournament = ({
@freezed
class BroadcastTournament with _$BroadcastTournament {
const factory BroadcastTournament({
required BroadcastTournamentData data,
required IList<BroadcastRound> rounds,
required BroadcastRoundId defaultRoundId,
required IList<BroadcastTournamentGroup>? group,
}) = _BroadcastTournament;
}

@freezed
class BroadcastTournamentData with _$BroadcastTournamentData {
const factory BroadcastTournamentData({
required BroadcastTournamentId id,
required String name,
required String? imageUrl,
required String? description,
required BroadcastTournamentInformation information,
}) = _BroadcastTournamentData;
}

typedef BroadcastTournamentInformation = ({
String? format,
String? timeControl,
String? players,
BroadcastTournamentDates? dates,
});

typedef BroadcastTournamentDates = ({
DateTime startsAt,
DateTime? endsAt,
});

typedef BroadcastTournamentGroup = ({
BroadcastTournamentId id,
String name,
String? imageUrl,
});

@freezed
Expand All @@ -45,25 +80,31 @@ class BroadcastRound with _$BroadcastRound {
required BroadcastRoundId id,
required String name,
required RoundStatus status,
required DateTime startsAt,
required DateTime? startsAt,
}) = _BroadcastRound;
}

typedef BroadcastRoundGames = IMap<BroadcastGameId, BroadcastGameSnapshot>;
typedef BroadcastRoundGames = IMap<BroadcastGameId, BroadcastGame>;

@freezed
class BroadcastGameSnapshot with _$BroadcastGameSnapshot {
const BroadcastGameSnapshot._();
class BroadcastGame with _$BroadcastGame {
const BroadcastGame._();

const factory BroadcastGameSnapshot({
const factory BroadcastGame({
required BroadcastGameId id,
required IMap<Side, BroadcastPlayer> players,
required String fen,
required Move? lastMove,
required String status,

/// The amount of time that the player whose turn it is has been thinking since his last move
required Duration? thinkTime,
}) = _BroadcastGameSnapshot;
required BroadcastResult status,
required DateTime updatedClockAt,
}) = _BroadcastGame;

bool get isOngoing => status == BroadcastResult.ongoing;
bool get isOver =>
status == BroadcastResult.draw ||
status == BroadcastResult.whiteWins ||
status == BroadcastResult.blackWins;
Side get sideToMove => Setup.parseFen(fen).turn;
}

@freezed
Expand Down
Loading