Revert "Keep a place, and come back to it"
This reverts commit bd3a5a4. The bookmarks work was committed onto this branch
by mistake — it belongs to its own pull request, and it has one, branched from
this branch's own tip. Reverting rather than rewinding because the branch is
published and a pull request is open against it: the diff this pull request
shows is what matters, and after this it shows the routing change alone.
This commit is contained in:
@@ -13,7 +13,6 @@ import { ExoplanetRecord } from '../../shared/models/exoplanet.model';
|
||||
import { applyMilkyWaySkybox, createGlowSprite } from '../../shared/rendering/skybox';
|
||||
import { loadCachedTexture, MILKY_WAY_SKYBOX_PATH, SUN_TEXTURE_PATH } from '../../shared/rendering/texture-catalog';
|
||||
import { StarRecord } from '../../shared/models/star.model';
|
||||
import { Bookmark } from '../../shared/state/bookmarks.store';
|
||||
import { NavigationStore, ViewLevel } from '../../shared/state/navigation.store';
|
||||
import { CameraRigController } from './camera-rig-controller';
|
||||
import { DeepSkyRenderer } from './deep-sky-renderer';
|
||||
@@ -226,14 +225,12 @@ function galacticOverviewPose(): { position: THREE.Vector3; target: THREE.Vector
|
||||
[routeResult]="routeResult()"
|
||||
[routeOptions]="routeOptions()"
|
||||
[currentStar]="currentStarOption()"
|
||||
[keepableStarId]="navigationStore.selectedStarId()"
|
||||
defaultTab="readout"
|
||||
(displayChange)="display.set($event)"
|
||||
(routeQuery)="onRouteQuery($event)"
|
||||
(routeRequested)="onRouteRequested($event)"
|
||||
(routeStarSelected)="navigationStore.selectStar($event)"
|
||||
(jumpRangeChange)="jumpRangePc.set($event)"
|
||||
(bookmarkChosen)="goToBookmark($event)"
|
||||
/>
|
||||
</div>
|
||||
`
|
||||
@@ -1207,15 +1204,6 @@ export class GalaxySystemSceneComponent implements AfterViewInit, OnDestroy {
|
||||
this.clearObjectCard();
|
||||
}
|
||||
|
||||
/** A kept place, revisited: a star is a system to fly into, a body is a page to open. */
|
||||
goToBookmark(bookmark: Bookmark): void {
|
||||
if (bookmark.kind === 'star') {
|
||||
this.navigationStore.selectStar(Number(bookmark.id));
|
||||
} else {
|
||||
this.openObjectDetail(String(bookmark.id));
|
||||
}
|
||||
}
|
||||
|
||||
/** The deliberate step out to the dedicated route, from the card's own control. */
|
||||
openObjectDetail(id: string): void {
|
||||
this.navigationStore.selectBody(id);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
|
||||
|
||||
import { BodyDetailViewModel } from '../body-detail/body-detail.model';
|
||||
import { bodyReadouts } from '../body-detail/body-readouts';
|
||||
import { BookmarksStore } from '../../shared/state/bookmarks.store';
|
||||
import { BookmarkIconComponent } from '../../shared/ui/bookmark-icon.component';
|
||||
import { ReadoutSectionsComponent } from '../body-detail/readout-sections.component';
|
||||
import { ChevronIconComponent } from '../../shared/ui/chevron-icon.component';
|
||||
|
||||
@@ -21,7 +19,7 @@ import { ChevronIconComponent } from '../../shared/ui/chevron-icon.component';
|
||||
@Component({
|
||||
selector: 'app-system-object-card',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [BookmarkIconComponent, ChevronIconComponent, ReadoutSectionsComponent],
|
||||
imports: [ChevronIconComponent, ReadoutSectionsComponent],
|
||||
// Positioned and full-bleed like the HUD's own host, so the panel inside it resolves against
|
||||
// the scene rather than against whatever box the inline default would have left it in — which
|
||||
// put the card off the bottom-left corner of the viewport entirely.
|
||||
@@ -38,16 +36,6 @@ import { ChevronIconComponent } from '../../shared/ui/chevron-icon.component';
|
||||
<p class="truncate text-lg leading-tight font-bold tracking-[0.04em] text-text uppercase">{{ body().name }}</p>
|
||||
<p class="type-eyebrow mt-1 truncate text-accent">{{ readouts().kindLabel }} · {{ body().hostStarName }}</p>
|
||||
</header>
|
||||
<button
|
||||
type="button"
|
||||
[attr.aria-label]="(bookmarks.has('body', body().id) ? 'Forget ' : 'Keep ') + body().name"
|
||||
[attr.aria-pressed]="bookmarks.has('body', body().id)"
|
||||
(click)="bookmarks.toggle({ kind: 'body', id: body().id, name: body().name })"
|
||||
class="shrink-0 p-1 transition-colors focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-accent"
|
||||
[class]="bookmarks.has('body', body().id) ? 'text-accent' : 'text-muted hover:text-accent'"
|
||||
>
|
||||
<app-bookmark-icon class="h-3.5 w-3.5" [kept]="bookmarks.has('body', body().id)" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
(click)="dismissed.emit()"
|
||||
@@ -81,7 +69,5 @@ export class SystemObjectCardComponent {
|
||||
/** Request for the full `/body/:id` route. */
|
||||
readonly openRequested = output<void>();
|
||||
|
||||
readonly bookmarks = inject(BookmarksStore);
|
||||
|
||||
readonly readouts = computed(() => bodyReadouts(this.body()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user