Skip to content

Filter and order metadata fields based on collection configuration#16

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/update-metadata-display-in-murag
Draft

Filter and order metadata fields based on collection configuration#16
Copilot wants to merge 4 commits intomainfrom
copilot/update-metadata-display-in-murag

Conversation

Copy link

Copilot AI commented Dec 5, 2025

MuRAG was displaying all record metadata fields regardless of collection-specific visibility settings, while FUNDus! only shows fields with configured labels in a specific order defined by the position field.

Changes

Backend: Data generation (generate_murag_data.py)

  • Extract position field from collection field configuration JSONs
  • Filter record details during creation to exclude fields without labels
  • Add position to FundusRecordField DTO

Backend: Field resolution (vector_db.py)

  • Restrict _resolve_detail_field_names to only return fields present in collection configuration
  • Remove fallback that included unconfigured fields

Frontend: Display ordering (FundusRecordCard.tsx)

  • Fetch collection metadata to access field configuration
  • Sort detail fields by position before rendering
  • Use URLSearchParams for proper encoding of collection names

Example

Before: All fields from the record's details dictionary were displayed

# All detail columns were included in records
details_columns = ["details_Class", "details_Order", "details_hidden_keywords", ...]

After: Only fields with labels in collection config are included and ordered by position

# Fields filtered based on collection.fields
visible_fields = {f["name"] for f in collection.fields}  # Only fields with labels
# Sorted by position: Family, Name, Country, Type, Sex, Preparation...
Original prompt

This section details on the original issue you should resolve

<issue_title>Visibility of Metadata in FUNDus! MuRAG</issue_title>
<issue_description>Die Anzeige von Objektdaten in MuRAG sollte sich nach der Anzeige in FUNDus! orientieren, da diese mit den Sammlungsleitern abgesprochen wurde.

Image

Derzeit werden mehr Metadaten in MuRAG als in FUNDus! angezeigt.

Die Anzeige der Objektdaten (details) wird für jede Sammlung in den json-Dateien im "fields"-Ordner (fundus-json in gitlab@rrz) definiert.

Image
  • Felder ohne Label werden nicht angezeigt
  • Felder mit gleichem Label werden zusammgefasst (position und concat_str entscheiden darüber, wie die Felder konkateniert werden
  • position definiert auch die Abfolge der Felder
Image

Möglicherweise liegt die Ursache in der Zusammenstellung der Details in resolve_detail_field_names</issue_description>

<agent_instructions>Fix the bug based on the instructions below step by step. First fix the bug in the backend and then add the changes to the frontend</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@pesc101 Ich habe den Fehler identifiziert:
  • Hier wird die Position der Felder nicht zu den Daten hinzugefügt, dadurch werden die Felder keiner Reihenfolge zugeordnet
  • Der Name und die Labels werden zwar pro Collections gespeichert, aber diese Information wird bei der Erstellung der Records (Hier) nicht weiter verwendet
  • Dadurch werden alle Felder zu den Records hinzugefügt, ohne dass sie nach der Collection gefiltert werden.

Lösungsansatz:

  • Füge die Position als Feld zu den Collection Fields hinzu
  • Filter alle Collection Fields raus, welche NA sind (das kann auch zu Problemen führen)
  • Verwende die Fields um in der Erstellung von den Rekords die jeweiligen Felder zu filtern
  • Verwende die Position im Frontend um die Reihenfolge aus den Daten herzustellen

@irisvogel </comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 5, 2025 11:12
Co-authored-by: pesc101 <53601317+pesc101@users.noreply.github.com>
…ertion

Co-authored-by: pesc101 <53601317+pesc101@users.noreply.github.com>
Co-authored-by: pesc101 <53601317+pesc101@users.noreply.github.com>
Copilot AI changed the title [WIP] Update display of metadata in MuRAG to match FUNDus! Filter and order metadata fields based on collection configuration Dec 5, 2025
Copilot AI requested a review from pesc101 December 5, 2025 11:20
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.

Visibility of Metadata in FUNDus! MuRAG

2 participants