Skip to content

Conversation

CyberROFL
Copy link
Member

@CyberROFL CyberROFL commented Sep 26, 2025

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@CyberROFL CyberROFL self-assigned this Sep 26, 2025
@CyberROFL CyberROFL marked this pull request as ready for review September 26, 2025 18:18
@CyberROFL CyberROFL requested a review from a team as a code owner September 26, 2025 18:18
@CyberROFL CyberROFL requested a review from pixcc September 26, 2025 18:18
@CyberROFL CyberROFL enabled auto-merge (squash) September 26, 2025 18:18
Copy link

github-actions bot commented Sep 26, 2025

2025-09-26 18:19:19 UTC Pre-commit check linux-x86_64-relwithdebinfo for 17442fa has started.
2025-09-26 18:19:47 UTC Artifacts will be uploaded here
2025-09-26 18:23:56 UTC ya make is running...
🟡 2025-09-26 19:41:21 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
30720 29201 0 1 1483 35

2025-09-26 19:41:29 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-09-26 19:56:59 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
519 (only retried tests) 378 0 0 116 25

🟢 2025-09-26 19:57:02 UTC Build successful.
🟢 2025-09-26 19:57:18 UTC ydbd size 2.2 GiB changed* by 0 Bytes, which is <= 0 Bytes vs main: OK

ydbd size dash main: 580503a merge: 17442fa diff diff %
ydbd size 2 397 008 592 Bytes 2 397 008 592 Bytes 0 Bytes 0.000%
ydbd stripped size 512 481 192 Bytes 512 481 192 Bytes 0 Bytes 0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Sep 26, 2025

🟢 2025-09-26 18:20:50 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Sep 26, 2025

2025-09-26 18:21:29 UTC Pre-commit check linux-x86_64-release-asan for 17442fa has started.
2025-09-26 18:21:44 UTC Artifacts will be uploaded here
2025-09-26 18:25:14 UTC ya make is running...
🟡 2025-09-26 20:20:44 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15174 14680 0 154 312 28

🟢 2025-09-26 20:20:49 UTC Build successful.
🟢 2025-09-26 20:21:12 UTC ydbd size 3.7 GiB changed* by -96 Bytes, which is <= 0 Bytes vs main: OK

ydbd size dash main: 580503a merge: 17442fa diff diff %
ydbd size 3 986 662 296 Bytes 3 986 662 200 Bytes -96 Bytes -0.000%
ydbd stripped size 1 485 964 128 Bytes 1 485 964 064 Bytes -64 Bytes -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@pixcc pixcc requested a review from Copilot September 26, 2025 18:50
Copy link
Contributor

@Copilot 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 refactors the CMS UI navigation code to use centralized functions for managing tab navigation and URL hash updates. The changes eliminate direct jQuery tab manipulation and URL hash setting in favor of reusable utility functions.

  • Extract tab navigation logic into reusable setTab, showTab, and setLocation functions
  • Update existing code to use the new centralized functions instead of direct jQuery calls
  • Improve the default tab selection logic to use the currently active tab instead of hardcoding 'configs'

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ydb/core/cms/ui/cms.js Adds centralized tab navigation functions and refactors main() to use them
ydb/core/cms/ui/configs.js Updates direct jQuery tab call to use the new setTab function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

$('.nav-tabs a').on('shown.bs.tab', function (e) {
Parameters.page = e.target.hash.substr(1);
window.location.hash = $.param(Parameters);
setLocation({page: e.target.hash.substr(1)});
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

The setLocation call only sets the page parameter, but the original code preserved all existing Parameters. This change will lose other URL parameters like show when switching tabs.

Suggested change
setLocation({page: e.target.hash.substr(1)});
// Preserve all existing parameters, only update 'page'
var currentParams = {};
if (window.location.hash.length > 1) {
window.location.hash.substr(1).split('&').forEach(function(o) {
var a = o.split('=');
if (a[0]) currentParams[a[0]] = decodeURIComponent(a[1]);
});
}
currentParams.page = e.target.hash.substr(1);
setLocation(currentParams);

Copilot uses AI. Check for mistakes.

Comment on lines +22 to +24
for (var i = 0; i < activeTabs.length; ++i) {
setTab({page: activeTabs[i].hash.substr(1)});
break;
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

[nitpick] The loop with immediate break is unnecessarily complex. Consider using activeTabs.first() or activeTabs[0] directly since you only need the first active tab.

Suggested change
for (var i = 0; i < activeTabs.length; ++i) {
setTab({page: activeTabs[i].hash.substr(1)});
break;
if (activeTabs.length > 0) {
setTab({page: activeTabs[0].hash.substr(1)});

Copilot uses AI. Check for mistakes.

@CyberROFL CyberROFL merged commit 592d4dc into ydb-platform:main Sep 26, 2025
16 checks passed
@CyberROFL CyberROFL deleted the fix-cms-ui branch September 29, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants