Skip to content

Conversation

bmaltais
Copy link
Owner

No description provided.

This commit applies the same Gradio GUI improvements that were done in `kintext_manual_caption_gui.py` to `manual_caption_gui.py`.

The changes include:
- Better user feedback for status updates.
- Safer return values from functions to avoid clearing user input on errors.
- A more organized layout with better-labeled components.
- Clearer pagination controls.
This commit refactors the `manual_caption_gui.py` file to align with the new standards set by the `kontext_manual_caption_gui.py` file.

The changes include:
- Performance and Efficiency: Use of `os.path.basename`, `os.scandir`, and `gr.State` to improve performance.
- Code Quality and Readability: Case-insensitive tag matching, sorted tags, and improved variable names.
- UI and User Experience: Refined UI layout, consolidated pagination logic, and improved error handling.
This commit fixes a bug in the pagination logic that was causing the incorrect page count to be displayed. The `page.change` event handler has been updated to correctly update the `page_count` component when the page number or the total number of pages changes.
This commit fixes a bug in the pagination logic that was causing the incorrect page count to be displayed. The `page.change` event handler has been updated to correctly update the `page_count` component when the page number or the total number of pages changes.

This commit also resolves a `ValueError` that was occurring in the `render_pagination_with_logic` function. The `page.change` event handler has been updated to return a tuple of two `gr.Text` components, which resolves the error.
This commit fixes a bug where the pagination would not display the correct number of pages on the initial load. A `max_page.change` event handler has been added to both `manual_caption_gui.py` and `kontext_manual_caption_gui.py` to ensure the page count is updated correctly.
@bmaltais bmaltais merged commit d534cb9 into dev Jul 13, 2025
2 checks passed
@bmaltais bmaltais deleted the feat/apply-gui-improvements-to-manual-captioning branch July 13, 2025 17:13
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.

1 participant