Skip to content

Commit 5c92537

Browse files
committed
feat: consistent icons in control bar
1 parent 007efc8 commit 5c92537

6 files changed

Lines changed: 43 additions & 93 deletions

File tree

src/index.html

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -905,15 +905,8 @@
905905
<div class="main-view forced-hidden">
906906
<div id="notificationUIDefaultAnchor" href="#">
907907
</div>
908-
<!-- Vertical control bar docked to the left edge -->
909-
<div id="centralControlBar" class="no-focus">
910-
<div id="ccbTabGroup" class="ccb-group">
911-
</div>
912-
<div class="ccb-divider"></div>
913-
<div class="ccb-group">
914-
<a href="#" id="searchNav" class="ccb-btn"><i class="fa-regular fa-magnifying-glass"></i></a>
915-
</div>
916-
</div>
908+
<!-- Vertical control bar docked to the left edge — buttons rendered by SidebarTabs.js -->
909+
<div id="centralControlBar" class="no-focus"></div>
917910

918911
<div id="sidebar" class="sidebar panel quiet-scrollbars horz-resizable right-resizer collapsible" data-minsize="30" data-maxsize="80%" data-forceleft=".content">
919912
<div id="mainNavBar">

src/styles/CentralControlBar.less

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,28 @@
3030
display: flex;
3131
flex-direction: column;
3232
align-items: stretch;
33+
gap: 2px;
3334
padding: 4px 0;
3435
box-sizing: border-box;
3536
user-select: none;
3637
background-color: @main-toolbar-background-color;
3738
border-right: 1px solid rgba(0, 0, 0, 0.45);
3839

39-
.ccb-group {
40-
display: flex;
41-
flex-direction: column;
42-
align-items: stretch;
43-
gap: 2px;
44-
}
45-
46-
.ccb-divider {
47-
height: 1px;
48-
margin: 4px 6px;
49-
background-color: rgba(255, 255, 255, 0.06);
50-
}
51-
52-
.ccb-spacer {
53-
flex: 1 1 auto;
54-
}
55-
56-
/* Override legacy sprite styles that NavigationProvider applies */
57-
#searchNav {
58-
background: transparent !important;
59-
top: auto !important;
60-
padding: 0 !important;
61-
width: auto !important;
62-
height: 28px !important;
63-
content: normal !important;
64-
}
65-
6640
.ccb-btn {
6741
display: flex;
6842
align-items: center;
6943
justify-content: center;
7044
height: 28px;
7145
margin: 0 3px;
7246
color: @project-panel-text-2;
73-
font-size: 15px;
7447
border-radius: 4px;
7548
cursor: pointer;
7649
text-decoration: none;
7750
transition: color 0.15s ease, background-color 0.15s ease;
7851

79-
i {
52+
svg {
53+
width: 16px;
54+
height: 16px;
8055
pointer-events: none;
8156
}
8257

@@ -116,39 +91,8 @@
11691
}
11792

11893
/* Cap the sidebar in design mode so the live-preview panel always keeps at
119-
least ~200px of its own. The 230px accounts for the 30px control bar
94+
least ~200px of its own. The 234px accounts for the 34px control bar
12095
plus a 200px LP minimum. */
12196
.ccb-editor-collapsed #sidebar {
122-
max-width: ~"calc(100vw - 230px)";
123-
}
124-
125-
/* Global tab icons — used in control bar tabs and sidebar chip bar */
126-
.files-icon {
127-
display: inline-block;
128-
width: 16px;
129-
height: 16px;
130-
background-color: currentColor;
131-
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20640%20640%27%3E%3Cpath%20d%3D%27M304%20112L192%20112C183.2%20112%20176%20119.2%20176%20128L176%20512C176%20520.8%20183.2%20528%20192%20528L448%20528C456.8%20528%20464%20520.8%20464%20512L464%20272L376%20272C336.2%20272%20304%20239.8%20304%20200L304%20112zM444.1%20224L352%20131.9L352%20200C352%20213.3%20362.7%20224%20376%20224L444.1%20224zM128%20128C128%2092.7%20156.7%2064%20192%2064L325.5%2064C342.5%2064%20358.8%2070.7%20370.8%2082.7L493.3%20205.3C505.3%20217.3%20512%20233.6%20512%20250.6L512%20512C512%20547.3%20483.3%20576%20448%20576L192%20576C156.7%20576%20128%20547.3%20128%20512L128%20128z%27%2F%3E%3C%2Fsvg%3E");
132-
mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20640%20640%27%3E%3Cpath%20d%3D%27M304%20112L192%20112C183.2%20112%20176%20119.2%20176%20128L176%20512C176%20520.8%20183.2%20528%20192%20528L448%20528C456.8%20528%20464%20520.8%20464%20512L464%20272L376%20272C336.2%20272%20304%20239.8%20304%20200L304%20112zM444.1%20224L352%20131.9L352%20200C352%20213.3%20362.7%20224%20376%20224L444.1%20224zM128%20128C128%2092.7%20156.7%2064%20192%2064L325.5%2064C342.5%2064%20358.8%2070.7%20370.8%2082.7L493.3%20205.3C505.3%20217.3%20512%20233.6%20512%20250.6L512%20512C512%20547.3%20483.3%20576%20448%20576L192%20576C156.7%20576%20128%20547.3%20128%20512L128%20128z%27%2F%3E%3C%2Fsvg%3E");
133-
-webkit-mask-size: contain;
134-
mask-size: contain;
135-
-webkit-mask-repeat: no-repeat;
136-
mask-repeat: no-repeat;
137-
-webkit-mask-position: center;
138-
mask-position: center;
139-
}
140-
141-
.claude-ai-icon {
142-
display: inline-block;
143-
width: 16px;
144-
height: 16px;
145-
background-color: currentColor;
146-
-webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20640%20640%27%3E%3Cpath%20d%3D%27M164.4%20404.5L265.1%20348L266.8%20343.1L265.1%20340.4L260.2%20340.4L243.4%20339.4L185.9%20337.8L136%20335.7L87.7%20333.1L75.5%20330.5L64.1%20315.5L65.3%20308L75.5%20301.1L90.2%20302.4C109.1%20303.7%20136.1%20305.5%20171.2%20308L206.4%20310.1L258.6%20315.5L266.9%20315.5L268.1%20312.1L265.3%20310L263.1%20307.9L212.8%20273.8L158.4%20237.8L129.9%20217.1L114.5%20206.6L106.7%20196.8L103.3%20175.3L117.3%20159.9L136.1%20161.2L140.9%20162.5L159.9%20177.2L200.6%20208.7L253.7%20247.8L261.5%20254.3L264.6%20252.1L265%20250.5L261.5%20244.7L232.6%20192.5L201.8%20139.4L188.1%20117.4L184.5%20104.2C183.2%2098.8%20182.3%2094.2%20182.3%2088.7L198.2%2067.1L207%2064.3L228.2%2067.1L237.1%2074.9L250.3%20105.1L271.7%20152.6L304.9%20217.2L314.6%20236.4L319.8%20254.2L321.7%20259.6L325.1%20259.6L325.1%20256.5L327.8%20220.1L332.8%20175.4L337.7%20117.9L339.4%20101.7L347.4%2082.3L363.3%2071.8L375.7%2077.7L385.9%2092.4L384.5%20101.9L378.4%20141.4L366.5%20203.3L358.7%20244.8L363.2%20244.8L368.4%20239.6L389.4%20211.8L424.6%20167.7L440.1%20150.2L458.2%20130.9L469.8%20121.7L491.8%20121.7L508%20145.8L500.7%20170.7L478%20199.4L459.2%20223.8L432.2%20260.1L415.4%20289.1L417%20291.4L421%20291L481.9%20278L514.8%20272.1L554.1%20265.4L571.9%20273.7L573.8%20282.1L566.8%20299.3L524.8%20309.7L475.6%20319.5L402.3%20336.8L401.4%20337.5L402.4%20338.8L435.4%20341.9L449.5%20342.7L484.1%20342.7L548.5%20347.5L565.3%20358.6L575.4%20372.2L573.7%20382.6L547.8%20395.8C532.3%20392.1%20493.4%20382.9%20431.2%20368.1L403.2%20361.1L399.3%20361.1L399.3%20363.4L422.6%20386.2L465.3%20424.8L518.8%20474.6L521.5%20486.9L514.6%20496.6L507.3%20495.6L460.3%20460.2L442.2%20444.3L401.1%20409.7L398.4%20409.7L398.4%20413.3L407.9%20427.2L457.9%20502.4L460.5%20525.4L456.9%20532.9L443.9%20537.4L429.7%20534.8L400.4%20493.7L370.2%20447.4L345.8%20405.9L342.8%20407.6L328.4%20562.4L321.7%20570.3L306.2%20576.2L293.2%20566.4L286.3%20550.5L293.2%20519L301.5%20477.9L308.2%20445.2L314.3%20404.6L317.9%20391.1L317.7%20390.2L314.7%20390.6L284.1%20432.6L237.6%20495.5L200.8%20534.9L192%20538.4L176.7%20530.5L178.1%20516.4L186.6%20503.8L237.5%20439L268.2%20398.8L288%20375.6L287.9%20372.2L286.7%20372.2L151.4%20460L127.3%20463.1L116.9%20453.4L118.2%20437.5L123.1%20432.3L163.8%20404.3L163.7%20404.4L163.7%20404.5z%27%2F%3E%3C%2Fsvg%3E");
147-
mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20640%20640%27%3E%3Cpath%20d%3D%27M164.4%20404.5L265.1%20348L266.8%20343.1L265.1%20340.4L260.2%20340.4L243.4%20339.4L185.9%20337.8L136%20335.7L87.7%20333.1L75.5%20330.5L64.1%20315.5L65.3%20308L75.5%20301.1L90.2%20302.4C109.1%20303.7%20136.1%20305.5%20171.2%20308L206.4%20310.1L258.6%20315.5L266.9%20315.5L268.1%20312.1L265.3%20310L263.1%20307.9L212.8%20273.8L158.4%20237.8L129.9%20217.1L114.5%20206.6L106.7%20196.8L103.3%20175.3L117.3%20159.9L136.1%20161.2L140.9%20162.5L159.9%20177.2L200.6%20208.7L253.7%20247.8L261.5%20254.3L264.6%20252.1L265%20250.5L261.5%20244.7L232.6%20192.5L201.8%20139.4L188.1%20117.4L184.5%20104.2C183.2%2098.8%20182.3%2094.2%20182.3%2088.7L198.2%2067.1L207%2064.3L228.2%2067.1L237.1%2074.9L250.3%20105.1L271.7%20152.6L304.9%20217.2L314.6%20236.4L319.8%20254.2L321.7%20259.6L325.1%20259.6L325.1%20256.5L327.8%20220.1L332.8%20175.4L337.7%20117.9L339.4%20101.7L347.4%2082.3L363.3%2071.8L375.7%2077.7L385.9%2092.4L384.5%20101.9L378.4%20141.4L366.5%20203.3L358.7%20244.8L363.2%20244.8L368.4%20239.6L389.4%20211.8L424.6%20167.7L440.1%20150.2L458.2%20130.9L469.8%20121.7L491.8%20121.7L508%20145.8L500.7%20170.7L478%20199.4L459.2%20223.8L432.2%20260.1L415.4%20289.1L417%20291.4L421%20291L481.9%20278L514.8%20272.1L554.1%20265.4L571.9%20273.7L573.8%20282.1L566.8%20299.3L524.8%20309.7L475.6%20319.5L402.3%20336.8L401.4%20337.5L402.4%20338.8L435.4%20341.9L449.5%20342.7L484.1%20342.7L548.5%20347.5L565.3%20358.6L575.4%20372.2L573.7%20382.6L547.8%20395.8C532.3%20392.1%20493.4%20382.9%20431.2%20368.1L403.2%20361.1L399.3%20361.1L399.3%20363.4L422.6%20386.2L465.3%20424.8L518.8%20474.6L521.5%20486.9L514.6%20496.6L507.3%20495.6L460.3%20460.2L442.2%20444.3L401.1%20409.7L398.4%20409.7L398.4%20413.3L407.9%20427.2L457.9%20502.4L460.5%20525.4L456.9%20532.9L443.9%20537.4L429.7%20534.8L400.4%20493.7L370.2%20447.4L345.8%20405.9L342.8%20407.6L328.4%20562.4L321.7%20570.3L306.2%20576.2L293.2%20566.4L286.3%20550.5L293.2%20519L301.5%20477.9L308.2%20445.2L314.3%20404.6L317.9%20391.1L317.7%20390.2L314.7%20390.6L284.1%20432.6L237.6%20495.5L200.8%20534.9L192%20538.4L176.7%20530.5L178.1%20516.4L186.6%20503.8L237.5%20439L268.2%20398.8L288%20375.6L287.9%20372.2L286.7%20372.2L151.4%20460L127.3%20463.1L116.9%20453.4L118.2%20437.5L123.1%20432.3L163.8%20404.3L163.7%20404.4L163.7%20404.5z%27%2F%3E%3C%2Fsvg%3E");
148-
-webkit-mask-size: contain;
149-
mask-size: contain;
150-
-webkit-mask-repeat: no-repeat;
151-
mask-repeat: no-repeat;
152-
-webkit-mask-position: center;
153-
mask-position: center;
97+
max-width: ~"calc(100vw - 234px)";
15498
}

src/styles/Extn-SidebarTabs.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
border-radius: 5px;
5151
transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
5252

53-
i {
54-
font-size: 0.78rem;
53+
svg {
54+
width: 12px;
55+
height: 12px;
5556
opacity: 0.85;
5657
}
5758

@@ -67,7 +68,7 @@
6768
0 1px 0 rgba(255, 255, 255, 0.05) inset,
6869
0 1px 2px rgba(0, 0, 0, 0.2);
6970

70-
i {
71+
svg {
7172
opacity: 1;
7273
}
7374
}

src/styles/brackets_variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
@inline-triangle-size: 9px;
4747

4848
/* Main layout */
49-
@central-control-bar-width: 30px;
49+
@central-control-bar-width: 34px;
5050
@sidebar-width: 270px; // user resizable, however
5151
@main-toolbar-width: 30px;
5252

src/view/CentralControlBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ define(function (require, exports, module) {
2626
const Strings = require("strings");
2727
const WorkspaceManager = require("view/WorkspaceManager");
2828

29-
const BAR_WIDTH = 30;
29+
const BAR_WIDTH = 34;
3030

3131
let $bar;
3232
let $sidebar;

src/view/SidebarTabs.js

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/**
2424
* SidebarTabs manages multiple tab panes within the sidebar. Tab buttons are
25-
* rendered into the `#ccbTabGroup` element inside the left control bar. The
25+
* rendered into the `#centralControlBar` element (the left control bar). The
2626
* module provides an API for registering tabs, associating DOM content with
2727
* tabs, and switching between them.
2828
*
@@ -40,7 +40,8 @@ define(function (require, exports, module) {
4040

4141
const AppInit = require("utils/AppInit"),
4242
EventDispatcher = require("utils/EventDispatcher"),
43-
PreferencesManager = require("preferences/PreferencesManager");
43+
PreferencesManager = require("preferences/PreferencesManager"),
44+
Strings = require("strings");
4445

4546
// --- Constants -----------------------------------------------------------
4647

@@ -50,6 +51,13 @@ define(function (require, exports, module) {
5051
*/
5152
const SIDEBAR_TAB_FILES = "sidebar-tab-files";
5253

54+
// Inline SVG icons for the control bar — all use fill="currentColor" so
55+
// they inherit the button's text color. viewBoxes are cropped tightly
56+
// around the path content for consistent visual sizing.
57+
const ICON_FILES = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="128 64 384 512"><path fill="currentColor" d="M304 112L192 112C183.2 112 176 119.2 176 128L176 512C176 520.8 183.2 528 192 528L448 528C456.8 528 464 520.8 464 512L464 272L376 272C336.2 272 304 239.8 304 200L304 112zM444.1 224L352 131.9L352 200C352 213.3 362.7 224 376 224L444.1 224zM128 128C128 92.7 156.7 64 192 64L325.5 64C342.5 64 358.8 70.7 370.8 82.7L493.3 205.3C505.3 217.3 512 233.6 512 250.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128z"/></svg>';
58+
59+
const ICON_SEARCH = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>';
60+
5361
/**
5462
* Preferred sidebar width (px) when a non-files tab (e.g. AI) is
5563
* first activated. Applied once if the current width is narrower.
@@ -84,7 +92,7 @@ define(function (require, exports, module) {
8492

8593
/** @type {jQuery}
8694
* @private */
87-
let $ccbTabGroup;
95+
let $controlBar;
8896

8997
/** @type {jQuery}
9098
* @private */
@@ -161,11 +169,13 @@ define(function (require, exports, module) {
161169
* @private
162170
*/
163171
function _rebuildTabBar() {
164-
if (!$ccbTabGroup) {
172+
if (!$controlBar) {
165173
return;
166174
}
167-
$ccbTabGroup.empty();
175+
$controlBar.empty();
168176
_tabs.sort(function (a, b) { return a.priority - b.priority; });
177+
178+
// Render tab buttons
169179
_tabs.forEach(function (tab) {
170180
const iconMarkup = tab.iconHTML || '<i class="' + tab.iconClass + '"></i>';
171181
const $item = $('<a href="#" class="ccb-btn ccb-tab-btn" data-tab-id="' + tab.id + '" title="' + tab.label + '">' +
@@ -175,9 +185,13 @@ define(function (require, exports, module) {
175185
$item.addClass("active");
176186
}
177187
tab.$tabItem = $item;
178-
$ccbTabGroup.append($item);
188+
$controlBar.append($item);
179189
});
180190

191+
// Render the search button
192+
$controlBar.append('<a href="#" id="searchNav" class="ccb-btn" title="' +
193+
Strings.CMD_FIND_IN_FILES + '">' + ICON_SEARCH + '</a>');
194+
181195
// Also rebuild the sidebar chip bar
182196
if ($navTabBar) {
183197
$navTabBar.empty();
@@ -452,10 +466,10 @@ define(function (require, exports, module) {
452466
_activeTabId = id;
453467

454468
// Update active class on tab items in the control bar
455-
if ($ccbTabGroup) {
456-
$ccbTabGroup.find(".ccb-tab-btn").removeClass("active");
469+
if ($controlBar) {
470+
$controlBar.find(".ccb-tab-btn").removeClass("active");
457471
if ($sidebar && $sidebar.is(":visible")) {
458-
$ccbTabGroup.find('.ccb-tab-btn[data-tab-id="' + id + '"]').addClass("active");
472+
$controlBar.find('.ccb-tab-btn[data-tab-id="' + id + '"]').addClass("active");
459473
}
460474
}
461475

@@ -515,10 +529,10 @@ define(function (require, exports, module) {
515529
// --- Initialization ------------------------------------------------------
516530

517531
function _updateTabActiveStates() {
518-
if ($ccbTabGroup) {
519-
$ccbTabGroup.find(".ccb-tab-btn").removeClass("active");
532+
if ($controlBar) {
533+
$controlBar.find(".ccb-tab-btn").removeClass("active");
520534
if ($sidebar && $sidebar.is(":visible")) {
521-
$ccbTabGroup.find('.ccb-tab-btn[data-tab-id="' + _activeTabId + '"]').addClass("active");
535+
$controlBar.find('.ccb-tab-btn[data-tab-id="' + _activeTabId + '"]').addClass("active");
522536
}
523537
}
524538
if ($navTabBar) {
@@ -529,31 +543,29 @@ define(function (require, exports, module) {
529543

530544
AppInit.htmlReady(function () {
531545
$sidebar = $("#sidebar");
532-
$ccbTabGroup = $("#ccbTabGroup");
546+
$controlBar = $("#centralControlBar");
533547

534548
// Create the sidebar chip tab bar and insert after #mainNavBar
535549
$navTabBar = $('<div id="navTabBar"></div>');
536550
$sidebar.find("#mainNavBar").after($navTabBar);
537551

538552
// Register the built-in Files tab
539-
addTab(SIDEBAR_TAB_FILES, "Files", "", { priority: 0, iconHTML: '<span class="files-icon"></span>' });
553+
addTab(SIDEBAR_TAB_FILES, "Files", "", { priority: 0, iconHTML: ICON_FILES });
540554

541555
// VSCode-style toggle: clicking the active tab hides sidebar,
542556
// clicking an inactive tab shows sidebar and switches to that tab.
543-
$ccbTabGroup.on("click", ".ccb-tab-btn", function (e) {
557+
$controlBar.on("click", ".ccb-tab-btn", function (e) {
544558
e.preventDefault();
545559
const tabId = $(this).attr("data-tab-id");
546560
if (!tabId) {
547561
return;
548562
}
549563
const sidebarVisible = $sidebar.is(":visible");
550564
if (sidebarVisible && tabId === _activeTabId) {
551-
// Toggle sidebar off
552565
const CommandManager = require("command/CommandManager");
553566
const Commands = require("command/Commands");
554567
CommandManager.execute(Commands.VIEW_HIDE_SIDEBAR);
555568
} else if (!sidebarVisible) {
556-
// Show sidebar and switch to the clicked tab
557569
const CommandManager = require("command/CommandManager");
558570
const Commands = require("command/Commands");
559571
CommandManager.execute(Commands.VIEW_HIDE_SIDEBAR);

0 commit comments

Comments
 (0)