Commit e4e2aa6
committed
Refactor UI mode switching and add sidebar state management
Refactors the permission-based UI switching to use existing robust
methods (addClassicUI/addNotebookbarUI) and adds sidebar visibility
state management across mode switches.
UIManager:
- Refactored onUpdatePermission to use addClassicUI/addNotebookbarUI
- Added safety checks to prevent duplicate component creation
- Added sidebar visibility management (show in edit, hide in readonly)
SidebarBase:
- Added showSidebar() method to restore sidebar visibility client-side
- Complements existing closeSidebar() for clean state management
This ensures:
- Consistent UI initialization (fixes TopToolbar and style dropdowns)
- Sidebar state is preserved across mode switches
- Robust handling of duplicate calls and edge cases
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Change-Id: I61b71cc4c3a68cce77dc198631fb6600dbb6a0de1 parent 6bf6f94 commit e4e2aa6
File tree
2 files changed
+27
-43
lines changed- browser/src/control
2 files changed
+27
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 363 | + | |
| 364 | + | |
375 | 365 | | |
376 | 366 | | |
377 | 367 | | |
| |||
1475 | 1465 | | |
1476 | 1466 | | |
1477 | 1467 | | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
1481 | 1472 | | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
1487 | 1476 | | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1491 | 1481 | | |
| 1482 | + | |
| 1483 | + | |
1492 | 1484 | | |
1493 | 1485 | | |
1494 | 1486 | | |
1495 | | - | |
1496 | 1487 | | |
1497 | | - | |
1498 | 1488 | | |
1499 | 1489 | | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | 1490 | | |
1516 | 1491 | | |
1517 | 1492 | | |
| |||
0 commit comments