feat: add bundled plugin tab icons

This commit is contained in:
Federico Jaramillo Martinez
2026-06-03 22:38:55 +02:00
parent 08f69d09c0
commit 76302a4e5f
4 changed files with 29 additions and 4 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
"@jmfederico/pi-web": patch "@jmfederico/pi-web": patch
--- ---
Use compact icons, initials, and inline badges for the mobile main tab bar so tabs are easier to fit without losing horizontal scrolling, and let workspace panel plugins provide custom SVG tab icons. Use compact icons, initials, and inline badges for the mobile main tab bar so tabs are easier to fit without losing horizontal scrolling; let workspace panel plugins provide custom SVG tab icons; and add icons for bundled Info, Updates, and Tasks plugin panels.
+8 -1
View File
@@ -3,7 +3,7 @@ import type { PiWebPlugin } from "../../src/client/src/plugins/types";
const plugin: PiWebPlugin = { const plugin: PiWebPlugin = {
apiVersion: 1, apiVersion: 1,
name: "Info Plugin", name: "Info Plugin",
activate: ({ html }) => ({ activate: ({ html, svg }) => ({
contributions: { contributions: {
actions: [ actions: [
{ {
@@ -28,6 +28,13 @@ const plugin: PiWebPlugin = {
{ {
id: "workspace.info", id: "workspace.info",
title: "Info", title: "Info",
icon: svg`
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="9"></circle>
<path d="M12 11v5"></path>
<path d="M12 8h.01"></path>
</svg>
`,
order: 1000, order: 1000,
render: (context) => html` render: (context) => html`
<section class="toolbar"><strong>Info</strong></section> <section class="toolbar"><strong>Info</strong></section>
+9 -1
View File
@@ -149,12 +149,20 @@ function renderStatusPanel(html: HtmlTemplateTag, state: AppState): TemplateResu
const plugin: PiWebPlugin = { const plugin: PiWebPlugin = {
apiVersion: 1, apiVersion: 1,
name: "PI WEB Updates", name: "PI WEB Updates",
activate: ({ html }) => ({ activate: ({ html, svg }) => ({
contributions: { contributions: {
workspacePanels: [ workspacePanels: [
{ {
id: "workspace.status", id: "workspace.status",
title: "Updates", title: "Updates",
icon: svg`
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 6v5h-5"></path>
<path d="M4 18v-5h5"></path>
<path d="M18.4 9A7 7 0 0 0 6.1 6.7L4 8.8"></path>
<path d="M5.6 15A7 7 0 0 0 17.9 17.3L20 15.2"></path>
</svg>
`,
order: 100, order: 100,
visible: (context) => shouldShowStatusPanel(context.state), visible: (context) => shouldShowStatusPanel(context.state),
badge: (context) => { badge: (context) => {
@@ -6,7 +6,7 @@ import { terminalCommandRunsFromContext } from "./piWebInternal.js";
const plugin: PiWebPlugin = { const plugin: PiWebPlugin = {
apiVersion: 1, apiVersion: 1,
name: "Workspace Tasks", name: "Workspace Tasks",
activate: ({ pluginId, html }) => { activate: ({ pluginId, html, svg }) => {
defineTasksPanelElement(); defineTasksPanelElement();
return { return {
@@ -28,6 +28,16 @@ const plugin: PiWebPlugin = {
{ {
id: "workspace.tasks", id: "workspace.tasks",
title: "Tasks", title: "Tasks",
icon: svg`
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 6h11"></path>
<path d="M9 12h11"></path>
<path d="M9 18h11"></path>
<path d="m4 6 .8 .8L6.5 5"></path>
<path d="m4 12 .8 .8 1.7-1.8"></path>
<path d="m4 18 .8 .8 1.7-1.8"></path>
</svg>
`,
order: 40, order: 40,
badge: ({ workspace }) => tasksPanelBadge(workspace), badge: ({ workspace }) => tasksPanelBadge(workspace),
render: (context) => html`<pi-web-workspace-tasks-panel .workspace=${context.workspace} .terminalCommandRuns=${terminalCommandRunsFromContext(context)} .openTerminal=${context.openTerminal}></pi-web-workspace-tasks-panel>`, render: (context) => html`<pi-web-workspace-tasks-panel .workspace=${context.workspace} .terminalCommandRuns=${terminalCommandRunsFromContext(context)} .openTerminal=${context.openTerminal}></pi-web-workspace-tasks-panel>`,