Skip to content

fix(frontend): toggle results tabs visibility based on analysis data - #1703

Open
nitin-sharma-20 wants to merge 2 commits into
imDarshanGK:mainfrom
nitin-sharma-20:fix/toggle-results-tabs-visibility
Open

fix(frontend): toggle results tabs visibility based on analysis data#1703
nitin-sharma-20 wants to merge 2 commits into
imDarshanGK:mainfrom
nitin-sharma-20:fix/toggle-results-tabs-visibility

Conversation

@nitin-sharma-20

@nitin-sharma-20 nitin-sharma-20 commented Jul 28, 2026

Copy link
Copy Markdown

Description

Resolves visual ambiguity between Full Analysis and Explain modes where clicking "Explain" previously showed all 3 result tabs (Explain, Debug, Improve) with an identical appearance to Full Analysis.

Specifically:

  1. Modified renderResults(result, code) in frontend/index.html to extract whether explanation, debugging, and suggestions are present in the analysis result, dynamically hide tab buttons (tab-explain, tab-debug, tab-suggest) when their corresponding data is missing, and switch the active selected tab (targetTab) to the first available/active tab instead of always defaulting to 'explain'.
  2. Modified resetResults() in frontend/index.html to restore default display styles ('flex') for all three tabs so that they become visible again when the session is cleared.
  3. Added automated unit tests in backend/tests/test_frontend_results_tabs_visibility.py and documented the fix in docs/CHANGELOG.md.

Related Issue

Fixes #1700

Type of change

  • Bug fix
  • New feature / enhancement
  • Documentation update
  • Test addition
  • Refactor

Checklist

  • I have read CONTRIBUTING.md
  • My branch is up to date with main
  • I have run pytest -v and all tests pass
  • I have not introduced duplicate issues or features
  • My PR title follows the format: feat/fix/docs/test: short description
  • I have added tests for new features (Level 2 and 3 issues)
  • No hardcoded secrets or API keys in my code
  • This PR is linked to a GSSoC 2026 issue

Screenshots (if frontend change)

  • Before: Running an Explain-only analysis displayed all three result tabs (Explain, Debug, Improve), making the UI look identical to Full Analysis.
  • After: Running an Explain-only analysis displays only the Explain tab button (Debug and Improve tab buttons are hidden). Running Full Analysis displays all three tab buttons. Clicking Clear restores all tab buttons to their default visible state.

Test evidence

pytest -v
# paste output
tests\test_frontend_results_tabs_visibility.py::test_render_results_toggles_tab_buttons_visibility PASSED
tests\test_frontend_results_tabs_visibility.py::test_render_results_switches_to_first_available_tab PASSED
tests\test_frontend_results_tabs_visibility.py::test_reset_results_restores_tab_buttons_display PASSED

===================== 469 passed, 116 warnings in 32.76s ======================

@nitin-sharma-20

Copy link
Copy Markdown
Author

hi @imDarshanGK can you review this PR.

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.

No difference between Full and Explain

1 participant