Skip to content

Commit

Permalink
feat: Auto-select sessions in active session overview
Browse files Browse the repository at this point in the history
Often users only have one or two sessions and it's faster to
unselect the sessions that are not needed.
  • Loading branch information
MoritzWeber0 committed Dec 2, 2024
1 parent f4b33e5 commit 5f9c44d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export class ActiveSessionsComponent implements OnInit {

ngOnInit(): void {
this.userSessionService.sessions$.subscribe((sessions) => {
const selectedSessionIDs = new Set(
this.sessions.value?.filter((s) => s.selected).map((s) => s.id) ?? [],
const unselectedSessionIDs = new Set(
this.sessions.value?.filter((s) => !s.selected).map((s) => s.id) ?? [],
);

this.sessions.next(
sessions?.map((s) => ({
...s,
selected: selectedSessionIDs.has(s.id),
selected: !unselectedSessionIDs.has(s.id),
})),
);
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,22 @@ <h1 class="text-2xl">Persistent Workspace Session</h1>
}
}

<div class="flex justify-center">
<button
class="mx-0 w-full items-center"
mat-flat-button
color="primary"
type="submit"
[disabled]="requestInProgress"
>
<span class="hidden items-center gap-1 sm:flex">
Request a session with a persistent workspace
<mat-icon iconPositionEnd>keyboard_arrow_right</mat-icon>
</span>
<span class="flex items-center gap-1 sm:hidden">
Request session
<mat-icon inline>keyboard_arrow_right</mat-icon>
</span>
</button>
</div>
<button
class="mx-0 w-full items-center"
mat-flat-button
color="primary"
type="submit"
[disabled]="requestInProgress"
>
<span class="hidden items-center gap-1 sm:flex">
Request a session with a persistent workspace
<mat-icon iconPositionEnd>keyboard_arrow_right</mat-icon>
</span>
<span class="flex items-center gap-1 sm:hidden">
Request session
<mat-icon inline>keyboard_arrow_right</mat-icon>
</span>
</button>
</form>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { CreateSessionHistoryComponent } from '../create-session-history/create-
@Component({
selector: 'app-create-persistent-session',
templateUrl: './create-persistent-session.component.html',
styleUrls: ['./create-persistent-session.component.css'],
imports: [
FormsModule,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 class="text-xl font-medium">User workspaces</h2>
} @else {
@for (workspace of workspaces | async; track workspace.id) {
<div
class="mat-card collab-card flex flex-wrap items-center justify-between gap-2"
class="collab-card flex flex-wrap items-center justify-between gap-2"
>
<div>
<h2 class="mb-3 text-lg font-medium">
Expand Down

0 comments on commit 5f9c44d

Please sign in to comment.