Skip to content

Graph page topic selection preset#629

Open
TheJeffreyKuo wants to merge 5 commits into
developfrom
566-add-graph-page-topic-selection-presets
Open

Graph page topic selection preset#629
TheJeffreyKuo wants to merge 5 commits into
developfrom
566-add-graph-page-topic-selection-presets

Conversation

@TheJeffreyKuo
Copy link
Copy Markdown

Changes

Adds a client-side topic-selection preset system to the graph page so engineers can save and reapply named topic groupings without having to reselect each session. New GraphPresetService persists presets in localStorage. New PresetDialogComponent provides save selection, apply, upload, download, delete, and restore defaults actions. It opens from both graph sidebars via DialogService. The graph sidebar gets a presets row above the topic tree containing a select dropdown for fast applying and a manage button, with the dropdown's defaultValue bound to activePresetName so it tracks the live selection.

Notes

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #566

@TheJeffreyKuo TheJeffreyKuo self-assigned this Apr 28, 2026
Comment thread angular-client/src/pages/graph-page/preset-dialog/preset-dialog.component.ts Outdated
Comment thread angular-client/src/pages/graph-page/preset-dialog/preset-dialog.component.ts Outdated
Comment thread angular-client/src/pages/graph-page/preset-dialog/preset-dialog.component.ts Outdated
// silently skipped on Apply (with a warn toast), not hard-errored.
export const PRESET_SEEDS: PresetSeed[] = [
{
name: 'test preset',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'test preset' ships to every fresh user via loadOrSeed(). Replace with real defaults or empty array.

Comment thread angular-client/src/services/graph-preset.service.ts Outdated
@TheJeffreyKuo TheJeffreyKuo requested a review from bracyw April 29, 2026 21:29
<button
pButton
type="button"
label="Restore defaults"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the name of this button and the related functions to something more related to it's function: something like sync current templates or something like that.

Copy link
Copy Markdown
Collaborator

@bracyw bracyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple changes. Mainly to the service. This is gonna be a 🔥 feature.

also for UI: can you work on the spacing a little, considering we have a little more time now.
Screenshot 2026-05-16 at 12 06 34 AM

}
});
ref.onClose.pipe(take(1)).subscribe((matched: DataType[] | null) => {
if (matched) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip setSelectedDataTypes when matched is empty and unknown isn't; let the "Unknown Topics Skipped" warn toast be the only feedback

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: if (matched && matched.length > 0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also do the same for mobile sidebar

import { TestBed } from '@angular/core/testing';
import { GraphPresetService, PRESET_SEEDS, Preset } from './graph-preset.service';

const STORAGE_KEY = 'argos.graphPresets';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test failures

export class GraphPresetService {
private topicSelectionService = inject(TopicSelectionService);
private messageService = inject(MessageService);
private subject = new BehaviorSubject<Preset[]>([]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can add some more descriptive naming here.


replacePreset = (id: string, patch: Partial<Pick<Preset, 'name' | 'topicNames'>>): void => {
const next = this.subject.value.map((p) => {
if (p.id !== id) return p;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be able to be simplified

private messageService = inject(MessageService);
private subject = new BehaviorSubject<Preset[]>([]);
private presets$ = this.subject.asObservable();
private activePresetName$: Observable<string | undefined> = combineLatest([
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually can you do some looking into a documentation on this whole service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add graph page topic selection presets

2 participants