Skip to content

Commit 0c55d04

Browse files
JrPribsclaude
andcommitted
feat: separate channel carousel from video list functionality
- Added channelRailVisible state to UIStateService for channel carousel - Connected TV button to toggle channel carousel (bottom rail) - Video List button now shows "coming soon" toast message - Updated video controls positioning: 200px desktop, 180px mobile when channel rail visible - Updated side actions positioning to use channelRailVisible state - Channel carousel and video list are now independent features This properly separates the channel navigation carousel from the future video list feature, ensuring the TV button controls the bottom channel rail as intended. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b0889c6 commit 0c55d04

5 files changed

Lines changed: 35 additions & 12 deletions

File tree

src/app/pages/home/components/side-actions/side-actions.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
'translate-x-20': initialAnimation(),
99
'translate-x-0':
1010
!initialAnimation() &&
11-
!uiState.carouselVisible() &&
11+
!uiState.channelRailVisible() &&
1212
!playerState.hideUIOverlays(),
1313
'translate-x-[-280px]':
14-
uiState.carouselVisible() && !playerState.hideUIOverlays(),
14+
uiState.channelRailVisible() && !playerState.hideUIOverlays(),
1515
'translate-x-hidden': playerState.hideUIOverlays(),
1616
'opacity-0': !state().isUserActive || isFullscreenInactive(),
1717
'opacity-100': state().isUserActive && !isFullscreenInactive()

src/app/pages/home/components/side-actions/side-actions.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
VolumeX,
1717
X,
1818
} from 'lucide-angular';
19+
import { MessageService } from 'primeng/api';
1920
import { ToastModule } from 'primeng/toast';
2021

2122
import { ChannelService } from '../../../../services/channel/channel.service';
@@ -32,6 +33,7 @@ import { videoPlayerState } from '../../../../states/video-player.state';
3233
LucideAngularModule,
3334
ToastModule
3435
],
36+
providers: [MessageService],
3537
templateUrl: './side-actions.component.html',
3638
styleUrl: './side-actions.component.css',
3739
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -48,6 +50,7 @@ export class SideActionsComponent implements OnInit {
4850
readonly userActivityState = inject(UserActivityState);
4951
readonly uiState = inject(UIStateService);
5052
readonly destroyRef = inject(DestroyRef);
53+
readonly messageService = inject(MessageService);
5154

5255
// State
5356
readonly playerState = inject(videoPlayerState);
@@ -139,7 +142,13 @@ export class SideActionsComponent implements OnInit {
139142
handleToggleCarousel(event: MouseEvent) {
140143
event.preventDefault();
141144
this.markUserActive();
142-
this.uiState.toggleCarousel();
145+
// Show coming soon message for video list feature
146+
this.messageService.add({
147+
severity: 'info',
148+
summary: 'Coming Soon',
149+
detail: 'Video list feature is coming soon!',
150+
life: 3000
151+
});
143152
}
144153

145154
handleCreateChannel(event: MouseEvent) {
@@ -155,8 +164,8 @@ export class SideActionsComponent implements OnInit {
155164
handleToggleChannelRail(event: MouseEvent) {
156165
event.preventDefault();
157166
this.markUserActive();
158-
// TODO: Implement channel rail toggle functionality
159-
// This should be managed through a proper service or state management
167+
// Toggle the channel rail (bottom carousel)
168+
this.uiState.toggleChannelRail();
160169
}
161170

162171
// Check if we're in fullscreen and user is inactive

src/app/pages/home/components/video-controls/video-controls.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ export class VideoControlsComponent {
6262
muted = this.playerState.muted;
6363
currentVideo = computed(() => this.channelsState.currentVideo());
6464

65-
// Dynamic positioning based on carousel visibility
65+
// Dynamic positioning based on channel rail visibility
6666
bottomPosition = computed(() =>
67-
this.uiState.carouselVisible() ? '160px' : '0px'
67+
this.uiState.channelRailVisible() ? '200px' : '0px'
6868
);
6969

70-
// Mobile bottom position (smaller offset when carousel is visible)
70+
// Mobile bottom position (smaller offset when channel rail is visible)
7171
mobileBottomPosition = computed(() =>
72-
this.uiState.carouselVisible() ? '140px' : '0px'
72+
this.uiState.channelRailVisible() ? '180px' : '0px'
7373
);
7474

7575
// Local state for controls

src/app/pages/home/home.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<app-whytv-player></app-whytv-player>
66
</div>
77

8-
@if (uiState.carouselVisible()) {
8+
@if (uiState.channelRailVisible()) {
99
<whytv-channel-carousel
1010
class="absolute bottom-0 left-[100px] z-[90] w-[calc(100vw-200px)]"
1111
/>

src/app/services/ui-state.service.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import { Injectable } from '@angular/core';
22
import { patchState, signalStore, withMethods, withState } from '@ngrx/signals';
33

44
interface UIState {
5-
carouselVisible: boolean;
5+
carouselVisible: boolean; // For future video list feature
6+
channelRailVisible: boolean; // For channel carousel at bottom
67
}
78

89
const initialState: UIState = {
9-
carouselVisible: false // Default to hidden on load
10+
carouselVisible: false, // Default to hidden on load
11+
channelRailVisible: false // Default to hidden on load
1012
};
1113

1214
@Injectable({
@@ -25,6 +27,18 @@ export class UIStateService extends signalStore(
2527
patchState(store, {
2628
carouselVisible: visible
2729
});
30+
},
31+
32+
toggleChannelRail() {
33+
patchState(store, {
34+
channelRailVisible: !store.channelRailVisible()
35+
});
36+
},
37+
38+
setChannelRailVisible(visible: boolean) {
39+
patchState(store, {
40+
channelRailVisible: visible
41+
});
2842
}
2943
}))
3044
) {}

0 commit comments

Comments
 (0)