diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts
index d6c48f5c..e651d81e 100644
--- a/webapp/src/app/app.routes.ts
+++ b/webapp/src/app/app.routes.ts
@@ -24,7 +24,11 @@ import { accountViewerGuard } from './shared/guards/account-viewer.guard';
import { accountsPageResolver } from './resolvers/accounts-page.resolver';
import { accountsOrganizationResolver } from './resolvers/accounts-organizations.resolver';
import { organizationsOrganizationsResolver } from './resolvers/organizations-organizations.resolver';
-
+import { KeywordsToPersonsResultsComponent } from './modules/keywords-search/search-results/persons-results/persons-results.component';
+import { KeywordsToProjectsResultsComponent } from './modules/keywords-search/search-results/projects-results/projects-results.component';
+import { KeywordsToPatentsResultsComponent } from './modules/keywords-search/search-results/patents-results/patents-results.component';
+import { KeywordsToNewsResultsComponent } from './modules/keywords-search/search-results/news-results/news-results.component';
+import { KeywordsToWorksResultsComponent } from './modules/keywords-search/search-results/works-results/works-results.component';
export const routes: Routes = [
{
path: '',
@@ -103,6 +107,21 @@ export const routes: Routes = [
(mod) => mod.KeywordsSearchComponent,
),
},
+ {
+ path: 'keywords/search-results',
+ loadComponent: () =>
+ import('./modules/keywords-search/search-results/search-results.component').then(
+ (mod) => mod.KeywordsSearchResultsComponent,
+ ),
+ children: [
+ { path: '', pathMatch: 'full', redirectTo: 'persons' },
+ { path: 'persons', component: KeywordsToPersonsResultsComponent },
+ { path: 'projects', component: KeywordsToProjectsResultsComponent },
+ { path: 'patents', component: KeywordsToPatentsResultsComponent },
+ { path: 'works', component: KeywordsToWorksResultsComponent },
+ { path: 'news', component: KeywordsToNewsResultsComponent },
+ ],
+ },
{
path: 'news',
canActivate: [userGuard],
diff --git a/webapp/src/app/modules/account/account.component.html b/webapp/src/app/modules/account/account.component.html
index da753236..098a8e75 100644
--- a/webapp/src/app/modules/account/account.component.html
+++ b/webapp/src/app/modules/account/account.component.html
@@ -63,7 +63,13 @@
[formField]="changePasswordForm.showPasswords"
>Passwörter anzeigen
-
}
+
+ delete_outline
+ Alle löschen
+
-
text_fields
Extrahierte Keywords
-
- account_tree
- Topic Mapping
-
+ @if (topicMappingSearch()) {
+
+ account_tree
+ Topic Mapping
+
+ }
-
- delete_outline
- Alle löschen
-
+
+ Topic Mapping
+
@@ -366,8 +374,8 @@
@if (keywordsExist()) {
-
-
+
+
search
Suchen
+
(null);
readonly showVisualization = signal(false);
+ readonly topicMappingSearch = signal(false);
readonly keywordsExist = computed(
() =>
@@ -160,7 +168,7 @@ export class KeywordsSearchComponent {
.replace(/>/g, '>');
// Create the replacement span HTML
- const replacement = `${escapedKeyword}`;
+ const replacement = `${escapedKeyword}`;
const escapedRegexKeyword = keyword.replace(
/[.*+?^${}()|[\]\\]/g,
@@ -212,9 +220,6 @@ export class KeywordsSearchComponent {
constructor() {
this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe(() => {
if (this.isOwnNavigation) {
- // This emission is just the router confirming the navigation we
- // triggered ourselves in updateQueryParams(); our signals are
- // already correct, so skip re-deriving state from the URL.
this.isOwnNavigation = false;
return;
}
@@ -237,15 +242,13 @@ export class KeywordsSearchComponent {
.getMessages()
.subscribe((event: WsEvent) => this.handleWsEvent(event));
- // Clear session storage on component destroy, unless this is a page
- // reload (in which case we want the cache to survive).
- this.destroyRef.onDestroy(() => {
- this.websocketService.close();
- const isReload = this.router.lastSuccessfulNavigation === null;
- if (!isReload) {
- this.clearSourceFromSession();
- }
- });
+ // this.destroyRef.onDestroy(() => {
+ // this.websocketService.close();
+ // const isReload = this.router.lastSuccessfulNavigation === null;
+ // if (!isReload) {
+ // this.clearStateFromSession();
+ // }
+ // });
}
// --- Websocket event handling ---------------------------------------
@@ -512,7 +515,7 @@ export class KeywordsSearchComponent {
this.extractionSource.set(null);
// updateQueryParams() persists this cleared state to sessionStorage too
- // (see saveSourceToSession() call inside it), so there's no need to
+ // (see saveStateToSession() call inside it), so there's no need to
// separately wipe the session key here.
this.updateQueryParams();
}
@@ -564,7 +567,7 @@ export class KeywordsSearchComponent {
this.selectedKeywords().filter((k) => allExtracted.includes(k)),
);
- // updateQueryParams() also calls saveSourceToSession() - no need to call
+ // updateQueryParams() also calls saveStateToSession() - no need to call
// it separately here.
this.updateQueryParams();
}
@@ -605,15 +608,34 @@ export class KeywordsSearchComponent {
search(): void {
this.showVisualization.set(false);
- const payload = {
+
+ const payload: SearchResultsPayload = {
extractedKeywords: this.getSelectedExtractedKeywordEntries(),
manualKeywords: this.getSelectedManualKeywordEntries(),
keywords: this.selectedKeywords(),
+ options: {
+ softSearch: this.topicMappingSearch(),
+ },
};
- console.log('searching for keywords:', payload);
- // e.g. navigate to search results page with the full payload in navigation state
- // this.router.navigate(['/search'], { state: payload });
+ // Best-effort cache for the heavier, topic-enriched entries.
+ // Not authoritative — search-results must work without it.
+ try {
+ sessionStorage.setItem(
+ this.SEARCH_RESULTS_HANDOFF_KEY,
+ JSON.stringify(payload),
+ );
+ } catch (error) {
+ console.error('Failed to cache search-results handoff:', error);
+ }
+
+ // Authoritative, reload-safe, shareable.
+ this.router.navigate(['keywords/search-results'], {
+ queryParams: {
+ keywords: this.serializeKeywords(payload.keywords),
+ softSearch: payload.options.softSearch ? true : false,
+ },
+ });
}
visualize(): void {
@@ -672,14 +694,16 @@ export class KeywordsSearchComponent {
this.normalizeKeyword(this.getKeywordLabel(item)) !== normalized,
);
}
-
onViewToggleChange(value: KeywordView): void {
if (this.keywordView() !== value) {
this.keywordView.set(value);
}
this.updateQueryParams();
}
-
+ onToggleTopicMappingSearch(event: any): void {
+ this.topicMappingSearch.set(event.checked);
+ this.updateQueryParams();
+ }
onSubfieldLegendVisibleChange(visible: boolean): void {
this.subfieldLegendVisible.set(visible);
this.updateQueryParams();
@@ -810,18 +834,23 @@ export class KeywordsSearchComponent {
const view = queryParams.get('view') ?? 'llm';
const legend = queryParams.get('legend') ?? 'on';
const legendExpanded = queryParams.get('legendExpanded') ?? 'off';
-
+ const softSearch = queryParams.get('softSearch') === 'true';
this.isRestoringState = true;
this.form.patchValue(
- { selectedInputType: mode, urlInput, textInput },
+ {
+ selectedInputType: mode,
+ urlInput,
+ textInput,
+ },
{ emitEvent: false },
);
this.keywordView.set(view as KeywordView);
this.subfieldLegendVisible.set(legend === 'on');
this.subfieldLegendExpanded.set(legendExpanded === 'on');
this.extractionSource.set(source as InputMode);
- this.restoreSourceFromSession();
+ this.topicMappingSearch.set(softSearch);
+ this.restoreStateFromSession();
const merged = this.uniqueKeywordEntries([
...this.manualKeywordEntries(), // session restored entries
@@ -859,7 +888,7 @@ export class KeywordsSearchComponent {
this.normalizeKeyword(k),
),
);
- const validSelected = selected.filter(
+ const validSelected = [...this.selectedKeywords(), ...selected].filter(
(k) =>
manualKeywordSet.has(this.normalizeKeyword(k)) ||
broadKeywordSet.has(this.normalizeKeyword(k)) ||
@@ -888,6 +917,7 @@ export class KeywordsSearchComponent {
view: this.keywordView(),
legend: this.subfieldLegendVisible() ? 'on' : 'off',
legendExpanded: this.subfieldLegendExpanded() ? 'on' : 'off',
+ softSearch: this.topicMappingSearch() ? true : false,
broad: this.serializeKeywords(
this.getKeywordLabels(this.broadKeywords()),
),
@@ -924,13 +954,13 @@ export class KeywordsSearchComponent {
// session cache was only saved after a full extraction completed, so
// adding a manual keyword (or removing one, etc.) never updated it. The
// *next* query-param change then triggered restoreStateFromQueryParams()
- // -> restoreSourceFromSession(), which overwrote the fresh manual
+ // -> restoreStateFromSession(), which overwrote the fresh manual
// keyword with that stale snapshot - making manually added keywords
// seem to vanish immediately. Saving here fixes that race.
- this.saveSourceToSession();
+ this.saveStateToSession();
}
- private saveSourceToSession(): void {
+ private saveStateToSession(): void {
const data = {
source: this.extractionSource(),
sourceContent: this.sourceContent(),
@@ -939,6 +969,7 @@ export class KeywordsSearchComponent {
coarseKeywordEntries: this.coarseKeywordEntries(),
fineKeywordEntries: this.fineKeywordEntries(),
manualKeywordEntries: this.manualKeywordEntries(),
+ selectedKeywords: this.selectedKeywords(),
};
try {
@@ -948,7 +979,7 @@ export class KeywordsSearchComponent {
}
}
- private restoreSourceFromSession(): void {
+ private restoreStateFromSession(): void {
const raw = sessionStorage.getItem(this.SESSION_KEY);
if (!raw) return;
@@ -961,6 +992,7 @@ export class KeywordsSearchComponent {
coarseKeywordEntries,
fineKeywordEntries,
manualKeywordEntries,
+ selectedKeywords,
} = JSON.parse(raw);
this.extractionSource.set(source as InputMode);
@@ -970,12 +1002,13 @@ export class KeywordsSearchComponent {
this.coarseKeywordEntries.set(coarseKeywordEntries ?? []);
this.fineKeywordEntries.set(fineKeywordEntries ?? []);
this.manualKeywordEntries.set(manualKeywordEntries ?? []);
+ this.selectedKeywords.set(selectedKeywords ?? []);
} catch {
sessionStorage.removeItem(this.SESSION_KEY);
}
}
- private clearSourceFromSession(): void {
+ private clearStateFromSession(): void {
sessionStorage.removeItem(this.SESSION_KEY);
}
diff --git a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.html b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.html
new file mode 100644
index 00000000..c33f8834
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.html
@@ -0,0 +1,31 @@
+
+
+
+ groups
+ Newsliste
+
+ Die aktuelle Gewichtung ist unter normalized verfügbar.
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss
new file mode 100644
index 00000000..ffeea20d
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss
@@ -0,0 +1,29 @@
+/* ============================================================
+ RESULT LAYOUT
+ ============================================================ */
+.result-layout {
+ display: grid;
+ grid-template-columns: minmax(300px, 420px) 1fr;
+ grid-template-areas: 'summary results';
+ gap: 0.75rem;
+ align-items: start;
+}
+
+.search-summary-card {
+ grid-area: summary;
+}
+
+.results-card {
+ grid-area: results;
+}
+
+.search-summary-card,
+.results-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ .mat-mdc-card-content {
+ padding: 0.75rem;
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts
new file mode 100644
index 00000000..e7096249
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts
@@ -0,0 +1,115 @@
+import { Component, inject, signal } from '@angular/core';
+
+import { MatCardModule } from '@angular/material/card';
+import { MatIconModule } from '@angular/material/icon';
+
+import {
+ WeightMap,
+ WeightSliderOption,
+ WeightsSlidersComponent,
+ WeightsSlidersValue,
+} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
+
+import { SearchResultsStateService } from '../search-results-state.service';
+
+@Component({
+ selector: 'app-news-results',
+ imports: [MatCardModule, MatIconModule, WeightsSlidersComponent],
+ templateUrl: './news-results.component.html',
+ styleUrl: './news-results.component.scss',
+})
+export class KeywordsToNewsResultsComponent {
+ // injects the state set by the parent route — no duplicate parsing here
+ private readonly state = inject(SearchResultsStateService);
+
+ readonly defaultWeights: WeightMap = {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ };
+
+ readonly weightOptions: WeightSliderOption[] = [
+ {
+ key: 'param1',
+ label: 'Parameter 1',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 1.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam1',
+ },
+ {
+ key: 'param2',
+ label: 'Parameter 2',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 2.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam2',
+ },
+ {
+ key: 'param3',
+ label: 'Parameter 3',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 3.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam3',
+ },
+ ];
+
+ readonly currentWeights = signal({
+ raw: this.defaultWeights,
+ normalized: {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ },
+ rawSum: 2.5,
+ normalizedSum: 1,
+ valid: true,
+ });
+
+ readonly projects = signal([]); // placeholder until the results service lands
+
+ private hasLoadedInitial = false;
+ constructor() {
+ console.log('check', this.state.payload());
+ }
+ onWeightsChange(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+
+ // fires once with the query-param-aware initial state — use it to load
+ if (!this.hasLoadedInitial) {
+ this.hasLoadedInitial = true;
+ this.loadprojects();
+ }
+ }
+
+ onApplyWeights(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+ this.loadprojects();
+ }
+
+ private loadprojects(): void {
+ const weights = this.currentWeights();
+
+ const requestPayload = {
+ manualKeywords: this.state.manualKeywords(),
+ extractedKeywords: this.state.extractedKeywords(),
+ keywords: this.state.keywords(),
+ softSearch: this.state.softSearch(),
+ weights: {
+ raw: weights.raw,
+ normalized: weights.normalized,
+ },
+ };
+
+ console.log(requestPayload);
+
+ /**
+ * TODO:
+ * this.projectsService.searchprojects(requestPayload).subscribe({
+ * next: results => this.projects.set(results),
+ * error: error => console.error(error),
+ * });
+ */
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html
new file mode 100644
index 00000000..0073d8fd
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html
@@ -0,0 +1,31 @@
+
+
+
+ groups
+ Patentenliste
+
+ Die aktuelle Gewichtung ist unter normalized verfügbar.
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.scss
new file mode 100644
index 00000000..ffeea20d
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.scss
@@ -0,0 +1,29 @@
+/* ============================================================
+ RESULT LAYOUT
+ ============================================================ */
+.result-layout {
+ display: grid;
+ grid-template-columns: minmax(300px, 420px) 1fr;
+ grid-template-areas: 'summary results';
+ gap: 0.75rem;
+ align-items: start;
+}
+
+.search-summary-card {
+ grid-area: summary;
+}
+
+.results-card {
+ grid-area: results;
+}
+
+.search-summary-card,
+.results-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ .mat-mdc-card-content {
+ padding: 0.75rem;
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.ts
new file mode 100644
index 00000000..659c9064
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.ts
@@ -0,0 +1,112 @@
+import { Component, inject, signal } from '@angular/core';
+
+import { MatCardModule } from '@angular/material/card';
+import { MatIconModule } from '@angular/material/icon';
+
+import {
+ WeightMap,
+ WeightSliderOption,
+ WeightsSlidersComponent,
+ WeightsSlidersValue,
+} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
+import { SearchResultsStateService } from '../search-results-state.service';
+
+@Component({
+ selector: 'app-patents-results',
+ imports: [MatCardModule, MatIconModule, WeightsSlidersComponent],
+ templateUrl: './patents-results.component.html',
+ styleUrl: './patents-results.component.scss',
+})
+export class KeywordsToPatentsResultsComponent {
+ // injects the state set by the parent route — no duplicate parsing here
+ private readonly state = inject(SearchResultsStateService);
+
+ readonly defaultWeights: WeightMap = {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ };
+
+ readonly weightOptions: WeightSliderOption[] = [
+ {
+ key: 'param1',
+ label: 'Parameter 1',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 1.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam1',
+ },
+ {
+ key: 'param2',
+ label: 'Parameter 2',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 2.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam2',
+ },
+ {
+ key: 'param3',
+ label: 'Parameter 3',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 3.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam3',
+ },
+ ];
+
+ readonly currentWeights = signal({
+ raw: this.defaultWeights,
+ normalized: {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ },
+ rawSum: 2.5,
+ normalizedSum: 1,
+ valid: true,
+ });
+
+ readonly projects = signal([]); // placeholder until the results service lands
+
+ private hasLoadedInitial = false;
+
+ onWeightsChange(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+
+ // fires once with the query-param-aware initial state — use it to load
+ if (!this.hasLoadedInitial) {
+ this.hasLoadedInitial = true;
+ this.loadprojects();
+ }
+ }
+
+ onApplyWeights(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+ this.loadprojects();
+ }
+
+ private loadprojects(): void {
+ const weights = this.currentWeights();
+
+ const requestPayload = {
+ manualKeywords: this.state.manualKeywords(),
+ extractedKeywords: this.state.extractedKeywords(),
+ keywords: this.state.keywords(),
+ softSearch: this.state.softSearch(),
+ weights: {
+ raw: weights.raw,
+ normalized: weights.normalized,
+ },
+ };
+
+ console.log(requestPayload);
+
+ /**
+ * TODO:
+ * this.projectsService.searchprojects(requestPayload).subscribe({
+ * next: results => this.projects.set(results),
+ * error: error => console.error(error),
+ * });
+ */
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html
new file mode 100644
index 00000000..a97b0264
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html
@@ -0,0 +1,31 @@
+
+
+
+ groups
+ Personenliste
+
+ Die aktuelle Gewichtung ist unter normalized verfügbar.
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss
new file mode 100644
index 00000000..ffeea20d
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss
@@ -0,0 +1,29 @@
+/* ============================================================
+ RESULT LAYOUT
+ ============================================================ */
+.result-layout {
+ display: grid;
+ grid-template-columns: minmax(300px, 420px) 1fr;
+ grid-template-areas: 'summary results';
+ gap: 0.75rem;
+ align-items: start;
+}
+
+.search-summary-card {
+ grid-area: summary;
+}
+
+.results-card {
+ grid-area: results;
+}
+
+.search-summary-card,
+.results-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ .mat-mdc-card-content {
+ padding: 0.75rem;
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts
new file mode 100644
index 00000000..533c28e7
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts
@@ -0,0 +1,135 @@
+import { Component, inject, signal } from '@angular/core';
+
+import { MatCardModule } from '@angular/material/card';
+import { MatIconModule } from '@angular/material/icon';
+
+import {
+ WeightMap,
+ WeightSliderOption,
+ WeightsSlidersComponent,
+ WeightsSlidersValue,
+} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
+
+import { SearchResultsStateService } from '../search-results-state.service';
+
+@Component({
+ selector: 'app-persons-results',
+ standalone: true,
+ imports: [MatCardModule, MatIconModule, WeightsSlidersComponent],
+ templateUrl: './persons-results.component.html',
+ styleUrl: './persons-results.component.scss',
+})
+export class KeywordsToPersonsResultsComponent {
+ // injects the state set by the parent route — no duplicate parsing here
+ private readonly state = inject(SearchResultsStateService);
+
+ readonly defaultWeights: WeightMap = {
+ publications: 0.5,
+ citations: 0.5,
+ patents: 0.5,
+ projects: 0.5,
+ mediaVisibility: 0.5,
+ };
+
+ readonly weightOptions: WeightSliderOption[] = [
+ {
+ key: 'publications',
+ label: 'Publikationen',
+ icon: 'article',
+ description:
+ 'Gewichtet die Anzahl und Relevanz wissenschaftlicher Arbeiten.',
+ defaultValue: 0.5,
+ queryParamName: 'wPublications',
+ },
+ {
+ key: 'citations',
+ label: 'Zitationen',
+ icon: 'format_quote',
+ description: 'Gewichtet wissenschaftlichen Einfluss über Zitationen.',
+ defaultValue: 0.5,
+ queryParamName: 'wCitations',
+ },
+ {
+ key: 'patents',
+ label: 'Patente',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Innovations- und Transferleistung.',
+ defaultValue: 0.5,
+ queryParamName: 'wPatents',
+ },
+ {
+ key: 'projects',
+ label: 'Projekte',
+ icon: 'account_tree',
+ description: 'Gewichtet Beteiligung an relevanten Forschungsprojekten.',
+ defaultValue: 0.5,
+ queryParamName: 'wProjects',
+ },
+ {
+ key: 'mediaVisibility',
+ label: 'Medien-Sichtbarkeit',
+ icon: 'visibility',
+ description: 'Gewichtet öffentliche und mediale Sichtbarkeit.',
+ defaultValue: 0.5,
+ queryParamName: 'wMedia',
+ },
+ ];
+
+ readonly currentWeights = signal({
+ raw: this.defaultWeights,
+ normalized: {
+ publications: 0.2,
+ citations: 0.2,
+ patents: 0.2,
+ projects: 0.2,
+ mediaVisibility: 0.2,
+ },
+ rawSum: 2.5,
+ normalizedSum: 1,
+ valid: true,
+ });
+
+ readonly persons = signal([]); // placeholder until the results service lands
+
+ private hasLoadedInitial = false;
+
+ onWeightsChange(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+
+ // fires once with the query-param-aware initial state — use it to load
+ if (!this.hasLoadedInitial) {
+ this.hasLoadedInitial = true;
+ this.loadPersons();
+ }
+ }
+
+ onApplyWeights(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+ this.loadPersons();
+ }
+
+ private loadPersons(): void {
+ const weights = this.currentWeights();
+
+ const requestPayload = {
+ manualKeywords: this.state.manualKeywords(),
+ extractedKeywords: this.state.extractedKeywords(),
+ keywords: this.state.keywords(),
+ softSearch: this.state.softSearch(),
+ weights: {
+ raw: weights.raw,
+ normalized: weights.normalized,
+ },
+ };
+
+ console.log(requestPayload);
+
+ /**
+ * TODO:
+ * this.personsService.searchPersons(requestPayload).subscribe({
+ * next: results => this.persons.set(results),
+ * error: error => console.error(error),
+ * });
+ */
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.html b/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.html
new file mode 100644
index 00000000..80f6a51b
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.html
@@ -0,0 +1,31 @@
+
+
+
+ groups
+ Projectsliste
+
+ Die aktuelle Gewichtung ist unter normalized verfügbar.
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.scss
new file mode 100644
index 00000000..ffeea20d
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.scss
@@ -0,0 +1,29 @@
+/* ============================================================
+ RESULT LAYOUT
+ ============================================================ */
+.result-layout {
+ display: grid;
+ grid-template-columns: minmax(300px, 420px) 1fr;
+ grid-template-areas: 'summary results';
+ gap: 0.75rem;
+ align-items: start;
+}
+
+.search-summary-card {
+ grid-area: summary;
+}
+
+.results-card {
+ grid-area: results;
+}
+
+.search-summary-card,
+.results-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ .mat-mdc-card-content {
+ padding: 0.75rem;
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.ts
new file mode 100644
index 00000000..d09d09db
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/projects-results/projects-results.component.ts
@@ -0,0 +1,111 @@
+import { Component, inject, signal } from '@angular/core';
+
+import { MatCardModule } from '@angular/material/card';
+import { MatIconModule } from '@angular/material/icon';
+
+import {
+ WeightMap,
+ WeightSliderOption,
+ WeightsSlidersComponent,
+ WeightsSlidersValue,
+} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
+import { SearchResultsStateService } from '../search-results-state.service';
+@Component({
+ selector: 'app-projects-results',
+ imports: [MatCardModule, MatIconModule, WeightsSlidersComponent],
+ templateUrl: './projects-results.component.html',
+ styleUrl: './projects-results.component.scss',
+})
+export class KeywordsToProjectsResultsComponent {
+ // injects the state set by the parent route — no duplicate parsing here
+ private readonly state = inject(SearchResultsStateService);
+
+ readonly defaultWeights: WeightMap = {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ };
+
+ readonly weightOptions: WeightSliderOption[] = [
+ {
+ key: 'param1',
+ label: 'Parameter 1',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 1.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam1',
+ },
+ {
+ key: 'param2',
+ label: 'Parameter 2',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 2.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam2',
+ },
+ {
+ key: 'param3',
+ label: 'Parameter 3',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 3.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam3',
+ },
+ ];
+
+ readonly currentWeights = signal({
+ raw: this.defaultWeights,
+ normalized: {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ },
+ rawSum: 2.5,
+ normalizedSum: 1,
+ valid: true,
+ });
+
+ readonly projects = signal([]); // placeholder until the results service lands
+
+ private hasLoadedInitial = false;
+
+ onWeightsChange(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+
+ // fires once with the query-param-aware initial state — use it to load
+ if (!this.hasLoadedInitial) {
+ this.hasLoadedInitial = true;
+ this.loadprojects();
+ }
+ }
+
+ onApplyWeights(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+ this.loadprojects();
+ }
+
+ private loadprojects(): void {
+ const weights = this.currentWeights();
+
+ const requestPayload = {
+ manualKeywords: this.state.manualKeywords(),
+ extractedKeywords: this.state.extractedKeywords(),
+ keywords: this.state.keywords(),
+ softSearch: this.state.softSearch(),
+ weights: {
+ raw: weights.raw,
+ normalized: weights.normalized,
+ },
+ };
+
+ console.log(requestPayload);
+
+ /**
+ * TODO:
+ * this.projectsService.searchprojects(requestPayload).subscribe({
+ * next: results => this.projects.set(results),
+ * error: error => console.error(error),
+ * });
+ */
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results-state.service.ts b/webapp/src/app/modules/keywords-search/search-results/search-results-state.service.ts
new file mode 100644
index 00000000..b5b91234
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/search-results-state.service.ts
@@ -0,0 +1,44 @@
+import { Injectable, computed, signal } from '@angular/core';
+import { KeywordEntryWithTopic } from '../../../api/model/keywordEntryWithTopic';
+
+export interface SearchResultsPayload {
+ extractedKeywords: KeywordEntryWithTopic[];
+ manualKeywords: KeywordEntryWithTopic[];
+ keywords: string[];
+ options: {
+ softSearch: boolean;
+ };
+}
+
+/**
+ * Provided at the parent route (KeywordsSearchResultsComponent) so it's
+ * created once when entering /search-results and destroyed when leaving it.
+ * Child routes (persons/projects/patents) inject it read-only to build
+ * their own search requests without re-deriving the keyword state.
+ */
+@Injectable()
+export class SearchResultsStateService {
+ private readonly _payload = signal(null);
+
+ readonly payload = this._payload.asReadonly();
+
+ readonly hasValidSearch = computed(() => {
+ const payload = this._payload();
+ return !!payload && payload.keywords.length > 0;
+ });
+
+ readonly keywords = computed(() => this._payload()?.keywords ?? []);
+ readonly softSearch = computed(
+ () => this._payload()?.options.softSearch ?? false,
+ );
+ readonly extractedKeywords = computed(
+ () => this._payload()?.extractedKeywords ?? [],
+ );
+ readonly manualKeywords = computed(
+ () => this._payload()?.manualKeywords ?? [],
+ );
+
+ setPayload(payload: SearchResultsPayload): void {
+ this._payload.set(payload);
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.html b/webapp/src/app/modules/keywords-search/search-results/search-results.component.html
new file mode 100644
index 00000000..d1ce9543
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.html
@@ -0,0 +1,81 @@
+
+
+ @if (state.hasValidSearch()) {
+
+
+
+
+
+ @for (entry of selectedKeywordEntries(); track getEntryTrack(entry)) {
+
+ }
+ @for (keyword of missingKeywordLabels(); track keyword) {
+
+ }
+
+
+
+
+
+
+
+
+
+ } @else {
+
+
+ manage_search
+ Keine Suchdaten
+ Starte eine neue Suche, um Ergebnisse zu sehen.
+
+ Zur Suche
+
+
+
+ }
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss
new file mode 100644
index 00000000..b1d2a7ee
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.scss
@@ -0,0 +1,209 @@
+/* ============================================================
+ DESIGN TOKENS
+ ============================================================ */
+$phone: 599px;
+$tablet: 900px;
+$touch-target: 44px;
+
+/* ============================================================
+ SEARCH RESULTS PAGE (parent shell)
+ ============================================================ */
+.search-results-page {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ padding: 0.75rem 1rem;
+}
+
+.page-header {
+ display: flex;
+ align-items: flex-start;
+ gap: 0.75rem;
+
+ h1 {
+ margin: 0;
+ font-size: clamp(1.2rem, 2vw, 1.6rem);
+ font-weight: 650;
+ color: var(--sg-text-primary);
+ }
+
+ p {
+ margin: 0.2rem 0 0;
+ color: var(--sg-text-secondary);
+ font-size: 0.9rem;
+ }
+}
+
+/* ============================================================
+ KEYWORD SUMMARY CARD
+ ============================================================ */
+.summary-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ .mat-mdc-card-content {
+ padding: 0.75rem;
+ }
+}
+
+.summary-header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 0.5rem;
+ margin-bottom: 0.5rem;
+}
+
+.summary-label {
+ display: block;
+ font-size: 0.75rem;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.03em;
+ color: var(--sg-text-secondary);
+}
+
+.summary-count {
+ display: block;
+ margin-top: 0.15rem;
+ font-size: 0.95rem;
+ font-weight: 650;
+ color: var(--sg-text-primary);
+}
+
+.mode-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ border-radius: 999px;
+ padding: 0.25rem 0.5rem;
+ background: var(--sg-background-muted, #f4f5f7);
+ color: var(--sg-text-secondary);
+ font-size: 0.75rem;
+ font-weight: 500;
+
+ mat-icon {
+ font-size: 16px;
+ width: 16px;
+ height: 16px;
+ }
+}
+
+.keyword-stack {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.6rem;
+
+ ::ng-deep app-topic-chip .topic-chip__count {
+ display: none;
+ }
+}
+
+/* ============================================================
+ CHILD ROUTE NAV
+ ============================================================ */
+.result-nav {
+ display: flex;
+ gap: 0.25rem;
+ border-bottom: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+}
+
+.result-nav__link {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.35rem;
+ padding: 0.5rem 0.85rem;
+ border-radius: 6px 6px 0 0;
+ color: var(--sg-text-secondary);
+ text-decoration: none;
+ font-size: 0.85rem;
+ font-weight: 500;
+ border-bottom: 2px solid transparent;
+ transition:
+ color 0.15s ease,
+ border-color 0.15s ease;
+
+ mat-icon {
+ font-size: 18px;
+ width: 18px;
+ height: 18px;
+ }
+
+ &:hover {
+ color: var(--sg-text-primary);
+ }
+
+ &--active {
+ color: var(--sg-text-primary);
+ border-bottom-color: var(--sg-primary, currentColor);
+ }
+}
+
+/* ============================================================
+ EMPTY STATE
+ ============================================================ */
+.empty-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+}
+
+.empty-state {
+ min-height: 240px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+ text-align: center;
+ color: var(--sg-text-secondary);
+
+ mat-icon {
+ font-size: 48px;
+ width: 48px;
+ height: 48px;
+ opacity: 0.65;
+ }
+
+ h2 {
+ margin: 0;
+ color: var(--sg-text-primary);
+ font-size: 1.1rem;
+ }
+
+ p {
+ margin: 0;
+ max-width: 480px;
+ line-height: 1.4;
+ }
+
+ button {
+ margin-top: 0.5rem;
+ min-height: $touch-target;
+ }
+}
+
+/* ============================================================
+ PHONE
+ ============================================================ */
+@media (max-width: $phone) {
+ .search-results-page {
+ padding: 0.5rem;
+ }
+
+ .summary-header {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 0.3rem;
+ }
+
+ .mode-badge {
+ width: 100%;
+ justify-content: center;
+ }
+
+ .result-nav {
+ overflow-x: auto;
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts
new file mode 100644
index 00000000..e425de4c
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts
@@ -0,0 +1,236 @@
+import { Component, computed, inject } from '@angular/core';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import {
+ ActivatedRoute,
+ Router,
+ RouterLink,
+ RouterLinkActive,
+ RouterOutlet,
+} from '@angular/router';
+
+import { MatButtonModule } from '@angular/material/button';
+import { MatCardModule } from '@angular/material/card';
+import { MatIconModule } from '@angular/material/icon';
+
+import { KeywordEntryWithTopic } from '../../../api/model/keywordEntryWithTopic';
+import { Topic } from '../../../api/model/topic';
+import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component';
+import {
+ topicHierarchyColor,
+ TopicHierarchyColorInput,
+} from '../../../resolvers/utils/topic-colors';
+import { MatTabsModule } from '@angular/material/tabs';
+import {
+ SearchResultsPayload,
+ SearchResultsStateService,
+} from './search-results-state.service';
+
+@Component({
+ selector: 'app-keywords-search-results',
+ standalone: true,
+ imports: [
+ RouterLink,
+ RouterLinkActive,
+ RouterOutlet,
+ MatButtonModule,
+ MatCardModule,
+ MatIconModule,
+ TopicChipComponent,
+ MatTabsModule,
+ ],
+ providers: [SearchResultsStateService],
+ templateUrl: './search-results.component.html',
+ styleUrl: './search-results.component.scss',
+})
+export class KeywordsSearchResultsComponent {
+ private readonly router = inject(Router);
+ private readonly route = inject(ActivatedRoute);
+
+ protected readonly state = inject(SearchResultsStateService);
+
+ // Must match KeywordsSearchComponent.SEARCH_RESULTS_HANDOFF_KEY exactly —
+ // that's where search() writes the enriched entries before navigating.
+ private readonly HANDOFF_KEY = 'search-results-handoff';
+
+ protected readonly childRoutes = [
+ { path: 'persons', label: 'Personen', icon: 'groups' },
+ { path: 'projects', label: 'Projekte', icon: 'work' },
+ { path: 'patents', label: 'Patente', icon: 'workspace_premium' },
+ { path: 'works', label: 'Publikationen', icon: 'article' },
+ { path: 'news', label: 'Nachrichten', icon: 'newspaper' },
+ ];
+
+ readonly selectedKeywordCount = computed(() => this.state.keywords().length);
+
+ readonly selectedKeywordEntries = computed(() => {
+ const payload = this.state.payload();
+ if (!payload) return [];
+
+ const allEntries = [
+ ...(payload.extractedKeywords ?? []),
+ ...(payload.manualKeywords ?? []),
+ ];
+
+ const entryByKeyword = new Map();
+
+ for (const entry of allEntries) {
+ entryByKeyword.set(
+ this.normalizeKeyword(this.getKeywordLabel(entry)),
+ entry,
+ );
+ }
+
+ const result: KeywordEntryWithTopic[] = [];
+ const seen = new Set();
+
+ for (const keyword of payload.keywords) {
+ const normalized = this.normalizeKeyword(keyword);
+ const entry = entryByKeyword.get(normalized);
+
+ if (!entry || seen.has(normalized)) continue;
+
+ seen.add(normalized);
+ result.push(entry);
+ }
+
+ return result;
+ });
+
+ readonly missingKeywordLabels = computed(() => {
+ const payload = this.state.payload();
+ if (!payload) return [];
+
+ const entryKeywordSet = new Set(
+ this.selectedKeywordEntries().map((entry) =>
+ this.normalizeKeyword(this.getKeywordLabel(entry)),
+ ),
+ );
+
+ return payload.keywords.filter(
+ (keyword) => !entryKeywordSet.has(this.normalizeKeyword(keyword)),
+ );
+ });
+
+ constructor() {
+ // Query params are authoritative (URL survives reload, deep links,
+ // browser back/forward). sessionStorage is a best-effort cache for the
+ // heavier, topic-enriched entries — only trusted if its keyword set
+ // still matches what's in the URL right now, so a stale cache from a
+ // previous search never gets silently applied to a new one.
+ this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((params) => {
+ const keywords = this.parseKeywordList(params.get('keywords'));
+ const softSearch = params.get('softSearch') === 'on';
+
+ const cached = this.readHandoffCache();
+ const cacheMatches =
+ cached && this.sameKeywordSet(cached.keywords, keywords);
+
+ this.state.setPayload({
+ keywords,
+ options: { softSearch },
+ extractedKeywords: cacheMatches ? cached!.extractedKeywords : [],
+ manualKeywords: cacheMatches ? cached!.manualKeywords : [],
+ });
+ });
+ }
+
+ goBackToSearch(): void {
+ void this.router.navigate(['/keywords']);
+ }
+
+ getChipLabel(keyword: KeywordEntryWithTopic): string {
+ return keyword.llm_keyword?.keyword ?? '';
+ }
+
+ getChipDescription(item: KeywordEntryWithTopic): string | null {
+ return this.getTopic(item)?.description ?? null;
+ }
+
+ getChipSubfieldName(item: KeywordEntryWithTopic): string | null {
+ return this.getTopic(item)?.subfield?.display_name ?? null;
+ }
+
+ getChipFieldName(item: KeywordEntryWithTopic): string | null {
+ return this.getTopic(item)?.field?.display_name ?? null;
+ }
+
+ getChipDomainName(item: KeywordEntryWithTopic): string | null {
+ return this.getTopic(item)?.domain?.display_name ?? null;
+ }
+
+ getChipCount(item: KeywordEntryWithTopic): number | null {
+ return this.getTopic(item)?.works_count ?? null;
+ }
+
+ getTopicColor(topic: Topic | undefined | null): string {
+ const topicInput: TopicHierarchyColorInput = {
+ id: topic?.id ?? null,
+ name: topic?.display_name ?? null,
+ field_id: topic?.field?.id ?? null,
+ field_name: topic?.field?.display_name ?? null,
+ domain_id: topic?.domain?.id ?? null,
+ domain_name: topic?.domain?.display_name ?? null,
+ };
+
+ return topicHierarchyColor(topicInput);
+ }
+
+ getEntryTrack(entry: KeywordEntryWithTopic): string {
+ return this.getKeywordLabel(entry);
+ }
+
+ private readHandoffCache(): SearchResultsPayload | null {
+ const raw = sessionStorage.getItem(this.HANDOFF_KEY);
+ if (!raw) return null;
+
+ try {
+ return this.parsePayload(JSON.parse(raw));
+ } catch {
+ sessionStorage.removeItem(this.HANDOFF_KEY);
+ return null;
+ }
+ }
+
+ private parsePayload(value: unknown): SearchResultsPayload | null {
+ if (!value || typeof value !== 'object') return null;
+
+ const maybePayload = value as Partial;
+
+ if (!Array.isArray(maybePayload.keywords)) return null;
+
+ return {
+ extractedKeywords: maybePayload.extractedKeywords ?? [],
+ manualKeywords: maybePayload.manualKeywords ?? [],
+ keywords: maybePayload.keywords ?? [],
+ options: {
+ softSearch: maybePayload.options?.softSearch ?? false,
+ },
+ };
+ }
+
+ private sameKeywordSet(a: string[], b: string[]): boolean {
+ if (a.length !== b.length) return false;
+ const setA = new Set(a.map((k) => this.normalizeKeyword(k)));
+ return b.every((k) => setA.has(this.normalizeKeyword(k)));
+ }
+
+ private parseKeywordList(raw: string | null): string[] {
+ if (!raw) return [];
+ return raw
+ .split(',')
+ .map((v) => v.trim())
+ .filter(Boolean);
+ }
+
+ private getKeywordLabel(item: KeywordEntryWithTopic): string {
+ return item.llm_keyword.keyword;
+ }
+
+ private getTopic(item: KeywordEntryWithTopic): Topic | null {
+ return item.topic_mapping?.topic ?? null;
+ }
+
+ private normalizeKeyword(value: string): string {
+ return value.trim().toLowerCase();
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html
new file mode 100644
index 00000000..0bae9c40
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html
@@ -0,0 +1,31 @@
+
+
+
+ groups
+ Publikationsliste
+
+ Die aktuelle Gewichtung ist unter normalized verfügbar.
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.scss
new file mode 100644
index 00000000..ffeea20d
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.scss
@@ -0,0 +1,29 @@
+/* ============================================================
+ RESULT LAYOUT
+ ============================================================ */
+.result-layout {
+ display: grid;
+ grid-template-columns: minmax(300px, 420px) 1fr;
+ grid-template-areas: 'summary results';
+ gap: 0.75rem;
+ align-items: start;
+}
+
+.search-summary-card {
+ grid-area: summary;
+}
+
+.results-card {
+ grid-area: results;
+}
+
+.search-summary-card,
+.results-card {
+ background: var(--sg-surface, #ffffff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ .mat-mdc-card-content {
+ padding: 0.75rem;
+ }
+}
diff --git a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts
new file mode 100644
index 00000000..be981674
--- /dev/null
+++ b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts
@@ -0,0 +1,111 @@
+import { Component, inject, signal } from '@angular/core';
+
+import { MatCardModule } from '@angular/material/card';
+import { MatIconModule } from '@angular/material/icon';
+
+import {
+ WeightMap,
+ WeightSliderOption,
+ WeightsSlidersComponent,
+ WeightsSlidersValue,
+} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
+import { SearchResultsStateService } from '../search-results-state.service';
+@Component({
+ selector: 'app-works-results',
+ imports: [MatCardModule, MatIconModule, WeightsSlidersComponent],
+ templateUrl: './works-results.component.html',
+ styleUrl: './works-results.component.scss',
+})
+export class KeywordsToWorksResultsComponent {
+ // injects the state set by the parent route — no duplicate parsing here
+ private readonly state = inject(SearchResultsStateService);
+
+ readonly defaultWeights: WeightMap = {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ };
+
+ readonly weightOptions: WeightSliderOption[] = [
+ {
+ key: 'param1',
+ label: 'Parameter 1',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 1.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam1',
+ },
+ {
+ key: 'param2',
+ label: 'Parameter 2',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 2.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam2',
+ },
+ {
+ key: 'param3',
+ label: 'Parameter 3',
+ icon: 'workspace_premium',
+ description: 'Gewichtet Parameter 3.',
+ defaultValue: 0.5,
+ queryParamName: 'wParam3',
+ },
+ ];
+
+ readonly currentWeights = signal({
+ raw: this.defaultWeights,
+ normalized: {
+ param1: 0.33,
+ param2: 0.33,
+ param3: 0.34,
+ },
+ rawSum: 2.5,
+ normalizedSum: 1,
+ valid: true,
+ });
+
+ readonly works = signal([]); // placeholder until the results service lands
+
+ private hasLoadedInitial = false;
+
+ onWeightsChange(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+
+ // fires once with the query-param-aware initial state — use it to load
+ if (!this.hasLoadedInitial) {
+ this.hasLoadedInitial = true;
+ this.loadworks();
+ }
+ }
+
+ onApplyWeights(value: WeightsSlidersValue): void {
+ this.currentWeights.set(value);
+ this.loadworks();
+ }
+
+ private loadworks(): void {
+ const weights = this.currentWeights();
+
+ const requestPayload = {
+ manualKeywords: this.state.manualKeywords(),
+ extractedKeywords: this.state.extractedKeywords(),
+ keywords: this.state.keywords(),
+ softSearch: this.state.softSearch(),
+ weights: {
+ raw: weights.raw,
+ normalized: weights.normalized,
+ },
+ };
+
+ console.log(requestPayload);
+
+ /**
+ * TODO:
+ * this.worksService.searchworks(requestPayload).subscribe({
+ * next: results => this.works.set(results),
+ * error: error => console.error(error),
+ * });
+ */
+ }
+}
diff --git a/webapp/src/app/modules/news-detail/news-detail.component.html b/webapp/src/app/modules/news-detail/news-detail.component.html
index 1857d060..4580694d 100644
--- a/webapp/src/app/modules/news-detail/news-detail.component.html
+++ b/webapp/src/app/modules/news-detail/news-detail.component.html
@@ -215,6 +215,13 @@
Vorgeschlagen durch das Schlüsselwort im Text:
+
+ search
+
;
-
+ private readonly router = inject(Router);
private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute);
private readonly httpClient = inject(HttpClient);
@@ -132,6 +132,12 @@ export class NewsDetailComponent implements OnInit {
}
}
+ analyseKeyword(keyword: string | null | undefined): void {
+ this.router.navigate(['/keywords'], {
+ queryParams: { manual: keyword ?? '', selected: keyword ?? '' },
+ });
+ }
+
ngOnInit(): void {
this.route.paramMap
.pipe(takeUntilDestroyed(this.destroyRef))
diff --git a/webapp/src/app/shared/pipes/status.pipe.ts b/webapp/src/app/shared/pipes/status.pipe.ts
index 5ba35960..e386fe3a 100644
--- a/webapp/src/app/shared/pipes/status.pipe.ts
+++ b/webapp/src/app/shared/pipes/status.pipe.ts
@@ -11,6 +11,8 @@ export class StatusPipe implements PipeTransform {
return 'Aktiv';
case 'INACTIVE':
return 'Inaktiv';
+ case 'DELETED':
+ return 'Gelöscht';
default:
return value;
}
diff --git a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html
new file mode 100644
index 00000000..519dac93
--- /dev/null
+++ b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+ @for (option of options; track option.key) {
+
+
+ @if (option.icon) {
+ {{ option.icon }}
+ }
+ {{ option.label }}
+
+
+
+
+
+
+
+ {{ formatRawWeightLabel(weightControl(option.key).value) }}
+
+
+ }
+
+
+
+ @if (!weightsState().valid) {
+
+ warning
+ Mindestens ein Gewicht > 0
+
+ }
+
+
+ @if (showApplyButton) {
+
+
+ tune
+ {{ applyLabel }}
+
+
+ }
+
+
diff --git a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss
new file mode 100644
index 00000000..592c7b7b
--- /dev/null
+++ b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss
@@ -0,0 +1,215 @@
+/* weights-sliders.component.scss */
+
+$phone: 599px;
+$tablet: 900px;
+$touch-target: 44px;
+
+/* ============================================================
+ CARD
+ ============================================================ */
+::ng-deep .weights-card {
+ background: var(--sg-surface, #fff);
+ border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12));
+ box-shadow: none;
+
+ mat-card-content.mat-mdc-card-content {
+ padding: 0.5rem 0.5rem 0.25rem; /* compact bottom */
+ border: none;
+ }
+}
+
+/* ============================================================
+ HEADER
+ ============================================================ */
+.weights-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.4rem;
+ margin-bottom: 0.3rem;
+
+ h2 {
+ margin: 0;
+ font-size: 0.85rem;
+ font-weight: 650;
+ color: var(--sg-text-primary);
+ }
+
+ button {
+ min-height: $touch-target;
+ padding: 0.2rem 0.4rem;
+ font-size: 0.75rem;
+ line-height: 1.2;
+ }
+}
+
+/* ============================================================
+ SLIDERS
+ ============================================================ */
+.weight-list {
+ display: flex;
+ flex-direction: column;
+ gap: 0.2rem;
+ margin-top: 0.1rem;
+}
+
+.weight-row {
+ display: grid;
+ grid-template-columns: 1fr 1fr 40px;
+ align-items: center;
+ gap: 0.2rem;
+ min-height: 34px;
+ font-size: 0.8rem;
+}
+
+.weight-label {
+ display: flex;
+ align-items: center;
+ gap: 0.2rem;
+ color: var(--sg-text-primary);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ .icon-small {
+ font-size: 14px;
+ width: 14px;
+ height: 14px;
+ color: var(--sg-text-secondary);
+ }
+
+ span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-weight: 500;
+ }
+}
+
+.weight-slider {
+ width: 100%;
+ height: 20px; /* reduced from 24px */
+ margin: 0;
+}
+
+.weight-value {
+ font-size: 0.75rem;
+ font-weight: 650;
+ color: var(--sg-text-secondary);
+ text-align: right;
+ font-variant-numeric: tabular-nums;
+}
+
+/* ============================================================
+ WARNING
+ ============================================================ */
+.weight-warning {
+ display: flex;
+ align-items: center;
+ gap: 0.2rem;
+ margin-top: 0.2rem;
+ padding: 0.2rem 0.3rem;
+ border-radius: 3px;
+ background: color-mix(in srgb, #ff9800 12%, #ffffff);
+ color: #8a5200;
+ font-size: 0.7rem;
+ font-weight: 500;
+
+ mat-icon {
+ font-size: 14px;
+ width: 14px;
+ height: 14px;
+ }
+}
+
+/* ============================================================
+ ACTIONS
+ ============================================================ */
+.weight-actions {
+ display: flex;
+ justify-content: flex-end;
+ margin-top: 0.3rem;
+
+ button {
+ min-height: $touch-target;
+ padding: 0.2rem 0.6rem;
+ font-size: 0.8rem;
+ }
+}
+
+/* ============================================================
+ TOOLTIP
+ ============================================================ */
+.tooltip-sm {
+ font-size: 0.75rem;
+ padding: 0.3rem 0.5rem;
+ max-width: 200px;
+ border-radius: 3px;
+ background: var(--sg-surface, #fff);
+ color: var(--sg-text-primary);
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
+}
+
+/* ============================================================
+ TABLET & PHONE
+ ============================================================ */
+@media (max-width: $tablet) {
+ .weight-row {
+ grid-template-columns: 1fr 40px;
+ gap: 0.15rem;
+ padding: 0.1rem 0;
+ }
+
+ .weight-label {
+ grid-column: 1 / -1;
+ font-size: 0.75rem;
+ }
+
+ .weight-slider {
+ grid-column: 1 / 2;
+ }
+
+ .weight-value {
+ grid-column: 2 / 3;
+ }
+
+ .weight-actions {
+ position: sticky;
+ bottom: 0;
+ z-index: 5;
+ background: var(--sg-background, #fff);
+ padding: 0.4rem;
+ margin: 0.3rem -0.5rem -0.25rem -0.5rem;
+ box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.06);
+ }
+}
+
+@media (max-width: $phone) {
+ .weights-header {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 0.2rem;
+ }
+
+ .weight-row {
+ gap: 0.1rem;
+ min-height: 30px;
+ }
+
+ .weight-label {
+ font-size: 0.7rem;
+ }
+
+ .weight-slider {
+ height: 18px;
+ }
+
+ .weight-value {
+ font-size: 0.7rem;
+ }
+
+ .weight-actions {
+ padding: 0.3rem;
+ margin: 0.2rem -0.4rem -0.2rem -0.4rem;
+ }
+}
diff --git a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts
new file mode 100644
index 00000000..436499ff
--- /dev/null
+++ b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.ts
@@ -0,0 +1,430 @@
+import {
+ Component,
+ DestroyRef,
+ EventEmitter,
+ Input,
+ OnChanges,
+ OnInit,
+ Output,
+ SimpleChanges,
+ inject,
+ signal,
+} from '@angular/core';
+import { FormControl, FormRecord, ReactiveFormsModule } from '@angular/forms';
+import { ActivatedRoute, Router } from '@angular/router';
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
+import { debounceTime, skip } from 'rxjs';
+
+import { MatButtonModule } from '@angular/material/button';
+import { MatCardModule } from '@angular/material/card';
+import { MatDividerModule } from '@angular/material/divider';
+import { MatIconModule } from '@angular/material/icon';
+import { MatSliderModule } from '@angular/material/slider';
+import { MatTooltipModule } from '@angular/material/tooltip';
+
+export interface WeightSliderOption {
+ key: string;
+ label: string;
+ icon?: string;
+ description?: string;
+
+ /**
+ * Optional default raw weight.
+ * Must be between 0 and 1.
+ */
+ defaultValue?: number;
+
+ /**
+ * Optional explicit query param name.
+ * If not set, queryParamPrefix + key is used.
+ */
+ queryParamName?: string;
+}
+
+export type WeightMap = Record;
+
+export interface WeightsSlidersValue {
+ raw: WeightMap;
+ normalized: WeightMap;
+ rawSum: number;
+ normalizedSum: number;
+ valid: boolean;
+}
+
+@Component({
+ selector: 'app-weights-sliders',
+ standalone: true,
+ imports: [
+ ReactiveFormsModule,
+ MatButtonModule,
+ MatCardModule,
+ MatDividerModule,
+ MatIconModule,
+ MatSliderModule,
+ MatTooltipModule,
+ ],
+ templateUrl: './weights-sliders.component.html',
+ styleUrl: './weights-sliders.component.scss',
+})
+export class WeightsSlidersComponent implements OnInit, OnChanges {
+ private readonly router = inject(Router);
+ private readonly route = inject(ActivatedRoute);
+ private readonly destroyRef = inject(DestroyRef);
+ @Input({ required: true }) options: WeightSliderOption[] = [];
+
+ @Input() title = 'Suchgewichtung';
+
+ @Input() description =
+ 'Werte zwischen 0 und 1. Die normalisierte Gewichtung wird durch Sum-Normalisierung berechnet und ergibt zusammen 1.';
+
+ @Input() resetLabel = 'Ausgewogen';
+
+ @Input() applyLabel = 'Ergebnisse neu gewichten';
+
+ @Input() normalizedTitle = 'Normalisierte Gewichtung';
+
+ @Input() showApplyButton = true;
+
+ @Input() showResetButton = true;
+
+ @Input() showNormalizedPreview = true;
+
+ @Input() showDescriptions = true;
+
+ @Input() persistInQueryParams = true;
+
+ /**
+ * If option.queryParamName is not set, the query param becomes:
+ * queryParamPrefix + option.key
+ *
+ * Example:
+ * queryParamPrefix = 'personW_'
+ * key = 'publications'
+ * query param = personW_publications
+ */
+ @Input() queryParamPrefix = 'w_';
+
+ /**
+ * Initial raw values from parent.
+ * Example:
+ * {
+ * publications: 0.5,
+ * citations: 0.2
+ * }
+ */
+ @Input() initialWeights: Partial | null = null;
+
+ /**
+ * If old values like 50 or 80 arrive, they can be converted to 0.5 / 0.8.
+ */
+ @Input() convertPercentValues = true;
+
+ @Input() min = 0;
+
+ @Input() max = 1;
+
+ @Input() step = 0.05;
+
+ @Input() decimals = 2;
+
+ @Input() normalizedDecimals = 3;
+
+ @Output() weightsChange = new EventEmitter();
+
+ @Output() applyWeights = new EventEmitter();
+
+ readonly form = new FormRecord>({});
+
+ readonly weightsState = signal({
+ raw: {},
+ normalized: {},
+ rawSum: 0,
+ normalizedSum: 0,
+ valid: false,
+ });
+
+ private initialized = false;
+ private isOwnNavigation = false;
+
+ constructor() {
+ this.form.valueChanges
+ .pipe(debounceTime(250), takeUntilDestroyed(this.destroyRef))
+ .subscribe(() => {
+ this.updateState({
+ emit: true,
+ persist: this.persistInQueryParams,
+ });
+ });
+ }
+
+ ngOnInit(): void {
+ this.rebuildForm();
+
+ if (this.persistInQueryParams) {
+ this.patchWeightsFromQueryParams();
+ }
+
+ this.updateState({
+ emit: true,
+ persist: false,
+ });
+
+ this.initialized = true;
+
+ if (this.persistInQueryParams) {
+ this.route.queryParamMap
+ .pipe(skip(1), takeUntilDestroyed(this.destroyRef))
+ .subscribe(() => {
+ if (this.isOwnNavigation) {
+ this.isOwnNavigation = false;
+ return;
+ }
+
+ this.patchWeightsFromQueryParams();
+
+ this.updateState({
+ emit: true,
+ persist: false,
+ });
+ });
+ }
+ }
+
+ ngOnChanges(changes: SimpleChanges): void {
+ if (
+ changes['options'] ||
+ changes['initialWeights'] ||
+ changes['min'] ||
+ changes['max']
+ ) {
+ this.rebuildForm();
+
+ if (this.initialized) {
+ if (this.persistInQueryParams) {
+ this.patchWeightsFromQueryParams();
+ }
+
+ this.updateState({
+ emit: true,
+ persist: false,
+ });
+ }
+ }
+ }
+
+ weightControl(key: string): FormControl {
+ const control = this.form.controls[key];
+
+ if (!control) {
+ throw new Error(`Weight control "${key}" does not exist.`);
+ }
+
+ return control;
+ }
+
+ formatRawWeightLabel = (value: number): string => {
+ return Number(value).toFixed(this.decimals);
+ };
+
+ formatNormalizedWeight(value: number): string {
+ return Number(value).toFixed(this.normalizedDecimals);
+ }
+
+ resetWeights(): void {
+ const nextValues: WeightMap = {};
+
+ for (const option of this.options) {
+ nextValues[option.key] = this.sanitizeWeightValue(
+ option.defaultValue ?? 0.5,
+ );
+ }
+
+ this.form.setValue(nextValues);
+ }
+
+ onApplyClick(): void {
+ const value = this.calculateValue();
+
+ this.updateState({
+ emit: true,
+ persist: this.persistInQueryParams,
+ });
+
+ this.applyWeights.emit(value);
+ }
+
+ normalizedEntries(): Array<{
+ key: string;
+ label: string;
+ value: number;
+ }> {
+ const normalized = this.weightsState().normalized;
+
+ return this.options.map((option) => ({
+ key: option.key,
+ label: option.label,
+ value: normalized[option.key] ?? 0,
+ }));
+ }
+
+ private rebuildForm(): void {
+ const wantedKeys = new Set(this.options.map((option) => option.key));
+
+ for (const existingKey of Object.keys(this.form.controls)) {
+ if (!wantedKeys.has(existingKey)) {
+ this.form.removeControl(existingKey);
+ }
+ }
+
+ for (const option of this.options) {
+ const initialValue = this.resolveInitialValue(option);
+
+ if (this.form.controls[option.key]) {
+ this.form.controls[option.key].setValue(initialValue, {
+ emitEvent: false,
+ });
+ } else {
+ this.form.addControl(
+ option.key,
+ new FormControl(initialValue, { nonNullable: true }),
+ { emitEvent: false },
+ );
+ }
+ }
+ }
+
+ private resolveInitialValue(option: WeightSliderOption): number {
+ const fromInput = this.initialWeights?.[option.key];
+
+ if (fromInput !== undefined && fromInput !== null) {
+ return this.sanitizeWeightValue(fromInput);
+ }
+
+ return this.sanitizeWeightValue(option.defaultValue ?? 0.5);
+ }
+
+ private patchWeightsFromQueryParams(): void {
+ const queryParams = this.route.snapshot.queryParamMap;
+ const patch: Record = {};
+
+ for (const option of this.options) {
+ const queryParamName = this.getQueryParamName(option);
+ const rawValue = queryParams.get(queryParamName);
+
+ if (rawValue === null) continue;
+
+ patch[option.key] = this.sanitizeWeightValue(rawValue);
+ }
+
+ if (Object.keys(patch).length > 0) {
+ this.form.patchValue(patch, { emitEvent: false });
+ }
+ }
+
+ private updateState(config: { emit: boolean; persist: boolean }): void {
+ const value = this.calculateValue();
+
+ this.weightsState.set(value);
+
+ if (config.persist) {
+ this.updateQueryParams(value.raw);
+ }
+
+ if (config.emit) {
+ this.weightsChange.emit(value);
+ }
+ }
+
+ private calculateValue(): WeightsSlidersValue {
+ const raw = this.getRawWeights();
+ const rawSum = this.sumWeights(raw);
+ const normalized = this.sumNormalize(raw, rawSum);
+ const normalizedSum = this.sumWeights(normalized);
+
+ return {
+ raw,
+ normalized,
+ rawSum,
+ normalizedSum,
+ valid: rawSum > 0,
+ };
+ }
+
+ private getRawWeights(): WeightMap {
+ const rawFormValue = this.form.getRawValue();
+ const result: WeightMap = {};
+
+ for (const option of this.options) {
+ result[option.key] = this.sanitizeWeightValue(rawFormValue[option.key]);
+ }
+
+ return result;
+ }
+
+ private sumNormalize(raw: WeightMap, rawSum: number): WeightMap {
+ const normalized: WeightMap = {};
+
+ for (const option of this.options) {
+ if (rawSum <= 0 || !Number.isFinite(rawSum)) {
+ normalized[option.key] = 0;
+ } else {
+ normalized[option.key] = raw[option.key] / rawSum;
+ }
+ }
+
+ return normalized;
+ }
+
+ private sumWeights(weights: WeightMap): number {
+ return Object.values(weights).reduce((sum, value) => sum + value, 0);
+ }
+
+ private updateQueryParams(rawWeights: WeightMap): void {
+ const queryParams: Record = {};
+
+ for (const option of this.options) {
+ const queryParamName = this.getQueryParamName(option);
+ const value = rawWeights[option.key] ?? 0;
+
+ queryParams[queryParamName] = Number(value.toFixed(this.decimals));
+ }
+
+ this.isOwnNavigation = true;
+
+ this.router
+ .navigate([], {
+ relativeTo: this.route,
+ queryParams,
+ queryParamsHandling: 'merge',
+ replaceUrl: true,
+ })
+ .then((navigated) => {
+ if (!navigated) {
+ this.isOwnNavigation = false;
+ }
+ });
+ }
+
+ private getQueryParamName(option: WeightSliderOption): string {
+ return option.queryParamName ?? `${this.queryParamPrefix}${option.key}`;
+ }
+
+ private sanitizeWeightValue(value: unknown): number {
+ const parsed = Number(value);
+
+ if (!Number.isFinite(parsed)) {
+ return 0;
+ }
+
+ let normalizedInput = parsed;
+
+ if (this.convertPercentValues && this.max === 1 && parsed > 1) {
+ normalizedInput = parsed / 100;
+ }
+
+ return Math.min(
+ this.max,
+ Math.max(this.min, Number(normalizedInput.toFixed(this.decimals))),
+ );
+ }
+}