Merge pull request #35685 from iamejaaz/remove-icons-keep-minimal

fix: remove awesomebar icons
This commit is contained in:
Ejaaz Khan 2026-01-06 02:30:48 +05:30 committed by GitHub
commit d03130c7db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 89 deletions

View file

@ -28,7 +28,7 @@ frappe.search.AwesomeBar = class AwesomeBar {
});
let search_modal_body = `<div class="align-baseline flex py-2 px-1 relative navbar-modal-wrapper">
<div class="modal-search-icon absolute pr-2 pl-3">${frappe.utils.icon("search")}</div>
<div class="modal-search-icon absolute pr-2 pl-2">${frappe.utils.icon("search")}</div>
<input
id="navbar-search"
type="text"
@ -364,10 +364,7 @@ frappe.search.AwesomeBar = class AwesomeBar {
this.options.push({
label: `
<span class="flex justify-between text-medium">
<span class="ellipsis">${
frappe.search.utils.make_icon("search") +
__("Search for {0}", [frappe.utils.xss_sanitise(txt).bold()])
}</span>
<span class="ellipsis">${__("Search for {0}", [frappe.utils.xss_sanitise(txt).bold()])}</span>
<kbd></kbd>
</span>
`,
@ -392,12 +389,10 @@ frappe.search.AwesomeBar = class AwesomeBar {
var options = {};
options[search_field] = ["like", "%" + txt + "%"];
this.options.push({
label:
frappe.search.utils.make_icon("search") +
__("Find {0} in {1}", [
frappe.utils.xss_sanitise(txt).bold(),
__(route[1]).bold(),
]),
label: __("Find {0} in {1}", [
frappe.utils.xss_sanitise(txt).bold(),
__(route[1]).bold(),
]),
value: __("Find {0} in {1}", [frappe.utils.xss_sanitise(txt), __(route[1])]),
route_options: options,
onclick: function () {
@ -464,7 +459,7 @@ frappe.search.AwesomeBar = class AwesomeBar {
make_random(txt) {
if (txt.toLowerCase().includes("random")) {
this.options.push({
label: frappe.search.utils.make_icon("key") + __("Generate Random Password"),
label: __("Generate Random Password"),
value: frappe.utils.get_random(16),
onclick: function () {
frappe.msgprint(frappe.utils.get_random(16), __("Result"));

View file

@ -5,11 +5,6 @@ frappe.search.utils = {
setup_recent: function () {
this.recent = JSON.parse(frappe.boot.user.recent || "[]") || [];
},
make_icon(name) {
return `<span style="padding: 0 3px; margin-right: 5px;">${frappe.utils.icon(
name
)}</span>`;
},
results_to_hide: [],
get_recent_pages: function (keywords) {
if (keywords === null) keywords = "";
@ -71,10 +66,10 @@ frappe.search.utils = {
const doctype = route[1];
if (route.length > 2 && doctype !== route[2]) {
const docname = route[2];
out.label = me.make_icon("sticky-note") + __(doctype) + " " + docname.bold();
out.label = __(doctype) + " " + docname.bold();
out.value = __(doctype) + " " + docname;
} else {
out.label = me.make_icon("sticky-note") + __(doctype).bold();
out.label = __(doctype).bold();
out.value = __(doctype);
}
} else if (
@ -84,33 +79,27 @@ frappe.search.utils = {
const view_type = route[0];
const view_name = route[1];
let icon, labelSuffix;
let labelSuffix;
switch (view_type) {
case "List":
icon = me.make_icon("list");
labelSuffix = __("List");
break;
case "Tree":
icon = me.make_icon("list-tree");
labelSuffix = __("Tree");
break;
case "Workspaces":
icon = me.make_icon("wallpaper");
labelSuffix = __("Workspace");
break;
case "query-report":
icon = me.make_icon("table");
labelSuffix = __("Report");
break;
}
out.label = icon + __(view_name.bold()) + " " + labelSuffix;
out.label = __(view_name.bold()) + " " + labelSuffix;
out.value = __(view_name) + " " + labelSuffix;
} else if (match[0]) {
out.label =
me.make_icon(me.recent ? "circle-dashed" : "file-text") +
frappe.utils.escape_html(match[0]).bold();
out.label = frappe.utils.escape_html(match[0]).bold();
out.value = match[0];
} else {
console.log("Illegal match", match);
@ -186,9 +175,7 @@ frappe.search.utils = {
if (level) {
out.push({
type: "New",
label:
me.make_icon("circle-plus") +
__("New {0}", [search_result.marked_string || __(item)]),
label: __("New {0}", [search_result.marked_string || __(item)]),
value: __("New {0}", [__(item)]),
index: 1 + level,
match: item,
@ -216,13 +203,6 @@ frappe.search.utils = {
} else {
label = __(`{0} ${skip_list ? "" : type}`, [marked_string || __(target)]);
}
if (type === "List") {
label = me.make_icon("list") + label;
} else if (type === "Report") {
label = me.make_icon("table") + label;
} else {
label = me.make_icon("search") + label;
}
return {
type: type,
label: label,
@ -245,9 +225,7 @@ frappe.search.utils = {
var match = item;
out.push({
type: "New",
label:
me.make_icon("circle-plus") +
__("New {0}", [search_result.marked_string || __(item)]),
label: __("New {0}", [search_result.marked_string || __(item)]),
value: __("New {0}", [__(item)]),
index: score + 0.015,
match: item,
@ -281,9 +259,7 @@ frappe.search.utils = {
else route = ["query-report", item];
out.push({
type: "Report",
label:
me.make_icon("grid-3x3") +
__("Report {0}", [search_result.marked_string || __(item)]),
label: __("Report {0}", [search_result.marked_string || __(item)]),
value: __("Report {0}", [__(item)]),
index: level,
route: route,
@ -309,9 +285,7 @@ frappe.search.utils = {
var page = me.pages[item];
out.push({
type: "Page",
label:
me.make_icon("file-text") +
__("Open {0}", [search_result.marked_string || __(item)]),
label: __("Open {0}", [search_result.marked_string || __(item)]),
value: __("Open {0}", [__(item)]),
match: item,
index: level,
@ -323,7 +297,7 @@ frappe.search.utils = {
if (__("calendar").indexOf(keywords.toLowerCase()) === 0) {
out.push({
type: "Calendar",
label: me.make_icon("calendar") + __("Open {0}", [__(target)]),
label: __("Open {0}", [__(target)]),
value: __("Open {0}", [__(target)]),
index: me.fuzzy_search(keywords, "Calendar"),
match: target,
@ -334,7 +308,7 @@ frappe.search.utils = {
if (__("hub").indexOf(keywords.toLowerCase()) === 0) {
out.push({
type: "Hub",
label: me.make_icon("earth-lock") + __("Open {0}", [__(target)]),
label: __("Open {0}", [__(target)]),
value: __("Open {0}", [__(target)]),
index: me.fuzzy_search(keywords, "Hub"),
match: target,
@ -344,7 +318,7 @@ frappe.search.utils = {
if (__("email inbox").indexOf(keywords.toLowerCase()) === 0) {
out.push({
type: "Inbox",
label: me.make_icon("inbox") + __("Open {0}", [__("Email Inbox")]),
label: __("Open {0}", [__("Email Inbox")]),
value: __("Open {0}", [__("Email Inbox")]),
index: me.fuzzy_search(keywords, "email inbox"),
match: target,
@ -363,9 +337,7 @@ frappe.search.utils = {
if (level > 0) {
var ret = {
type: "Workspace",
label:
me.make_icon("wallpaper") +
__("Open {0}", [search_result.marked_string || __(item.name)]),
label: __("Open {0}", [search_result.marked_string || __(item.name)]),
value: __("Open {0}", [__(item.name)]),
index: level,
route: [frappe.router.slug(item.name)],
@ -386,9 +358,7 @@ frappe.search.utils = {
if (level > 0) {
var ret = {
type: "Dashboard",
label:
me.make_icon("layout-dashboard") +
__("{0} Dashboard", [search_result.marked_string || __(item.name)]),
label: __("{0} Dashboard", [search_result.marked_string || __(item.name)]),
value: __("{0} Dashboard", [__(item.name)]),
index: level,
route: ["dashboard-view", item.name],
@ -710,9 +680,7 @@ frappe.search.utils = {
const search_result = me.fuzzy_search(keywords, item.title, true);
if (search_result.score > 0) {
var ret = {
label:
me.make_icon("arrow-down-from-line") +
__("Install {0} from Marketplace", [search_result.marked_string]),
label: __("Install {0} from Marketplace", [search_result.marked_string]),
value: __("Install {0} from Marketplace", [__(item.title)]),
index: search_result.score * 0.8,
route: [

View file

@ -942,44 +942,21 @@ Object.assign(frappe.utils, {
let route = route_str.split("/");
if (route[2] === "Report" || route[0] === "query-report") {
return (
frappe.search.utils.make_icon("table") +
(__(route[3]) || __(route[1])).bold() +
" " +
__("Report")
);
return (__(route[3]) || __(route[1])).bold() + " " + __("Report");
}
if (route[0] === "List") {
return frappe.search.utils.make_icon("list") + __(route[1]).bold() + " " + __("List");
__(route[1]).bold() + " " + __("List");
}
if (route[0] === "modules") {
return (
frappe.search.utils.make_icon("component") +
__(route[1]).bold() +
" " +
__("Module")
);
return __(route[1]).bold() + " " + __("Module");
}
if (route[0] === "Workspaces") {
return (
frappe.search.utils.make_icon("wallpaper") +
__(route[1]).bold() +
" " +
__("Workspace")
);
return __(route[1]).bold() + " " + __("Workspace");
}
if (route[0] === "dashboard") {
return (
frappe.search.utils.make_icon("dashboard") +
__(route[1]).bold() +
" " +
__("Dashboard")
);
return __(route[1]).bold() + " " + __("Dashboard");
}
return (
frappe.search.utils.make_icon("file-text") +
__(frappe.utils.to_title_case(__(route[0]), true))
);
return __(frappe.utils.to_title_case(__(route[0]), true));
},
report_column_total: function (values, column, type) {
if (column.column.disable_total) {

View file

@ -121,7 +121,7 @@
}
.cool-awesomebar-modal-footer {
padding: 10px 18px !important;
padding: 10px !important;
}
.awesomebar-modal-footer {