@hienlh/ppm 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/cli-reference.md +4 -4
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-D3BylchP.js → accounts-settings-section-CLEAA_Jc.js} +1 -1
- package/dist/web/assets/{ai-resource-editor-BLPcnhTM.js → ai-resource-editor-C4ecid2g.js} +1 -1
- package/dist/web/assets/ai-settings-section-BOwGdiyH.js +1 -0
- package/dist/web/assets/ai-settings-section-Cqz13gRt.js +1 -0
- package/dist/web/assets/{api-client-C1ZwRL4Y.js → api-client-Jn3njtNw.js} +1 -1
- package/dist/web/assets/api-client-rSFnnCj4.js +1 -0
- package/dist/web/assets/{api-settings-_7Q-ULxp.js → api-settings-BxijvPBR.js} +1 -1
- package/dist/web/assets/{api-themes-DRAERo4Q.js → api-themes-CSUarkzD.js} +1 -1
- package/dist/web/assets/{appearance-settings-section-CiMdk3sb.js → appearance-settings-section-DbA8L-Vz.js} +1 -1
- package/dist/web/assets/{audio-preview-DsYvgKqj.js → audio-preview-CxJd8wRV.js} +1 -1
- package/dist/web/assets/{branch-review-tab-B1pFjlKM.js → branch-review-tab-CMTa2uSR.js} +1 -1
- package/dist/web/assets/chat-tab-BpdgqjSL.js +15 -0
- package/dist/web/assets/{code-editor-BJhOEsnZ.js → code-editor-B7y7-5KE.js} +3 -3
- package/dist/web/assets/{codex-daily-guard-CaCQJ4r_.js → codex-daily-guard-ChDPiXDx.js} +1 -1
- package/dist/web/assets/{conflict-editor-B7u_p49h.js → conflict-editor-Axs9Ad7A.js} +1 -1
- package/dist/web/assets/{csv-preview-CttjJU1e.js → csv-preview-DTUAW2HW.js} +1 -1
- package/dist/web/assets/{database-viewer-Ca4HxIfx.js → database-viewer-qXDiWeXj.js} +1 -1
- package/dist/web/assets/{diff-viewer-9-XjLIwa.js → diff-viewer-BtLiSpqe.js} +1 -1
- package/dist/web/assets/{docx-preview-CXuk-emm.js → docx-preview-Dxvy6h13.js} +1 -1
- package/dist/web/assets/{editor-language-service-D0DuEOs_.js → editor-language-service-D75GuLXP.js} +1 -1
- package/dist/web/assets/{explorer-body-VdCBqcZu.js → explorer-body-xg1-MhlW.js} +1 -1
- package/dist/web/assets/{explorer-window-content-BIsbl7Th.js → explorer-window-content-BeQocW3i.js} +1 -1
- package/dist/web/assets/{extension-manager-section-HkY7geS5.js → extension-manager-section-Bm2v3P-n.js} +1 -1
- package/dist/web/assets/{extension-webview-DZG8YHX9.js → extension-webview-CzxrAHyL.js} +1 -1
- package/dist/web/assets/{file-icons-BXdvggK2.js → file-icons-wS-OmEVu.js} +1 -1
- package/dist/web/assets/{file-store-ojgMXgAw.js → file-store-Ds3qJ4hC.js} +1 -1
- package/dist/web/assets/{files-settings-section-qnRtkX05.js → files-settings-section-Bd-_GeZU.js} +1 -1
- package/dist/web/assets/{format-file-meta-C77h04cZ.js → format-file-meta-PPi3ptkm.js} +1 -1
- package/dist/web/assets/{general-settings-section-BAFSZmCE.js → general-settings-section-CfNPHQUk.js} +1 -1
- package/dist/web/assets/{git-log-panel-2sGpfEla.js → git-log-panel-CtGxPzH6.js} +1 -1
- package/dist/web/assets/{git-repo-store-88Z8v-pF.js → git-repo-store-BCEPfUGT.js} +1 -1
- package/dist/web/assets/{glide-data-grid-f0hyITiF.js → glide-data-grid-iSo2vP0q.js} +1 -1
- package/dist/web/assets/{group-chat-tab-Ck6sk7yY.js → group-chat-tab-D1lx0zz-.js} +1 -1
- package/dist/web/assets/{image-preview-CzCc4_Do.js → image-preview-DeGD0HJu.js} +1 -1
- package/dist/web/assets/{index-CEZVxM4G.js → index-CN0G8uYY.js} +5 -5
- package/dist/web/assets/{jira-watcher-section-CeLmhvu1.js → jira-watcher-section-kyifZPTv.js} +1 -1
- package/dist/web/assets/keybindings-store-L5vV8DEJ.js +1 -0
- package/dist/web/assets/{keyboard-shortcuts-section-PVz6kuh2.js → keyboard-shortcuts-section-D2uJq4x9.js} +1 -1
- package/dist/web/assets/{markdown-renderer-C140Ijk0.js → markdown-renderer-BX1Q00sC.js} +1 -1
- package/dist/web/assets/markdown-renderer-CLUux0vA.js +1 -0
- package/dist/web/assets/{media-url-yfqHpPz0.js → media-url-DKK0YHxL.js} +1 -1
- package/dist/web/assets/{mobile-explorer-sheet-CUG_owdf.js → mobile-explorer-sheet-BHQDzpwK.js} +1 -1
- package/dist/web/assets/notification-store-BHgSy-ci.js +1 -0
- package/dist/web/assets/panel-store-D20Zuf3i.js +1 -0
- package/dist/web/assets/{pdf-preview-CmBI6E7d.js → pdf-preview-DAcfhfGm.js} +1 -1
- package/dist/web/assets/{postgres-viewer-8ZAqEALv.js → postgres-viewer-DPRsmgP5.js} +1 -1
- package/dist/web/assets/{ppmbot-settings-section-Cji-Mil-.js → ppmbot-settings-section-B5N1jHgm.js} +1 -1
- package/dist/web/assets/{problems-panel-a6_hrWvl.js → problems-panel-D_wZ4_Qg.js} +1 -1
- package/dist/web/assets/{process-table-CiIqlOIK.js → process-table-DahflyQn.js} +1 -1
- package/dist/web/assets/{project-framework-store-B70Q3dNM.js → project-framework-store-ViZgce6y.js} +1 -1
- package/dist/web/assets/{project-store-B87hLRSk.js → project-store-hNvwfqX3.js} +1 -1
- package/dist/web/assets/{proxy-settings-section-BjI4IFgp.js → proxy-settings-section-CLg_nlxn.js} +1 -1
- package/dist/web/assets/{query-audit-section-By6qyqdB.js → query-audit-section-BrfSo0s_.js} +1 -1
- package/dist/web/assets/{remote-desktop-clipboard-notice-eXYvwgx7.js → remote-desktop-clipboard-notice-Fi6cieGM.js} +1 -1
- package/dist/web/assets/{remote-desktop-mobile-sheet-Doh-fci-.js → remote-desktop-mobile-sheet-lLZ-oK73.js} +2 -2
- package/dist/web/assets/{remote-desktop-mobile-view-Dt8Akc3p.js → remote-desktop-mobile-view-j3v-4rYa.js} +1 -1
- package/dist/web/assets/{remote-desktop-readiness-gate-t83fqbID.js → remote-desktop-readiness-gate-CeLvcX_w.js} +1 -1
- package/dist/web/assets/{remote-desktop-window-content-CguhZMmx.js → remote-desktop-window-content-lwbkLsTC.js} +1 -1
- package/dist/web/assets/{run-in-terminal-CdefEe_R.js → run-in-terminal-D7W4IKb9.js} +1 -1
- package/dist/web/assets/{schedules-settings-section-BVkpW5ms.js → schedules-settings-section-C8OS0o80.js} +1 -1
- package/dist/web/assets/{send-to-chat-F207yH3u.js → send-to-chat-DNKhmHbi.js} +1 -1
- package/dist/web/assets/{settings-body-CoIxYAh6.js → settings-body-DgN22Z0W.js} +2 -2
- package/dist/web/assets/{settings-store-krC6bc79.js → settings-store-CsVSVgLp.js} +2 -2
- package/dist/web/assets/{settings-tab-7DKVUTbM.js → settings-tab-ChOs94iB.js} +1 -1
- package/dist/web/assets/{settings-window-content-3_39TeX-.js → settings-window-content-BnKMmg2a.js} +1 -1
- package/dist/web/assets/{sql-query-editor-CQB7Yp7U.js → sql-query-editor-BJZIIQsm.js} +1 -1
- package/dist/web/assets/{sqlite-viewer-Bd7rjr1D.js → sqlite-viewer--cMeCZum.js} +1 -1
- package/dist/web/assets/{system-monitor-body-DsRXeMyU.js → system-monitor-body-CXiIrn0N.js} +2 -2
- package/dist/web/assets/system-monitor-tab-BJKrTSl0.js +1 -0
- package/dist/web/assets/{system-monitor-window-content-ClPo4-El.js → system-monitor-window-content-Dy9fZJE3.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-d2TAD4PU.js → tab-host-window-content-BezqrAwC.js} +1 -1
- package/dist/web/assets/{tab-store-OJa1GPCq.js → tab-store-krAuHQ6_.js} +1 -1
- package/dist/web/assets/{team-member-sheet-7d2Qp-ie.js → team-member-sheet-CVM2QC3H.js} +2 -2
- package/dist/web/assets/{team-member-window-content-Bctg2gmg.js → team-member-window-content-D4RYKplm.js} +1 -1
- package/dist/web/assets/{terminal-tab-0HQic25V.js → terminal-tab-jikhQLct.js} +1 -1
- package/dist/web/assets/{tool-cards-CmLLRACd.js → tool-cards-D5jCQvqn.js} +2 -2
- package/dist/web/assets/{use-blob-url-CPtCcY3i.js → use-blob-url-DMGlPCQD.js} +1 -1
- package/dist/web/assets/{use-inline-blame-sDMjcz1-.js → use-inline-blame-BF8Y1KfV.js} +1 -1
- package/dist/web/assets/{use-lsp-CBgID-EU.js → use-lsp-Bx4oVtlk.js} +1 -1
- package/dist/web/assets/{use-monaco-theme-gvhJ_jZh.js → use-monaco-theme-DHczXLMb.js} +1 -1
- package/dist/web/assets/{use-websocket-C9wlRliB.js → use-websocket-BWZkbleJ.js} +1 -1
- package/dist/web/assets/{video-preview-CSDK5j6H.js → video-preview-D191TvX9.js} +1 -1
- package/dist/web/assets/{window-pip-registry-yD6esSju.js → window-pip-registry-D1oXq-Dq.js} +1 -1
- package/dist/web/assets/ws-auth-BG-cdrQ8.js +1 -0
- package/dist/web/index.html +13 -13
- package/dist/web/sw.js +1 -1
- package/docs/architecture/workspace-and-ui.md +13 -0
- package/package.json +1 -1
- package/src/cli/commands/init.ts +1 -0
- package/src/providers/codex-app-server/codex-history.ts +26 -7
- package/src/providers/codex-app-server/codex-provider.ts +6 -4
- package/src/server/routes/chat.ts +1 -1
- package/src/server/routes/settings.ts +11 -5
- package/src/services/config.service.ts +2 -0
- package/src/types/chat.ts +1 -1
- package/src/types/config.ts +12 -1
- package/src/web/components/chat/chat-tab.tsx +162 -38
- package/src/web/components/chat/message-input.tsx +24 -0
- package/src/web/components/chat/model-thinking-selector.tsx +25 -5
- package/src/web/components/chat/new-chat-provider-gate.tsx +68 -0
- package/src/web/components/layout/editor-panel.tsx +1 -1
- package/src/web/components/layout/reparenting-tab.tsx +4 -2
- package/src/web/components/layout/tab-bar.tsx +1 -1
- package/src/web/components/settings/ai-settings-section.tsx +36 -0
- package/src/web/hooks/use-draft.ts +25 -4
- package/src/web/hooks/use-usage.ts +6 -4
- package/src/web/lib/api-client.ts +7 -1
- package/src/web/lib/api-settings.ts +1 -0
- package/src/web/lib/new-chat-provider.ts +8 -0
- package/src/web/stores/panel-store.ts +46 -3
- package/dist/web/assets/ai-settings-section-BtR7rF-T.js +0 -1
- package/dist/web/assets/ai-settings-section-r9JctHNM.js +0 -1
- package/dist/web/assets/api-client-pQL53cDQ.js +0 -1
- package/dist/web/assets/chat-tab-DZagX06m.js +0 -15
- package/dist/web/assets/keybindings-store-C_3ChOEf.js +0 -1
- package/dist/web/assets/markdown-renderer-Dz7-DYUg.js +0 -1
- package/dist/web/assets/notification-store-6vib1ISy.js +0 -1
- package/dist/web/assets/panel-store-CboGJAwh.js +0 -1
- package/dist/web/assets/system-monitor-tab-DdSZgux3.js +0 -1
- package/dist/web/assets/ws-auth-CEYVQ8NH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{r as e}from"./api-client-
|
|
1
|
+
import"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{r as e}from"./api-client-Jn3njtNw.js";function t(t=!1){let n=e();return{...t?{"Content-Type":`application/json`}:{},...n?{Authorization:`Bearer ${n}`}:{}}}async function n(e){let t=await e.json();if(!t.ok)throw Error(t.error||`Request failed (${e.status})`);return t.data}async function r(){return n(await fetch(`/api/settings/themes`,{headers:t()}))}async function i(e){return(await n(await fetch(`/api/settings/themes`,{method:`POST`,headers:t(!0),body:JSON.stringify(e)}))).themes}async function a(e){await n(await fetch(`/api/settings/themes/${encodeURIComponent(e)}`,{method:`DELETE`,headers:t()}))}export{a as deleteImportedTheme,r as fetchImportedThemes,i as importTheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{c as r,l as i,s as a,u as o}from"./vendor-ui-DmZ-Mb-H.js";import{Wr as s,qn as c,w as l,wr as u,zr as d}from"./icons-DQjqk0lJ.js";import{s as f}from"./api-client-C1ZwRL4Y.js";import{t as p}from"./settings-store-krC6bc79.js";import"./vendor-mermaid-BitiXJlL.js";import{n as m}from"./utils-Bmf_8h7Y.js";import"./portal-container-context-BarKmT4S.js";import{n as h}from"./use-is-mobile-TkcwP1Gx.js";import{n as g,t as _}from"./button-B9CTrsEf.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./dialog-B84_DJQ8.js";import{t as w}from"./input-C7Q8FxeL.js";import{n as T,r as E,t as D}from"./resolve-theme-B_ukrg_8.js";import{Rt as O,Y as k,_ as A,h as j,i as M}from"./index-CEZVxM4G.js";import{t as N}from"./separator-TRMsJUYe.js";var P=n();function F(){let e=p(e=>e.themeStyle),t=p(e=>e.themeMode),n=p(e=>e.customThemeId),r=p(e=>e.customThemes),i=p(e=>e.setThemeStyle),a=p(e=>e.setThemeMode),o=D(e,t,r,n);return(0,P.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:T.map(e=>{let t=E[e];if(!t)return null;let n=o.id===e;return(0,P.jsxs)(`button`,{onClick:()=>{i(t.style),a(t.mode)},className:m(`relative flex items-center gap-2 rounded-lg border p-2 text-left transition-colors min-h-11`,n?`border-primary ring-[3px] ring-accent-wash`:`border-border hover:bg-accent/40`),children:[(0,P.jsx)(A,{swatch:t.swatch}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-xs font-medium text-text`,children:t.name.replace(/ (Dark|Light)$/,``)}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3 capitalize`,children:t.mode})]}),n&&(0,P.jsx)(l,{className:`absolute top-1 right-1 size-3.5 text-primary`})]},e)})})}var I=e(t(),1);function L({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(i,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:m(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var R=g(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function z({className:e,variant:t=`default`,...n}){return(0,P.jsx)(r,{"data-slot":`tabs-list`,"data-variant":t,className:m(R({variant:t}),e),...n})}function B({className:e,...t}){return(0,P.jsx)(o,{"data-slot":`tabs-trigger`,className:m(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function V({className:e,...t}){return(0,P.jsx)(a,{"data-slot":`tabs-content`,className:m(`flex-1 outline-none`,e),...t})}function H({open:e,onOpenChange:t}){let n=p(e=>e.importThemeFrom),r=p(e=>e.setCustomTheme),[i,a]=(0,I.useState)(`url`),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),[m,h]=(0,I.useState)(!1),g=()=>{s(``),l(``),d(``),a(`url`)},T=async()=>{let e=i===`url`?o.trim():c.trim();if(!e){f.error(`Nothing to import`);return}h(!0);try{let a=await n({source:i===`url`?`url`:i===`upload`?`upload`:`json`,value:e,name:u.trim()||void 0});f.success(a.length>1?`Imported ${a.length} themes`:`Imported "${a[0]?.name}"`),a[0]&&r(a[0].id),g(),t(!1)}catch(e){f.error(e.message||`Import failed`)}finally{h(!1)}},E=async e=>{if(e)try{l(await e.text()),d(e.name.replace(/\.json$/i,``))}catch{f.error(`Could not read file`)}};return(0,P.jsx)(C,{open:e,onOpenChange:t,children:(0,P.jsxs)(b,{className:`max-w-md`,children:[(0,P.jsxs)(v,{children:[(0,P.jsx)(x,{children:`Import theme`}),(0,P.jsx)(S,{className:`text-text-3`,children:`Import a VSCode color theme. Single-mode themes apply to both dark and light.`})]}),(0,P.jsxs)(L,{value:i,onValueChange:e=>a(e),children:[(0,P.jsxs)(z,{className:`w-full`,children:[(0,P.jsx)(B,{value:`url`,className:`flex-1`,children:`URL`}),(0,P.jsx)(B,{value:`json`,className:`flex-1`,children:`Paste JSON`}),(0,P.jsx)(B,{value:`upload`,className:`flex-1`,children:`Upload`})]}),(0,P.jsxs)(V,{value:`url`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(w,{placeholder:`https://…/theme.json or Marketplace .vsix URL`,value:o,onChange:e=>s(e.target.value)}),(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`Only https URLs; private/internal addresses are blocked.`})]}),(0,P.jsx)(V,{value:`json`,className:`pt-2`,children:(0,P.jsx)(`textarea`,{className:`w-full h-40 rounded-md border border-border bg-surface p-2 text-xs font-mono text-text focus:outline-none focus:border-ring`,placeholder:`{ "name": "My Theme", "type": "dark", "colors": { … }, "tokenColors": [ … ] }`,value:c,onChange:e=>l(e.target.value)})}),(0,P.jsxs)(V,{value:`upload`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:e=>E(e.target.files?.[0]),className:`block w-full text-xs text-text-2 file:mr-3 file:rounded file:border file:border-border file:bg-panel-2 file:px-2 file:py-1 file:text-text`}),c&&(0,P.jsxs)(`p`,{className:`text-[11px] text-success`,children:[`File loaded (`,c.length,` chars)`]})]})]}),(0,P.jsx)(w,{placeholder:`Optional name`,value:u,onChange:e=>d(e.target.value)}),(0,P.jsxs)(y,{children:[(0,P.jsx)(_,{variant:`outline`,onClick:()=>t(!1),disabled:m,children:`Cancel`}),(0,P.jsx)(_,{onClick:T,disabled:m,children:m?`Importing…`:`Import`})]})]})})}function U(){let e=p(e=>e.customThemes),t=p(e=>e.themeStyle),n=p(e=>e.customThemeId),r=p(e=>e.setCustomTheme),i=p(e=>e.deleteCustomTheme),[a,o]=(0,I.useState)(!1);return(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Imported themes`}),(0,P.jsxs)(_,{size:`sm`,variant:`outline`,className:`h-7 gap-1 text-xs`,onClick:()=>o(!0),children:[(0,P.jsx)(c,{className:`size-3.5`}),` Import`]})]}),e.length===0?(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`No imported themes yet. Import a VSCode theme from a URL, .vsix, or JSON.`}):(0,P.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let a=t===`custom`&&n===e.id;return(0,P.jsxs)(`li`,{className:m(`flex items-center gap-2 rounded-md border px-2 py-1.5`,a?`border-primary bg-primary/10`:`border-border`),children:[(0,P.jsx)(A,{swatch:e.swatch}),(0,P.jsxs)(`button`,{className:`flex-1 min-w-0 text-left`,onClick:()=>r(e.id),children:[(0,P.jsx)(`span`,{className:`block truncate text-xs text-text`,children:e.name}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3`,children:e.mode})]}),a&&(0,P.jsx)(l,{className:`size-4 text-primary shrink-0`}),(0,P.jsx)(`button`,{className:`text-text-3 hover:text-error transition-colors shrink-0`,title:`Delete`,onClick:()=>void i(e.id),children:(0,P.jsx)(u,{className:`size-3.5`})})]},e.id)})}),(0,P.jsx)(H,{open:a,onOpenChange:o})]})}var W=[{value:`default`,label:`Default`},{value:`boxed`,label:`Boxed`},{value:`pill`,label:`Pill`}],G=[{value:`auto`,label:`Auto`},{value:`windows`,label:`Windows`},{value:`macos`,label:`macOS`}];function K({options:e,value:t,onChange:n}){return(0,P.jsx)(`div`,{className:`flex gap-2`,children:e.map(e=>(0,P.jsx)(_,{variant:t===e.value?`default`:`outline`,onClick:()=>n(e.value),className:m(`flex-1 cursor-pointer`,t===e.value&&`ring-2 ring-primary`),children:e.label},e.value))})}function q(){let{theme:e,setTheme:t,tabWrap:n,toggleTabWrap:r,editorTabStyle:i,setEditorTabStyle:a,explorerSkin:o,setExplorerSkin:c}=p(O(e=>({theme:e.themeMode,setTheme:e.setThemeMode,tabWrap:e.tabWrap,toggleTabWrap:e.toggleTabWrap,editorTabStyle:e.editorTabStyle,setEditorTabStyle:e.setEditorTabStyle,explorerSkin:e.explorerSkin,setExplorerSkin:e.setExplorerSkin}))),{wordWrap:l,toggleWordWrap:u,mobileWordWrap:f,toggleMobileWordWrap:g,lspEnabled:v,setLspEnabled:y}=p(O(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap,mobileWordWrap:e.mobileWordWrap,toggleMobileWordWrap:e.toggleMobileWordWrap,lspEnabled:e.lspEnabled,setLspEnabled:e.setLspEnabled}))),b=h(),x=M();return(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Theme`}),(0,P.jsx)(F,{}),(0,P.jsx)(`div`,{className:`flex gap-2`,children:j.map(n=>{let r=n.icon;return(0,P.jsxs)(_,{variant:e===n.value?`default`:`outline`,onClick:()=>t(n.value),className:m(`flex-1 gap-2 cursor-pointer`,e===n.value&&`ring-2 ring-primary`),children:[(0,P.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,P.jsx)(N,{}),(0,P.jsx)(U,{}),(0,P.jsx)(N,{}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(d,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Wrap Tabs`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Stack tabs in rows instead of scrolling`})]})]}),(0,P.jsx)(k,{checked:n,onCheckedChange:r})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(d,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Word Wrap`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b?`Wrap long lines instead of scrolling sideways (this device)`:`Wrap long lines in the editor (Alt+Z)`})]})]}),(0,P.jsx)(k,{checked:b?f:l,onCheckedChange:()=>b?g():u()})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(s,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Language Server`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?`Off on a touch device — it runs a server process per project`:`Completions, hover, F12, rename and quick fix (this device)`})]})]}),(0,P.jsx)(k,{checked:v&&!x,disabled:x,onCheckedChange:y})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Tab Style`}),(0,P.jsx)(K,{options:W,value:i,onChange:a})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Explorer Skin`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Chrome the OS File Explorer window wears. Auto follows the host platform.`}),(0,P.jsx)(K,{options:G,value:o,onChange:c})]})]})}export{q as AppearanceSettingsSection};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{c as r,l as i,s as a,u as o}from"./vendor-ui-DmZ-Mb-H.js";import{Wr as s,qn as c,w as l,wr as u,zr as d}from"./icons-DQjqk0lJ.js";import{s as f}from"./api-client-Jn3njtNw.js";import{t as p}from"./settings-store-CsVSVgLp.js";import"./vendor-mermaid-BitiXJlL.js";import{n as m}from"./utils-Bmf_8h7Y.js";import"./portal-container-context-BarKmT4S.js";import{n as h}from"./use-is-mobile-TkcwP1Gx.js";import{n as g,t as _}from"./button-B9CTrsEf.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./dialog-B84_DJQ8.js";import{t as w}from"./input-C7Q8FxeL.js";import{n as T,r as E,t as D}from"./resolve-theme-B_ukrg_8.js";import{Rt as O,Y as k,_ as A,h as j,i as M}from"./index-CN0G8uYY.js";import{t as N}from"./separator-TRMsJUYe.js";var P=n();function F(){let e=p(e=>e.themeStyle),t=p(e=>e.themeMode),n=p(e=>e.customThemeId),r=p(e=>e.customThemes),i=p(e=>e.setThemeStyle),a=p(e=>e.setThemeMode),o=D(e,t,r,n);return(0,P.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:T.map(e=>{let t=E[e];if(!t)return null;let n=o.id===e;return(0,P.jsxs)(`button`,{onClick:()=>{i(t.style),a(t.mode)},className:m(`relative flex items-center gap-2 rounded-lg border p-2 text-left transition-colors min-h-11`,n?`border-primary ring-[3px] ring-accent-wash`:`border-border hover:bg-accent/40`),children:[(0,P.jsx)(A,{swatch:t.swatch}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-xs font-medium text-text`,children:t.name.replace(/ (Dark|Light)$/,``)}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3 capitalize`,children:t.mode})]}),n&&(0,P.jsx)(l,{className:`absolute top-1 right-1 size-3.5 text-primary`})]},e)})})}var I=e(t(),1);function L({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(i,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:m(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var R=g(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function z({className:e,variant:t=`default`,...n}){return(0,P.jsx)(r,{"data-slot":`tabs-list`,"data-variant":t,className:m(R({variant:t}),e),...n})}function B({className:e,...t}){return(0,P.jsx)(o,{"data-slot":`tabs-trigger`,className:m(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function V({className:e,...t}){return(0,P.jsx)(a,{"data-slot":`tabs-content`,className:m(`flex-1 outline-none`,e),...t})}function H({open:e,onOpenChange:t}){let n=p(e=>e.importThemeFrom),r=p(e=>e.setCustomTheme),[i,a]=(0,I.useState)(`url`),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),[m,h]=(0,I.useState)(!1),g=()=>{s(``),l(``),d(``),a(`url`)},T=async()=>{let e=i===`url`?o.trim():c.trim();if(!e){f.error(`Nothing to import`);return}h(!0);try{let a=await n({source:i===`url`?`url`:i===`upload`?`upload`:`json`,value:e,name:u.trim()||void 0});f.success(a.length>1?`Imported ${a.length} themes`:`Imported "${a[0]?.name}"`),a[0]&&r(a[0].id),g(),t(!1)}catch(e){f.error(e.message||`Import failed`)}finally{h(!1)}},E=async e=>{if(e)try{l(await e.text()),d(e.name.replace(/\.json$/i,``))}catch{f.error(`Could not read file`)}};return(0,P.jsx)(C,{open:e,onOpenChange:t,children:(0,P.jsxs)(b,{className:`max-w-md`,children:[(0,P.jsxs)(v,{children:[(0,P.jsx)(x,{children:`Import theme`}),(0,P.jsx)(S,{className:`text-text-3`,children:`Import a VSCode color theme. Single-mode themes apply to both dark and light.`})]}),(0,P.jsxs)(L,{value:i,onValueChange:e=>a(e),children:[(0,P.jsxs)(z,{className:`w-full`,children:[(0,P.jsx)(B,{value:`url`,className:`flex-1`,children:`URL`}),(0,P.jsx)(B,{value:`json`,className:`flex-1`,children:`Paste JSON`}),(0,P.jsx)(B,{value:`upload`,className:`flex-1`,children:`Upload`})]}),(0,P.jsxs)(V,{value:`url`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(w,{placeholder:`https://…/theme.json or Marketplace .vsix URL`,value:o,onChange:e=>s(e.target.value)}),(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`Only https URLs; private/internal addresses are blocked.`})]}),(0,P.jsx)(V,{value:`json`,className:`pt-2`,children:(0,P.jsx)(`textarea`,{className:`w-full h-40 rounded-md border border-border bg-surface p-2 text-xs font-mono text-text focus:outline-none focus:border-ring`,placeholder:`{ "name": "My Theme", "type": "dark", "colors": { … }, "tokenColors": [ … ] }`,value:c,onChange:e=>l(e.target.value)})}),(0,P.jsxs)(V,{value:`upload`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:e=>E(e.target.files?.[0]),className:`block w-full text-xs text-text-2 file:mr-3 file:rounded file:border file:border-border file:bg-panel-2 file:px-2 file:py-1 file:text-text`}),c&&(0,P.jsxs)(`p`,{className:`text-[11px] text-success`,children:[`File loaded (`,c.length,` chars)`]})]})]}),(0,P.jsx)(w,{placeholder:`Optional name`,value:u,onChange:e=>d(e.target.value)}),(0,P.jsxs)(y,{children:[(0,P.jsx)(_,{variant:`outline`,onClick:()=>t(!1),disabled:m,children:`Cancel`}),(0,P.jsx)(_,{onClick:T,disabled:m,children:m?`Importing…`:`Import`})]})]})})}function U(){let e=p(e=>e.customThemes),t=p(e=>e.themeStyle),n=p(e=>e.customThemeId),r=p(e=>e.setCustomTheme),i=p(e=>e.deleteCustomTheme),[a,o]=(0,I.useState)(!1);return(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Imported themes`}),(0,P.jsxs)(_,{size:`sm`,variant:`outline`,className:`h-7 gap-1 text-xs`,onClick:()=>o(!0),children:[(0,P.jsx)(c,{className:`size-3.5`}),` Import`]})]}),e.length===0?(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`No imported themes yet. Import a VSCode theme from a URL, .vsix, or JSON.`}):(0,P.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let a=t===`custom`&&n===e.id;return(0,P.jsxs)(`li`,{className:m(`flex items-center gap-2 rounded-md border px-2 py-1.5`,a?`border-primary bg-primary/10`:`border-border`),children:[(0,P.jsx)(A,{swatch:e.swatch}),(0,P.jsxs)(`button`,{className:`flex-1 min-w-0 text-left`,onClick:()=>r(e.id),children:[(0,P.jsx)(`span`,{className:`block truncate text-xs text-text`,children:e.name}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3`,children:e.mode})]}),a&&(0,P.jsx)(l,{className:`size-4 text-primary shrink-0`}),(0,P.jsx)(`button`,{className:`text-text-3 hover:text-error transition-colors shrink-0`,title:`Delete`,onClick:()=>void i(e.id),children:(0,P.jsx)(u,{className:`size-3.5`})})]},e.id)})}),(0,P.jsx)(H,{open:a,onOpenChange:o})]})}var W=[{value:`default`,label:`Default`},{value:`boxed`,label:`Boxed`},{value:`pill`,label:`Pill`}],G=[{value:`auto`,label:`Auto`},{value:`windows`,label:`Windows`},{value:`macos`,label:`macOS`}];function K({options:e,value:t,onChange:n}){return(0,P.jsx)(`div`,{className:`flex gap-2`,children:e.map(e=>(0,P.jsx)(_,{variant:t===e.value?`default`:`outline`,onClick:()=>n(e.value),className:m(`flex-1 cursor-pointer`,t===e.value&&`ring-2 ring-primary`),children:e.label},e.value))})}function q(){let{theme:e,setTheme:t,tabWrap:n,toggleTabWrap:r,editorTabStyle:i,setEditorTabStyle:a,explorerSkin:o,setExplorerSkin:c}=p(O(e=>({theme:e.themeMode,setTheme:e.setThemeMode,tabWrap:e.tabWrap,toggleTabWrap:e.toggleTabWrap,editorTabStyle:e.editorTabStyle,setEditorTabStyle:e.setEditorTabStyle,explorerSkin:e.explorerSkin,setExplorerSkin:e.setExplorerSkin}))),{wordWrap:l,toggleWordWrap:u,mobileWordWrap:f,toggleMobileWordWrap:g,lspEnabled:v,setLspEnabled:y}=p(O(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap,mobileWordWrap:e.mobileWordWrap,toggleMobileWordWrap:e.toggleMobileWordWrap,lspEnabled:e.lspEnabled,setLspEnabled:e.setLspEnabled}))),b=h(),x=M();return(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Theme`}),(0,P.jsx)(F,{}),(0,P.jsx)(`div`,{className:`flex gap-2`,children:j.map(n=>{let r=n.icon;return(0,P.jsxs)(_,{variant:e===n.value?`default`:`outline`,onClick:()=>t(n.value),className:m(`flex-1 gap-2 cursor-pointer`,e===n.value&&`ring-2 ring-primary`),children:[(0,P.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,P.jsx)(N,{}),(0,P.jsx)(U,{}),(0,P.jsx)(N,{}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(d,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Wrap Tabs`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Stack tabs in rows instead of scrolling`})]})]}),(0,P.jsx)(k,{checked:n,onCheckedChange:r})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(d,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Word Wrap`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b?`Wrap long lines instead of scrolling sideways (this device)`:`Wrap long lines in the editor (Alt+Z)`})]})]}),(0,P.jsx)(k,{checked:b?f:l,onCheckedChange:()=>b?g():u()})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(s,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Language Server`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?`Off on a touch device — it runs a server process per project`:`Completions, hover, F12, rename and quick fix (this device)`})]})]}),(0,P.jsx)(k,{checked:v&&!x,disabled:x,onCheckedChange:y})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Tab Style`}),(0,P.jsx)(K,{options:W,value:i,onChange:a})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Explorer Skin`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Chrome the OS File Explorer window wears. Auto follows the host platform.`}),(0,P.jsx)(K,{options:G,value:o,onChange:c})]})]})}export{q as AppearanceSettingsSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{jn as r,yt as i}from"./icons-DQjqk0lJ.js";import"./api-client-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{jn as r,yt as i}from"./icons-DQjqk0lJ.js";import"./api-client-Jn3njtNw.js";import{t as a}from"./utils-Bmf_8h7Y.js";import{r as o}from"./media-url-DKK0YHxL.js";var s=e(t(),1),c=n();function l({filePath:e,projectName:t}){let[n,l]=(0,s.useState)(!1);return n?(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,c.jsx)(i,{className:`size-10 text-text-subtle`}),(0,c.jsx)(`p`,{className:`text-sm`,children:`Failed to load audio.`})]}):(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-4 p-4 bg-surface`,children:[(0,c.jsx)(r,{className:`size-16 text-text-subtle`}),(0,c.jsx)(`p`,{className:`text-sm text-text-secondary truncate max-w-xs`,children:a(e)}),(0,c.jsx)(`audio`,{src:o(e,t),controls:!0,preload:`metadata`,className:`w-full max-w-md`,onError:()=>l(!0)},e)]})}export{l as AudioPreview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{O as r,Qn as i,_t as a,an as o,j as s,ln as c,u as l,w as u}from"./icons-DQjqk0lJ.js";import{n as d}from"./api-client-C1ZwRL4Y.js";import"./settings-store-krC6bc79.js";import"./vendor-mermaid-BitiXJlL.js";import"./portal-container-context-BarKmT4S.js";import"./project-store-B87hLRSk.js";import"./project-framework-store-B70Q3dNM.js";import{n as f}from"./use-is-mobile-TkcwP1Gx.js";import"./git-repo-store-88Z8v-pF.js";import{t as p}from"./button-B9CTrsEf.js";import{t as m}from"./file-icons-BXdvggK2.js";import{t as h}from"./mobile-bottom-sheet-C3TniEP-.js";import"./use-visual-viewport-Lp878uzs.js";import{t as g}from"./scroll-area-BzeiOd-B.js";import{$ as ee,Et as te,Q as ne,et as _,nt as re,tt as ie}from"./index-CEZVxM4G.js";import"./use-monaco-theme-gvhJ_jZh.js";import"./use-inline-blame-sDMjcz1-.js";import{DiffViewer as ae}from"./diff-viewer-9-XjLIwa.js";var v=e(t(),1),y=`ppm:branch-review`,b=`${y}:recent`,x=20;function oe(e,t,n){return`${y}:${e}:${t}:${n}`}function S(e,t){return e[t.path]===t.blob}function se(e,t){let n={...e};return S(e,t)?delete n[t.path]:n[t.path]=t.blob,n}function C(e,t,n){if(!n)return{};let r={...e};for(let e of t)r[e.path]=e.blob;return r}function w(e,t){return t.reduce((t,n)=>t+(S(e,n)?1:0),0)}function T(e,t){let n=new Set(t.map(e=>e.path)),r={};for(let[t,i]of Object.entries(e))n.has(t)&&(r[t]=i);return r}function E(e){return e.find(e=>!e.binary)??e[0]??null}function ce(e,t,n){if(t.length===0)return null;let r=n?t.findIndex(e=>e.path===n)+1:0;for(let n=0;n<t.length;n++){let i=t[(r+n)%t.length];if(i&&!S(e,i))return i}return null}function le(e){try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n))typeof t==`string`&&(r[e]=t);return r}catch{return{}}}function D(e,t,n=x){let r=[t,...e.filter(e=>e!==t)];return{recent:r.slice(0,n),evicted:r.slice(n)}}function O(){try{let e=JSON.parse(localStorage.getItem(b)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function k(e,t){try{if(Object.keys(t).length===0){localStorage.removeItem(e);let t=O().filter(t=>t!==e);localStorage.setItem(b,JSON.stringify(t));return}localStorage.setItem(e,JSON.stringify(t));let{recent:n,evicted:r}=D(O(),e);for(let e of r)localStorage.removeItem(e);localStorage.setItem(b,JSON.stringify(n))}catch{}}var A=n(),j={M:`text-warning`,A:`text-success`,D:`text-error`,R:`text-primary`,C:`text-accent-2`,T:`text-text-3`};function M({children:e}){return(0,A.jsx)(`span`,{dir:`rtl`,className:`truncate text-left min-w-0 flex-1`,children:(0,A.jsx)(`bdi`,{children:e})})}function N(e){let{node:t,depth:n,byPath:i,reviewed:a,selectedPath:o,collapsed:c,onToggleCollapse:l,onSelect:d,onToggleReviewed:f}=e,p=t.file?i.get(t.fullPath):void 0;if(!p){let i=c.has(t.fullPath);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,"data-testid":`branch-review-folder`,className:`w-full flex items-center gap-1 px-2 py-1 text-xs min-h-11 md:min-h-0 hover:bg-surface-hover text-left`,style:{paddingLeft:n*14+8},onClick:()=>l(t.fullPath),children:[i?(0,A.jsx)(s,{className:`size-3 shrink-0`}):(0,A.jsx)(r,{className:`size-3 shrink-0`}),(0,A.jsx)(`span`,{className:`truncate text-text-2`,children:t.name})]}),!i&&t.children.map(t=>(0,A.jsx)(N,{...e,node:t,depth:n+1},t.fullPath))]})}let h=S(a,p),g=o===p.path;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 pr-2 py-1 text-xs cursor-pointer border-l-2 min-h-11 md:min-h-0 hover:bg-surface-hover ${g?`bg-primary/10 border-primary`:`border-transparent`}`,style:{paddingLeft:n*14+6},onClick:()=>d(p.path),"aria-current":g?`true`:void 0,"data-testid":`branch-review-file`,"data-path":p.path,"data-selected":g?`true`:`false`,"data-reviewed":h?`true`:`false`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":h?`Mark ${p.path} unreviewed`:`Mark ${p.path} reviewed`,"data-testid":`branch-review-check`,className:`size-11 md:size-4 shrink-0 flex items-center justify-center`,onClick:e=>{e.stopPropagation(),f(p)},children:(0,A.jsx)(`span`,{"data-testid":`branch-review-check-box`,className:`size-4 rounded border flex items-center justify-center ${h?`bg-primary border-primary text-primary-foreground`:`border-border`}`,children:h&&(0,A.jsx)(u,{className:`size-3`})})}),(0,A.jsx)(m,{name:t.name,className:`size-3.5 shrink-0`}),(0,A.jsx)(M,{children:t.name}),(0,A.jsx)(`span`,{className:`shrink-0 font-mono ${j[p.status]}`,children:p.status}),p.binary?(0,A.jsx)(`span`,{className:`shrink-0 text-text-3 italic`,children:`bin`}):(0,A.jsxs)(`span`,{className:`shrink-0 tabular-nums text-[10px]`,children:[(0,A.jsxs)(`span`,{className:`text-success`,children:[`+`,p.additions]}),` `,(0,A.jsxs)(`span`,{className:`text-error`,children:[`-`,p.deletions]})]})]})}function ue(e,t){let n=e.filter(e=>!e.remote&&e.name!==t);return n.find(e=>e.name===`main`)?.name??n.find(e=>e.name===`master`)?.name??n[0]?.name??``}function P({metadata:e}){let t=e?.projectName,n=te(t),r=f(),[s,u]=(0,v.useState)([]),[m,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,D]=(0,v.useState)(null),[O,j]=(0,v.useState)(null),[P,F]=(0,v.useState)({}),[de,I]=(0,v.useState)(new Set),[L,R]=(0,v.useState)(!1),[z,B]=(0,v.useState)(null),[V,H]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!t||!n.repo)return;let e=!1;return d.get(n.gitUrl(`/branches`)).then(t=>{if(e)return;u(t);let n=t.find(e=>e.current)?.name;x(e=>e||n||``),y(e=>e||ue(t,n))}).catch(t=>!e&&B(t instanceof Error?t.message:`Could not list branches`)),()=>{e=!0}},[t,n]);let U=(0,v.useRef)(null),W=(0,v.useCallback)(async()=>{if(!t||!n.repo||!m||!b)return;U.current?.abort();let e=new AbortController;U.current=e,R(!0),B(null);try{let t=new URLSearchParams({base:m,head:b}),r=await d.get(n.gitUrl(`/branch-diff?${t}`),{signal:e.signal});if(e.signal.aborted)return;D(r),j(e=>e&&r.files.some(t=>t.path===e)?e:E(r.files)?.path??null)}catch(t){if(e.signal.aborted)return;D(null),B(t instanceof Error?t.message:`Could not compare these branches`)}finally{e.signal.aborted||R(!1)}},[t,n,m,b]);(0,v.useEffect)(()=>(W(),()=>U.current?.abort()),[W]);let G=t&&m&&b?oe(t,m,b):null;(0,v.useEffect)(()=>{I(new Set)},[G]),(0,v.useEffect)(()=>{F(G?le(G):{})},[G]);let K=S&&S.base===m&&S.head===b?S:null;(0,v.useEffect)(()=>{!G||!K||F(e=>{let t=T(e,K.files);return Object.keys(t).length!==Object.keys(e).length&&k(G,t),t})},[G,K]);let q=(0,v.useCallback)(e=>{F(e),G&&k(G,e)},[G]),J=K?.files??[],Y=(0,v.useMemo)(()=>new Map(J.map(e=>[e.path,e])),[J]),X=(0,v.useMemo)(()=>w(P,J),[P,J]),fe=(0,v.useMemo)(()=>ee(ne(J.map(e=>({path:e.path,status:e.status===`T`?`M`:e.status})))),[J]),Z=O?Y.get(O)??null:null,Q=(0,v.useCallback)(()=>{let e=ce(P,J,O);e&&(j(e.path),H(!1))},[P,J,O]);if(n.noRepo)return(0,A.jsx)(_,{onReload:n.reload});if(n.needsPick)return(0,A.jsx)(re,{repos:n.repos,onChoose:n.choose});let $=(0,A.jsx)(g,{className:`h-full`,children:(0,A.jsxs)(`div`,{className:`py-1`,children:[J.length===0&&!L&&(0,A.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-text-3`,children:z?`—`:`These branches have identical trees.`}),fe.map(e=>(0,A.jsx)(N,{node:e,depth:0,byPath:Y,reviewed:P,selectedPath:O,collapsed:de,onToggleCollapse:e=>I(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:e=>{j(e),H(!1)},onToggleReviewed:e=>q(se(P,e))},e.fullPath)),!!K?.omitted&&(0,A.jsxs)(`div`,{className:`px-3 py-3 text-center text-xs text-text-3`,children:[K.omitted.toLocaleString(),` more `,K.omitted===1?`file`:`files`,` not listed.`]})]})});return(0,A.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-bg`,children:[n.isNested&&n.repo&&(0,A.jsx)(ie,{repo:n.repo,repos:n.repos,onChoose:n.choose}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border shrink-0 flex-wrap`,children:[(0,A.jsx)(`select`,{value:m,onChange:e=>y(e.target.value),"aria-label":`Base branch`,"data-testid":`branch-review-base`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:s.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsx)(l,{className:`size-3.5 text-text-3 shrink-0`}),(0,A.jsx)(`select`,{value:b,onChange:e=>x(e.target.value),"aria-label":`Branch to review`,"data-testid":`branch-review-head`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:s.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-text-2 tabular-nums`,"data-testid":`branch-review-progress`,children:[X,`/`,J.length,` reviewed`]}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:X===J.length&&J.length>0?`Clear all`:`Mark all reviewed`,disabled:J.length===0,onClick:()=>q(C(P,J,X!==J.length)),children:(0,A.jsx)(o,{className:`size-3.5`})}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:`Reload`,onClick:()=>void W(),children:(0,A.jsx)(i,{className:L?`animate-spin`:``})})]})]}),z&&(0,A.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-destructive bg-destructive/10 shrink-0`,children:z}),(0,A.jsxs)(`div`,{className:`flex-1 flex min-h-0`,children:[!r&&(0,A.jsx)(`div`,{className:`w-72 shrink-0 border-r border-border flex flex-col min-h-0`,children:$}),(0,A.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:Z?(0,A.jsx)(ae,{metadata:{filePath:n.projectFile(Z.path),projectName:t,ref1:K?.mergeBase,ref2:K?.headCommit}},`${Z.path}:${K?.mergeBase}:${K?.headCommit}`):(0,A.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-3`,children:L?(0,A.jsx)(c,{className:`size-4 animate-spin`}):`Nothing to review.`})})]}),r&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border p-2 shrink-0`,children:[(0,A.jsxs)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:()=>H(!0),children:[(0,A.jsx)(a,{className:`size-4`}),J.length,` files`]}),(0,A.jsx)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:Q,children:`Next unreviewed`})]}),r&&(0,A.jsx)(h,{open:V,onClose:()=>H(!1),children:(0,A.jsx)(`div`,{className:`max-h-[70vh] overflow-hidden flex flex-col`,children:$})}),!r&&Z&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2 py-1 shrink-0`,children:[(0,A.jsx)(M,{children:Z.path}),(0,A.jsx)(p,{variant:`ghost`,size:`xs`,onClick:Q,children:`Next unreviewed`})]})]})}export{P as BranchReviewTab};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{O as r,Qn as i,_t as a,an as o,j as s,ln as c,u as l,w as u}from"./icons-DQjqk0lJ.js";import{n as d}from"./api-client-Jn3njtNw.js";import"./settings-store-CsVSVgLp.js";import"./vendor-mermaid-BitiXJlL.js";import"./portal-container-context-BarKmT4S.js";import"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import{n as f}from"./use-is-mobile-TkcwP1Gx.js";import"./git-repo-store-BCEPfUGT.js";import{t as p}from"./button-B9CTrsEf.js";import{t as m}from"./file-icons-wS-OmEVu.js";import{t as h}from"./mobile-bottom-sheet-C3TniEP-.js";import"./use-visual-viewport-Lp878uzs.js";import{t as g}from"./scroll-area-BzeiOd-B.js";import{$ as ee,Et as te,Q as ne,et as _,nt as re,tt as ie}from"./index-CN0G8uYY.js";import"./use-monaco-theme-DHczXLMb.js";import"./use-inline-blame-BF8Y1KfV.js";import{DiffViewer as ae}from"./diff-viewer-BtLiSpqe.js";var v=e(t(),1),y=`ppm:branch-review`,b=`${y}:recent`,x=20;function oe(e,t,n){return`${y}:${e}:${t}:${n}`}function S(e,t){return e[t.path]===t.blob}function se(e,t){let n={...e};return S(e,t)?delete n[t.path]:n[t.path]=t.blob,n}function C(e,t,n){if(!n)return{};let r={...e};for(let e of t)r[e.path]=e.blob;return r}function w(e,t){return t.reduce((t,n)=>t+(S(e,n)?1:0),0)}function T(e,t){let n=new Set(t.map(e=>e.path)),r={};for(let[t,i]of Object.entries(e))n.has(t)&&(r[t]=i);return r}function E(e){return e.find(e=>!e.binary)??e[0]??null}function ce(e,t,n){if(t.length===0)return null;let r=n?t.findIndex(e=>e.path===n)+1:0;for(let n=0;n<t.length;n++){let i=t[(r+n)%t.length];if(i&&!S(e,i))return i}return null}function le(e){try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n))typeof t==`string`&&(r[e]=t);return r}catch{return{}}}function D(e,t,n=x){let r=[t,...e.filter(e=>e!==t)];return{recent:r.slice(0,n),evicted:r.slice(n)}}function O(){try{let e=JSON.parse(localStorage.getItem(b)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function k(e,t){try{if(Object.keys(t).length===0){localStorage.removeItem(e);let t=O().filter(t=>t!==e);localStorage.setItem(b,JSON.stringify(t));return}localStorage.setItem(e,JSON.stringify(t));let{recent:n,evicted:r}=D(O(),e);for(let e of r)localStorage.removeItem(e);localStorage.setItem(b,JSON.stringify(n))}catch{}}var A=n(),j={M:`text-warning`,A:`text-success`,D:`text-error`,R:`text-primary`,C:`text-accent-2`,T:`text-text-3`};function M({children:e}){return(0,A.jsx)(`span`,{dir:`rtl`,className:`truncate text-left min-w-0 flex-1`,children:(0,A.jsx)(`bdi`,{children:e})})}function N(e){let{node:t,depth:n,byPath:i,reviewed:a,selectedPath:o,collapsed:c,onToggleCollapse:l,onSelect:d,onToggleReviewed:f}=e,p=t.file?i.get(t.fullPath):void 0;if(!p){let i=c.has(t.fullPath);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,"data-testid":`branch-review-folder`,className:`w-full flex items-center gap-1 px-2 py-1 text-xs min-h-11 md:min-h-0 hover:bg-surface-hover text-left`,style:{paddingLeft:n*14+8},onClick:()=>l(t.fullPath),children:[i?(0,A.jsx)(s,{className:`size-3 shrink-0`}):(0,A.jsx)(r,{className:`size-3 shrink-0`}),(0,A.jsx)(`span`,{className:`truncate text-text-2`,children:t.name})]}),!i&&t.children.map(t=>(0,A.jsx)(N,{...e,node:t,depth:n+1},t.fullPath))]})}let h=S(a,p),g=o===p.path;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 pr-2 py-1 text-xs cursor-pointer border-l-2 min-h-11 md:min-h-0 hover:bg-surface-hover ${g?`bg-primary/10 border-primary`:`border-transparent`}`,style:{paddingLeft:n*14+6},onClick:()=>d(p.path),"aria-current":g?`true`:void 0,"data-testid":`branch-review-file`,"data-path":p.path,"data-selected":g?`true`:`false`,"data-reviewed":h?`true`:`false`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":h?`Mark ${p.path} unreviewed`:`Mark ${p.path} reviewed`,"data-testid":`branch-review-check`,className:`size-11 md:size-4 shrink-0 flex items-center justify-center`,onClick:e=>{e.stopPropagation(),f(p)},children:(0,A.jsx)(`span`,{"data-testid":`branch-review-check-box`,className:`size-4 rounded border flex items-center justify-center ${h?`bg-primary border-primary text-primary-foreground`:`border-border`}`,children:h&&(0,A.jsx)(u,{className:`size-3`})})}),(0,A.jsx)(m,{name:t.name,className:`size-3.5 shrink-0`}),(0,A.jsx)(M,{children:t.name}),(0,A.jsx)(`span`,{className:`shrink-0 font-mono ${j[p.status]}`,children:p.status}),p.binary?(0,A.jsx)(`span`,{className:`shrink-0 text-text-3 italic`,children:`bin`}):(0,A.jsxs)(`span`,{className:`shrink-0 tabular-nums text-[10px]`,children:[(0,A.jsxs)(`span`,{className:`text-success`,children:[`+`,p.additions]}),` `,(0,A.jsxs)(`span`,{className:`text-error`,children:[`-`,p.deletions]})]})]})}function ue(e,t){let n=e.filter(e=>!e.remote&&e.name!==t);return n.find(e=>e.name===`main`)?.name??n.find(e=>e.name===`master`)?.name??n[0]?.name??``}function P({metadata:e}){let t=e?.projectName,n=te(t),r=f(),[s,u]=(0,v.useState)([]),[m,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,D]=(0,v.useState)(null),[O,j]=(0,v.useState)(null),[P,F]=(0,v.useState)({}),[de,I]=(0,v.useState)(new Set),[L,R]=(0,v.useState)(!1),[z,B]=(0,v.useState)(null),[V,H]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!t||!n.repo)return;let e=!1;return d.get(n.gitUrl(`/branches`)).then(t=>{if(e)return;u(t);let n=t.find(e=>e.current)?.name;x(e=>e||n||``),y(e=>e||ue(t,n))}).catch(t=>!e&&B(t instanceof Error?t.message:`Could not list branches`)),()=>{e=!0}},[t,n]);let U=(0,v.useRef)(null),W=(0,v.useCallback)(async()=>{if(!t||!n.repo||!m||!b)return;U.current?.abort();let e=new AbortController;U.current=e,R(!0),B(null);try{let t=new URLSearchParams({base:m,head:b}),r=await d.get(n.gitUrl(`/branch-diff?${t}`),{signal:e.signal});if(e.signal.aborted)return;D(r),j(e=>e&&r.files.some(t=>t.path===e)?e:E(r.files)?.path??null)}catch(t){if(e.signal.aborted)return;D(null),B(t instanceof Error?t.message:`Could not compare these branches`)}finally{e.signal.aborted||R(!1)}},[t,n,m,b]);(0,v.useEffect)(()=>(W(),()=>U.current?.abort()),[W]);let G=t&&m&&b?oe(t,m,b):null;(0,v.useEffect)(()=>{I(new Set)},[G]),(0,v.useEffect)(()=>{F(G?le(G):{})},[G]);let K=S&&S.base===m&&S.head===b?S:null;(0,v.useEffect)(()=>{!G||!K||F(e=>{let t=T(e,K.files);return Object.keys(t).length!==Object.keys(e).length&&k(G,t),t})},[G,K]);let q=(0,v.useCallback)(e=>{F(e),G&&k(G,e)},[G]),J=K?.files??[],Y=(0,v.useMemo)(()=>new Map(J.map(e=>[e.path,e])),[J]),X=(0,v.useMemo)(()=>w(P,J),[P,J]),fe=(0,v.useMemo)(()=>ee(ne(J.map(e=>({path:e.path,status:e.status===`T`?`M`:e.status})))),[J]),Z=O?Y.get(O)??null:null,Q=(0,v.useCallback)(()=>{let e=ce(P,J,O);e&&(j(e.path),H(!1))},[P,J,O]);if(n.noRepo)return(0,A.jsx)(_,{onReload:n.reload});if(n.needsPick)return(0,A.jsx)(re,{repos:n.repos,onChoose:n.choose});let $=(0,A.jsx)(g,{className:`h-full`,children:(0,A.jsxs)(`div`,{className:`py-1`,children:[J.length===0&&!L&&(0,A.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-text-3`,children:z?`—`:`These branches have identical trees.`}),fe.map(e=>(0,A.jsx)(N,{node:e,depth:0,byPath:Y,reviewed:P,selectedPath:O,collapsed:de,onToggleCollapse:e=>I(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:e=>{j(e),H(!1)},onToggleReviewed:e=>q(se(P,e))},e.fullPath)),!!K?.omitted&&(0,A.jsxs)(`div`,{className:`px-3 py-3 text-center text-xs text-text-3`,children:[K.omitted.toLocaleString(),` more `,K.omitted===1?`file`:`files`,` not listed.`]})]})});return(0,A.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-bg`,children:[n.isNested&&n.repo&&(0,A.jsx)(ie,{repo:n.repo,repos:n.repos,onChoose:n.choose}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border shrink-0 flex-wrap`,children:[(0,A.jsx)(`select`,{value:m,onChange:e=>y(e.target.value),"aria-label":`Base branch`,"data-testid":`branch-review-base`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:s.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsx)(l,{className:`size-3.5 text-text-3 shrink-0`}),(0,A.jsx)(`select`,{value:b,onChange:e=>x(e.target.value),"aria-label":`Branch to review`,"data-testid":`branch-review-head`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:s.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-text-2 tabular-nums`,"data-testid":`branch-review-progress`,children:[X,`/`,J.length,` reviewed`]}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:X===J.length&&J.length>0?`Clear all`:`Mark all reviewed`,disabled:J.length===0,onClick:()=>q(C(P,J,X!==J.length)),children:(0,A.jsx)(o,{className:`size-3.5`})}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:`Reload`,onClick:()=>void W(),children:(0,A.jsx)(i,{className:L?`animate-spin`:``})})]})]}),z&&(0,A.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-destructive bg-destructive/10 shrink-0`,children:z}),(0,A.jsxs)(`div`,{className:`flex-1 flex min-h-0`,children:[!r&&(0,A.jsx)(`div`,{className:`w-72 shrink-0 border-r border-border flex flex-col min-h-0`,children:$}),(0,A.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:Z?(0,A.jsx)(ae,{metadata:{filePath:n.projectFile(Z.path),projectName:t,ref1:K?.mergeBase,ref2:K?.headCommit}},`${Z.path}:${K?.mergeBase}:${K?.headCommit}`):(0,A.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-3`,children:L?(0,A.jsx)(c,{className:`size-4 animate-spin`}):`Nothing to review.`})})]}),r&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border p-2 shrink-0`,children:[(0,A.jsxs)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:()=>H(!0),children:[(0,A.jsx)(a,{className:`size-4`}),J.length,` files`]}),(0,A.jsx)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:Q,children:`Next unreviewed`})]}),r&&(0,A.jsx)(h,{open:V,onClose:()=>H(!1),children:(0,A.jsx)(`div`,{className:`max-h-[70vh] overflow-hidden flex flex-col`,children:$})}),!r&&Z&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2 py-1 shrink-0`,children:[(0,A.jsx)(M,{children:Z.path}),(0,A.jsx)(p,{variant:`ghost`,size:`xs`,onClick:Q,children:`Next unreviewed`})]})]})}export{P as BranchReviewTab};
|