Skip to content

Conversation

@functionzz
Copy link
Collaborator

@functionzz functionzz commented Oct 7, 2025

Creates 2 pages, one which conducts entity translation search, the other displays the entity with all translations.
Inspired by the functionality of Tranvision.

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2025

Codecov Report

❌ Patch coverage is 34.86239% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.46%. Comparing base (22aa0af) to head (9568466).

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@functionzz functionzz changed the title Add Entity and Search pages to Pontoon Add Entity and Search pages Oct 7, 2025
from pontoon.base.models.entity import Entity


BASE_URL = "http://localhost:8000/api/v2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there anywhere we have a macro that includes the BASE_URL, irrespective of production or local environment?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We have SITE_URL, but I'm not sure you mean that. Irrespective or respective?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the DRF endpoint is part of the same Django project, you don’t need to make an actual HTTP request — you can just invoke the view logic directly, which should be faster and doesn’t require the network stack.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I might need to make this happen - for some endpoints like /new-search/?search=fi&locale=en-CA, the fetching is quite slow(around 5 seconds), which could signify a problem with the implementation, but will also be sped up with this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds more like a DB rather than a network latency issue.

from pontoon.base.models.entity import Entity


BASE_URL = "http://localhost:8000/api/v2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have SITE_URL, but I'm not sure you mean that. Irrespective or respective?

from pontoon.base.models.entity import Entity


BASE_URL = "http://localhost:8000/api/v2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the DRF endpoint is part of the same Django project, you don’t need to make an actual HTTP request — you can just invoke the view logic directly, which should be faster and doesn’t require the network stack.

@functionzz
Copy link
Collaborator Author

We have SITE_URL, but I'm not sure you mean that. Irrespective or respective?
Exactly what I mean, thank you.

If the DRF endpoint is part of the same Django project, you don’t need to make an actual HTTP request — you can just invoke the view logic directly, which should be faster and doesn’t require the network stack.

You are 100% right

@functionzz functionzz requested a review from mathjazz October 22, 2025 18:50
@functionzz

This comment was marked as outdated.

@functionzz functionzz marked this pull request as ready for review October 22, 2025 19:10
@mathjazz
Copy link
Collaborator

Remaining TODOs:
* [ ] clipboard
* [ ] replace url with /search instead of /new-search

The URL change sounds like a low hanging fruit, so I suggest just doing it.

Re clipboard: note that we already have it implemented in Machinery.

@mathjazz
Copy link
Collaborator

Core functionality is currently implemented

As per the Slack "spec" we're missing the source string metadata on the entity page, as well as the Link to translate view.

from pontoon.base.models.entity import Entity


BASE_URL = "http://localhost:8000/api/v2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds more like a DB rather than a network latency issue.

@functionzz functionzz requested a review from mathjazz October 24, 2025 15:34
Copy link
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

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

Thanks for the update.

A general note: It's hard to follow the changes if not all comments are addressed. We either need to keep track of the exact list of things to do, or (preferable) address all review comments before requesting a new review.

We should:

  • Investigate why is the initial page load of the /search page rather slow
  • Require explicit true value for all boolean query parameters
  • Use semantic elements and class names in markup
  • Keep entity.key in /search and /entities unless it's just a reformated string (e.g. in PO files)
  • Add keyboard shortcut to trigger search with Enter
  • Add ability to copy search results to clipboard

@functionzz functionzz force-pushed the translations_to_all_locales_page branch 2 times, most recently from eea8361 to 297688f Compare November 10, 2025 17:06
@functionzz functionzz requested a review from mathjazz November 17, 2025 22:28
@functionzz functionzz requested a review from mathjazz November 25, 2025 14:33
@functionzz functionzz force-pushed the translations_to_all_locales_page branch from 4c90308 to 9568466 Compare December 15, 2025 16:56
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.

3 participants