35 Commits

Author SHA1 Message Date
shahdlala66 fd8ac63dc3 fix: Merge branch 'feat/NCS-69' of git.janis-eccarius.de:NowChess/NowChess-Frontend into feat/NCS-69 2026-05-12 22:33:01 +02:00
shahdlala66 c4575fd219 fix: Merge branch 'feat/NCS-69' of git.janis-eccarius.de:NowChess/NowChess-Frontend into feat/NCS-69 2026-05-12 22:30:36 +02:00
shahdlala66 8eb27ba8b9 fix: Merge branch 'main' of git.janis-eccarius.de:NowChess/NowChess-Frontend into feat/NCS-69 2026-05-12 22:18:09 +02:00
shahdlala66 7de4f3784b fix: path problem
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 09:19:03 +02:00
shahdlala66 04df2250e9 feat: dockerfile added 2026-05-06 09:07:33 +02:00
shahdlala66 99100a3086 fix: no more build errors 2026-05-06 08:59:36 +02:00
Lala, Shahd e3466bda30 feat: game starts after accept 2026-05-05 22:25:49 +00:00
Lala, Shahd 550db1401b feat: challange request, accept, decline, page, added (not complete, polling issues, and not stable, and too much code for nothing) 2026-05-05 22:14:45 +00:00
Lala, Shahd 6a79be45bf feat: challange request, accept, decline, page, added (not complete, polling issues, and not stable, and too much code for nothing)
Co-authored-by: Copilot <copilot@github.com>
2026-05-05 22:14:20 +00:00
Lala, Shahd 82bf006f18 fix: proxy issues
Co-authored-by: Copilot <copilot@github.com>
2026-05-05 19:42:27 +00:00
Lala, Shahd 13edcb2f69 chore(merge): sync main into feat-ncs-66 2026-05-05 19:24:14 +00:00
Lala, Shahd 49d6aae1db feat: copy username 2026-05-05 18:52:12 +00:00
Lala, Shahd eadcd770ba feat: profile info view (player ID, rating etc) 2026-05-04 21:43:12 +00:00
shahdlala66 a3255602b3 feat: me tab added 2026-05-04 19:48:55 +02:00
Lala, Shahd d471eef7af feat: abstract buttons 2026-05-04 09:56:09 +02:00
Lala, Shahd 361ce1e817 feat: login and register, style is not ready 2026-05-03 20:49:08 +00:00
Lala, Shahd aa70083aed feat: login and register, style is not ready 2026-05-03 20:44:01 +00:00
shahdlala66 3b757d7ff7 feat: added a cat not sure about it tho 2026-04-28 22:45:37 +02:00
shahdlala66 19f3359106 style: more colors for windows 2026-04-26 22:13:33 +02:00
shahdlala66 d676288315 style: changed colors etc 2026-04-26 22:13:26 +02:00
shahdlala66 671886781e feat: new boared design 2026-04-26 13:34:55 +02:00
shahdlala66 dc9a7b2e32 feat: drag and drop 2026-04-22 13:16:44 +02:00
shahdlala66 5951257c99 feat: move history, export import fixed, timer added 2026-04-22 13:05:09 +02:00
shahdlala66 a59e2a023b style: bigger gifs 2026-04-22 09:31:15 +02:00
shahdlala66 4f76bcc7c6 feat: piece pormotion 2026-04-22 08:35:58 +02:00
shahdlala66 25b69fd7b6 feat: clean ups and shorter files 2026-04-22 08:28:16 +02:00
shahdlala66 c18026bce6 feat: added dark and light mode 2026-04-22 08:19:16 +02:00
shahdlala66 91fa247696 style: added new gifs (optianl) 2026-04-21 15:12:41 +02:00
shahdlala66 97365371c8 feat: new spec 2026-04-21 13:40:48 +02:00
shahdlala66 fdc0f1d73b feat: join pervious game added 2026-04-19 11:14:14 +02:00
shahdlala66 bc644c16e3 feat: 1vs BOT 2026-04-19 01:06:13 +02:00
shahdlala66 5497997455 feat: more components 2026-04-19 01:00:14 +02:00
shahdlala66 53459648c6 style: styles file added 2026-04-19 00:24:43 +02:00
shahdlala66 8c97a726a7 fix: removed repetitve code 2026-04-19 00:12:13 +02:00
shahdlala66 2582f8e4d6 style: brought back old style for text input 2026-04-19 00:05:52 +02:00
8 changed files with 39 additions and 83 deletions
-20
View File
@@ -18,23 +18,3 @@
* removed cache files ([7ee59c4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/7ee59c434bf137a08fd560bbc02ceefbcfd90f04))
* size of pieces and removed text view of the game state ([c60d00f](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/c60d00f9d25247504845654615065fbccd7fe448))
* structure ([3e8c7c4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/3e8c7c4057e55aeec7cee8c24f6751ff24912c93))
## [0.0.0](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/compare/0.1.0...0.0.0) (2026-05-12)
### Features
* NCS-69 Challenge request ([#3](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/3)) ([bad7366](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/bad7366bdbb048c20218257b30ac22efc9ecb6db))
## [0.0.0](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/compare/0.2.0...0.0.0) (2026-05-12)
### Bug Fixes
* NCWF-1 401 ([#5](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/5)) ([f8f93ef](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/f8f93efff48f1d7198023fed45b675c2e225df36))
## [0.0.0](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/compare/0.2.1...0.0.0) (2026-05-12)
### Bug Fixes
* NCWF-1 401 ([#6](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/6)) ([6d1e06d](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/6d1e06dfd606b93d029e9c9b84eea6f8b3b6294e))
## [0.0.0](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/compare/0.2.2...0.0.0) (2026-05-14)
### Bug Fixes
* added missing challenge routes ([61000f8](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/61000f8a22aff8b524664a756cc933834365f923))
-2
View File
@@ -2,12 +2,10 @@ import { Routes } from '@angular/router';
import { GameComponent } from './pages/game/game.component';
import { WelcomeComponent } from './pages/welcome/welcome.component';
import { ProfileComponent } from './pages/profile/profile.component';
import { ChallengesComponent } from './pages/challenges/challenges.component';
export const routes: Routes = [
{ path: '', component: WelcomeComponent },
{ path: 'profile', component: ProfileComponent },
{ path: 'challenges', component: ChallengesComponent },
{ path: 'game/:gameId', component: GameComponent },
{ path: '**', redirectTo: '' }
];
@@ -263,14 +263,6 @@
</div>
}
@if (showChallengeDialog) {
<div class="dialog-overlay" (click)="closeChallengeDialog()">
<div class="dialog-card" (click)="$event.stopPropagation()">
<app-challenge-create-dialog (closeChallengeDialog)="closeChallengeDialog()"></app-challenge-create-dialog>
</div>
</div>
}
@if (errorMessage) {
<p class="error-banner">{{ errorMessage }}</p>
}
+24 -13
View File
@@ -67,7 +67,6 @@ export class WelcomeComponent implements OnInit, OnDestroy {
showOptionsDialog = false;
showJoinDialog = false;
showImportDialog = false;
showChallengeDialog = false;
gameIdInput = '';
importMode: ImportMode = 'fen';
@@ -224,21 +223,11 @@ export class WelcomeComponent implements OnInit, OnDestroy {
}
startOneVsOne(): void {
if (!this.requireAuth(() => this.openChallengeDialog())) {
if (!this.requireAuth(() => this.performStartOneVsOne())) {
return;
}
this.openChallengeDialog();
}
openChallengeDialog(): void {
this.closeAllDialogs();
this.showChallengeDialog = true;
}
closeChallengeDialog(): void {
this.showChallengeDialog = false;
this.errorMessage = '';
this.performStartOneVsOne();
}
startVsBot(difficulty: Difficulty): void {
@@ -363,6 +352,28 @@ export class WelcomeComponent implements OnInit, OnDestroy {
action();
}
private performStartOneVsOne(): void {
if (this.creating) {
return;
}
this.errorMessage = '';
this.creating = true;
this.gameApi
.createGame()
.pipe(finalize(() => (this.creating = false)))
.subscribe({
next: (game) => {
void this.router.navigate(['/game', game.gameId], {
state: { theme: this.isSunsetMode ? 'light' : 'dark' }
});
},
error: (error) => {
this.errorMessage = getErrorMessage(error, 'Unable to create a game.');
}
});
}
private performStartVsBot(difficulty: Difficulty): void {
if (this.creating) {
+1 -1
View File
@@ -3,11 +3,11 @@ import { HttpInterceptorFn } from '@angular/common/http';
export const authInterceptor: HttpInterceptorFn = (req, next) => {
const token = localStorage.getItem('token');
// Add token to protected endpoints only (not registration or login)
const isProtectedEndpoint =
req.url.includes('/api/account/me') ||
req.url.includes('/api/account/bots') ||
req.url.includes('/api/account/official-bots') ||
req.url.includes('/api/board/game') ||
req.url.includes('/api/challenge');
if (token && isProtectedEndpoint) {
+7 -17
View File
@@ -10,7 +10,6 @@ export class GameStreamService {
private readonly destroyRef = inject(DestroyRef);
private streamSubscription: Subscription | null = null;
private pollSubscription: Subscription | null = null;
private lastGameStateHash: string | null = null;
startStreaming(
gameId: string,
@@ -21,10 +20,7 @@ export class GameStreamService {
.streamGame(gameId)
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe({
next: (event) => {
this.lastGameStateHash = JSON.stringify(event);
onEvent(event);
},
next: (event) => onEvent(event),
error: () => {
onStreamError();
this.startPolling(gameId, onEvent);
@@ -41,7 +37,7 @@ export class GameStreamService {
return;
}
this.pollSubscription = interval(5000)
this.pollSubscription = interval(1500)
.pipe(
startWith(0),
switchMap(() => this.gameApi.getGame(gameId)),
@@ -49,16 +45,11 @@ export class GameStreamService {
)
.subscribe({
next: (game) => {
// Only emit if game state changed to avoid unnecessary updates
const stateHash = JSON.stringify(game.state);
if (this.lastGameStateHash !== stateHash) {
this.lastGameStateHash = stateHash;
const event: GameStreamEvent = {
type: 'gameFull',
game
};
onEvent(event);
}
const event: GameStreamEvent = {
type: 'gameFull',
game
};
onEvent(event);
}
});
}
@@ -68,6 +59,5 @@ export class GameStreamService {
this.pollSubscription?.unsubscribe();
this.streamSubscription = null;
this.pollSubscription = null;
this.lastGameStateHash = null;
}
}
+5 -20
View File
@@ -84,19 +84,8 @@ export class StreamHandlerService {
}
};
// Set timeout to fallback if WebSocket doesn't connect quickly
const connectionTimeoutId = setTimeout(() => {
if (!connected && !fallbackActive) {
console.warn(`[StreamHandler] WebSocket timeout for ${gameId}, attempting NDJSON fallback`);
ws.close();
void startNdjsonFallback();
}
}, 3000);
ws.onopen = () => {
connected = true;
clearTimeout(connectionTimeoutId);
console.log(`[StreamHandler] WebSocket connected for ${gameId}`);
};
ws.onmessage = (message) => {
@@ -108,23 +97,19 @@ export class StreamHandlerService {
};
ws.onerror = (error) => {
console.warn(`[StreamHandler] WebSocket error for ${gameId}:`, error);
clearTimeout(connectionTimeoutId);
if (!connected && !fallbackActive) {
console.warn(`[StreamHandler] WebSocket error for ${gameId}, attempting NDJSON fallback:`, error);
if (!connected) {
void startNdjsonFallback();
}
};
ws.onclose = () => {
clearTimeout(connectionTimeoutId);
console.warn(`[StreamHandler] WebSocket closed for ${gameId}, connected=${connected}`);
if (connected) {
// Connection was established but closed, stream is complete
observer.complete();
} else if (!fallbackActive) {
// Connection never established, try fallback
if (!connected) {
console.log(`[StreamHandler] Starting NDJSON fallback for ${gameId}`);
void startNdjsonFallback();
} else {
observer.complete();
}
};
+2 -2
View File
@@ -1,3 +1,3 @@
MAJOR=0
MINOR=2
PATCH=3
MINOR=1
PATCH=0