Skip to content

Conversation

@jason-raitz
Copy link
Contributor

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.

@jason-raitz
Copy link
Contributor Author

@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.

@anarchivist
Copy link
Member

@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...

@awilfox
Copy link
Member

awilfox commented Dec 11, 2025

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.

@anarchivist
Copy link
Member

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 willa.tind.format_tind_context: https://github.com/BerkeleyLibrary/willa/blob/main/willa/tind/format_tind_context.py#L23-L40

jason-raitz and others added 3 commits December 11, 2025 10:41
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>
@jason-raitz jason-raitz force-pushed the AP-529-references-redesign branch from 55ff149 to 6cf1f68 Compare December 11, 2025 15:41
@jason-raitz jason-raitz marked this pull request as ready for review December 11, 2025 15:42
Copilot AI review requested due to automatic review settings December 11, 2025 15:42
Copy link
Contributor

Copilot AI left a 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';

jason-raitz and others added 3 commits December 11, 2025 10:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jason-raitz jason-raitz merged commit cd8f211 into main Dec 11, 2025
9 checks passed
@jason-raitz jason-raitz deleted the AP-529-references-redesign branch December 11, 2025 19:14
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.

4 participants