-
Notifications
You must be signed in to change notification settings - Fork 0
AP-529 tind references redesign #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@anarchivist, we have not needed a javascript test suite so far, but it would be required to test this custom element. I think that may be a bit too much overhead unless we plan to do a lot more frontend customizations. |
|
@jason-raitz sounds good. in an ideal world i'd love for us to bolt in our own cypress tests here, but that's probably going to be enough work on its own... |
|
Overall, this is a good concept. I'm wondering if it might be better to refactor the backend to create a JSON object that can be more easily parsed into the fields. It would simplify the logic instead of taking metadata, turning it into English, then having the code having to parse that English back into metadata. |
i think that would be as simple as modifying |
Co-authored-by: maría a. matienzo <73732+anarchivist@users.noreply.github.com>
Co-authored-by: maría a. matienzo <73732+anarchivist@users.noreply.github.com>
55ff149 to
6cf1f68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR redesigns how TIND references are displayed by moving the parsing and formatting logic from the backend to the frontend. Instead of formatting reference data in the Python backend and passing it as a formatted string, the raw reference data is now parsed and formatted in the React component, providing more flexibility in presentation.
Key Changes
- Removed the "References:" label from the TIND message content in the Python backend
- Added parsing logic in the React component to extract structured data from reference strings
- Implemented custom rendering with accordion UI showing reference count and formatted metadata
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| willa/web/app.py | Removed "References:" label from TIND message content, now passes empty string |
| public/elements/tind-refs.jsx | Added parseTindReference and buildTindMessage functions to parse and format TIND reference data client-side, updated accordion trigger to show reference count |
Comments suppressed due to low confidence (1)
public/elements/tind-refs.jsx:51
- Variable originalMessage is used like a local variable, but is missing a declaration.
originalMessage = props.tind_message || 'no references supplied';
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Instead of changing the tind message that is passed back and forth in the datalayer and in langfuse, the custom element will parse the reference string and output it the way we want.