mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 18:43:16 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd5f95760f |
No files matched your search
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"detector": {
|
||||
"ignoreRules": [],
|
||||
"ignoreFiles": [],
|
||||
"ignoreValues": [
|
||||
{
|
||||
"rule": "gradient-text",
|
||||
"value": "*",
|
||||
"files": ["src/features/agents/Session.module.css"],
|
||||
"createdAt": "2026-11-24T14:58:12.514Z",
|
||||
"reason": "agent: .shimmer is an animated in-progress sweep on running-step labels (commit 18b286e7e, comment documents intent), not decorative gradient text"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,557 @@
|
||||
{
|
||||
"schemaVersion": 2,
|
||||
"generatedAt": "2026-11-24T15:06:05+00:00",
|
||||
"title": "Design System: OpenIDEA",
|
||||
"extensions": {
|
||||
"colorMeta": {
|
||||
"workbench-blue": {
|
||||
"role": "primary",
|
||||
"displayName": "Workbench Blue",
|
||||
"canonical": "#3871e1",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.073 262)",
|
||||
"oklch(25% 0.121 262)",
|
||||
"oklch(35% 0.17 262)",
|
||||
"oklch(48% 0.17 262)",
|
||||
"oklch(60% 0.17 262)",
|
||||
"oklch(72% 0.136 262)",
|
||||
"oklch(84% 0.078 262)",
|
||||
"oklch(95% 0.024 262)"
|
||||
]
|
||||
},
|
||||
"link-blue": {
|
||||
"role": "primary",
|
||||
"displayName": "Link Blue",
|
||||
"canonical": "#2f5eb9",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.064 262)",
|
||||
"oklch(25% 0.107 262)",
|
||||
"oklch(35% 0.15 262)",
|
||||
"oklch(48% 0.15 262)",
|
||||
"oklch(60% 0.15 262)",
|
||||
"oklch(72% 0.12 262)",
|
||||
"oklch(84% 0.069 262)",
|
||||
"oklch(95% 0.021 262)"
|
||||
]
|
||||
},
|
||||
"selection-wash": {
|
||||
"role": "primary",
|
||||
"displayName": "Selection Wash",
|
||||
"canonical": "#d0dffe",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.034 262)",
|
||||
"oklch(25% 0.057 262)",
|
||||
"oklch(35% 0.08 262)",
|
||||
"oklch(48% 0.08 262)",
|
||||
"oklch(60% 0.08 262)",
|
||||
"oklch(72% 0.064 262)",
|
||||
"oklch(84% 0.037 262)",
|
||||
"oklch(95% 0.011 262)"
|
||||
]
|
||||
},
|
||||
"tab-wash": {
|
||||
"role": "primary",
|
||||
"displayName": "Tab Wash",
|
||||
"canonical": "#e3ebfe",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.026 262)",
|
||||
"oklch(25% 0.043 262)",
|
||||
"oklch(35% 0.06 262)",
|
||||
"oklch(48% 0.06 262)",
|
||||
"oklch(60% 0.06 262)",
|
||||
"oklch(72% 0.048 262)",
|
||||
"oklch(84% 0.027 262)",
|
||||
"oklch(95% 0.009 262)"
|
||||
]
|
||||
},
|
||||
"danger": {
|
||||
"role": "status",
|
||||
"displayName": "Danger",
|
||||
"canonical": "#c54e58",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.064 18)",
|
||||
"oklch(25% 0.107 18)",
|
||||
"oklch(35% 0.15 18)",
|
||||
"oklch(48% 0.15 18)",
|
||||
"oklch(60% 0.15 18)",
|
||||
"oklch(72% 0.12 18)",
|
||||
"oklch(84% 0.069 18)",
|
||||
"oklch(95% 0.021 18)"
|
||||
]
|
||||
},
|
||||
"warning": {
|
||||
"role": "status",
|
||||
"displayName": "Warning",
|
||||
"canonical": "#a56906",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.056 70)",
|
||||
"oklch(25% 0.093 70)",
|
||||
"oklch(35% 0.13 70)",
|
||||
"oklch(48% 0.13 70)",
|
||||
"oklch(60% 0.13 70)",
|
||||
"oklch(72% 0.104 70)",
|
||||
"oklch(84% 0.059 70)",
|
||||
"oklch(95% 0.019 70)"
|
||||
]
|
||||
},
|
||||
"success": {
|
||||
"role": "status",
|
||||
"displayName": "Success",
|
||||
"canonical": "#338555",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.047 152)",
|
||||
"oklch(25% 0.079 152)",
|
||||
"oklch(35% 0.11 152)",
|
||||
"oklch(48% 0.11 152)",
|
||||
"oklch(60% 0.11 152)",
|
||||
"oklch(72% 0.088 152)",
|
||||
"oklch(84% 0.05 152)",
|
||||
"oklch(95% 0.016 152)"
|
||||
]
|
||||
},
|
||||
"frame-grey": {
|
||||
"role": "neutral",
|
||||
"displayName": "Frame Grey",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"island-white": {
|
||||
"role": "neutral",
|
||||
"displayName": "Island White",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"raised-paper": {
|
||||
"role": "neutral",
|
||||
"displayName": "Raised Paper",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink-secondary": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink Secondary",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink-muted": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink Muted",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink-faint": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink Faint",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"hairline": {
|
||||
"role": "neutral",
|
||||
"displayName": "Hairline",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"control-edge": {
|
||||
"role": "neutral",
|
||||
"displayName": "Control Edge",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"frame-grey-dark": {
|
||||
"role": "neutral",
|
||||
"displayName": "Frame Grey (Dark)",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"island-dark": {
|
||||
"role": "neutral",
|
||||
"displayName": "Island (Dark)",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink-dark": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink (Dark)",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink-strong-dark": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink Strong (Dark)",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"ink-muted-dark": {
|
||||
"role": "neutral",
|
||||
"displayName": "Ink Muted (Dark)",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"control-edge-dark": {
|
||||
"role": "neutral",
|
||||
"displayName": "Control Edge (Dark)",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.005 265)",
|
||||
"oklch(25% 0.009 265)",
|
||||
"oklch(35% 0.012 265)",
|
||||
"oklch(48% 0.012 265)",
|
||||
"oklch(60% 0.012 265)",
|
||||
"oklch(72% 0.01 265)",
|
||||
"oklch(84% 0.005 265)",
|
||||
"oklch(95% 0.002 265)"
|
||||
]
|
||||
},
|
||||
"selection-wash-dark": {
|
||||
"role": "primary",
|
||||
"displayName": "Selection Wash (Dark)",
|
||||
"canonical": "#2a4371",
|
||||
"tonalRamp": [
|
||||
"oklch(15% 0.034 262)",
|
||||
"oklch(25% 0.057 262)",
|
||||
"oklch(35% 0.08 262)",
|
||||
"oklch(48% 0.08 262)",
|
||||
"oklch(60% 0.08 262)",
|
||||
"oklch(72% 0.064 262)",
|
||||
"oklch(84% 0.037 262)",
|
||||
"oklch(95% 0.011 262)"
|
||||
]
|
||||
}
|
||||
},
|
||||
"typographyMeta": {
|
||||
"title": {
|
||||
"displayName": "Title",
|
||||
"purpose": "Tool window titles, section headers, dialog titles; weight 600 is the main emphasis."
|
||||
},
|
||||
"body": {
|
||||
"displayName": "Body",
|
||||
"purpose": "Default UI text, menus, rows, buttons."
|
||||
},
|
||||
"label": {
|
||||
"displayName": "Label",
|
||||
"purpose": "Secondary metadata, chips, status bar, table cells; the most-used size."
|
||||
},
|
||||
"label-tiny": {
|
||||
"displayName": "Label Tiny",
|
||||
"purpose": "Stripe labels, counters, badges."
|
||||
},
|
||||
"input-large": {
|
||||
"displayName": "Input Large",
|
||||
"purpose": "Search Everywhere and other large query fields."
|
||||
},
|
||||
"code": {
|
||||
"displayName": "Code",
|
||||
"purpose": "Editor, console, terminal and every monospace preview; size and weights are user settings."
|
||||
}
|
||||
},
|
||||
"shadows": [
|
||||
{
|
||||
"name": "shadow-popup",
|
||||
"value": "0 6px 20px rgba(0, 0, 0, 0.12)",
|
||||
"purpose": "Popups, menus, completion, floating toolbar (Light; Dark uses 0.45 alpha)."
|
||||
},
|
||||
{
|
||||
"name": "shadow-dialog",
|
||||
"value": "0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 10px 24px rgba(0, 0, 0, 0.1), 0 24px 72px rgba(0, 0, 0, 0.2)",
|
||||
"purpose": "Window-style shadow for dialogs (Light)."
|
||||
},
|
||||
{
|
||||
"name": "shadow-tooltip",
|
||||
"value": "0 4px 12px rgba(0, 0, 0, 0.12)",
|
||||
"purpose": "Hover tooltips (Light)."
|
||||
},
|
||||
{
|
||||
"name": "shadow-balloon",
|
||||
"value": "0 8px 24px rgba(0, 0, 0, 0.14)",
|
||||
"purpose": "Notification balloons (Light)."
|
||||
}
|
||||
],
|
||||
"motion": [
|
||||
{
|
||||
"name": "ease",
|
||||
"value": "cubic-bezier(0.2, 0, 0, 1)",
|
||||
"purpose": "Default easing for every state transition."
|
||||
},
|
||||
{
|
||||
"name": "dur-fast",
|
||||
"value": "80ms",
|
||||
"purpose": "Hover, press and focus changes on controls."
|
||||
},
|
||||
{
|
||||
"name": "dur",
|
||||
"value": "140ms",
|
||||
"purpose": "Standard transitions such as popup fades."
|
||||
},
|
||||
{
|
||||
"name": "dur-slow",
|
||||
"value": "220ms",
|
||||
"purpose": "Upper bound for any state transition."
|
||||
}
|
||||
],
|
||||
"density": [
|
||||
{
|
||||
"name": "default",
|
||||
"value": "rows 24px, fields/buttons 28px, titlebar 40px, tab bar 38px, status bar 30px, island gap 6px, island radius 10px"
|
||||
},
|
||||
{
|
||||
"name": "compact",
|
||||
"value": "rows 22px, fields/buttons 24px, titlebar/headers 32px, tab bar 32px, status bar 24px, island gap 4px, island radius 8px, chrome text -1px"
|
||||
}
|
||||
]
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"name": "Primary Button",
|
||||
"kind": "button",
|
||||
"refersTo": "button-primary",
|
||||
"description": "The one default action in a dialog or form.",
|
||||
"html": "<button class=\"ds-btn ds-btn-primary\">OK</button>",
|
||||
"css": ".ds-btn { display:inline-flex; align-items:center; justify-content:center; height:var(--h-button,28px); min-width:72px; padding:0 16px; border:0; border-radius:var(--radius-control,4px); font-family:var(--font-ui); font-size:var(--fs-ui,13px); line-height:1; cursor:default; transition:background var(--dur-fast,80ms) var(--ease), color var(--dur-fast,80ms) var(--ease), box-shadow var(--dur-fast,80ms) var(--ease); } .ds-btn:focus-visible { outline:2px solid var(--focus-ring,#3871e1); outline-offset:1px; } .ds-btn-primary { background:var(--bg-button-primary,#3871e1); color:var(--fg-button-primary,#fff); } .ds-btn-primary:hover { background:var(--bg-button-primary-hover,#3366cc); }"
|
||||
},
|
||||
{
|
||||
"name": "Secondary Button",
|
||||
"kind": "button",
|
||||
"refersTo": "button-secondary",
|
||||
"description": "Every other dialog action: Cancel, Apply, Browse.",
|
||||
"html": "<button class=\"ds-btn ds-btn-secondary\">Cancel</button>",
|
||||
"css": ".ds-btn { display:inline-flex; align-items:center; justify-content:center; height:var(--h-button,28px); min-width:72px; padding:0 16px; border:0; border-radius:var(--radius-control,4px); font-family:var(--font-ui); font-size:var(--fs-ui,13px); line-height:1; cursor:default; transition:background var(--dur-fast,80ms) var(--ease), box-shadow var(--dur-fast,80ms) var(--ease); } .ds-btn:focus-visible { outline:2px solid var(--focus-ring,#3871e1); outline-offset:1px; } .ds-btn-secondary { background:var(--bg-button,#fff); color:var(--fg-strong,#000); box-shadow:inset 0 0 0 1px var(--border-button,#d1d3d9); } .ds-btn-secondary:hover { background:color-mix(in srgb, var(--bg-button,#fff) 94%, var(--fg-strong,#000)); }"
|
||||
},
|
||||
{
|
||||
"name": "Ghost Button",
|
||||
"kind": "button",
|
||||
"refersTo": "button-ghost",
|
||||
"description": "Low-emphasis text actions in headers and inline rows.",
|
||||
"html": "<button class=\"ds-btn-ghost\">Show all</button>",
|
||||
"css": ".ds-btn-ghost { display:inline-flex; align-items:center; height:var(--h-button,28px); padding:0 8px; border:0; background:transparent; border-radius:var(--radius-control,4px); color:var(--fg-secondary,#5f6269); font-family:var(--font-ui); font-size:var(--fs-ui,13px); cursor:default; transition:background var(--dur-fast,80ms) var(--ease), color var(--dur-fast,80ms) var(--ease); } .ds-btn-ghost:hover { background:var(--bg-toolbar-hover,#00000012); color:var(--fg-strong,#000); } .ds-btn-ghost:active { background:var(--bg-toolbar-pressed,#00000020); } .ds-btn-ghost:focus-visible { outline:2px solid var(--focus-ring,#3871e1); outline-offset:1px; }"
|
||||
},
|
||||
{
|
||||
"name": "Toolbar Icon Button",
|
||||
"kind": "button",
|
||||
"refersTo": "icon-button",
|
||||
"description": "Toolbar and tool window header actions; frameless at rest, toggles show Selection Wash.",
|
||||
"html": "<div class=\"ds-iconbar\"><button class=\"ds-icon-btn\" aria-label=\"Refresh\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"><path d=\"M13 8a5 5 0 1 1-1.46-3.54M13 3v2.5h-2.5\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg></button><button class=\"ds-icon-btn\" aria-label=\"Show options\" aria-pressed=\"true\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"><path d=\"M2.5 4.5h11M2.5 8h11M2.5 11.5h11\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\"/></svg></button></div>",
|
||||
"css": ".ds-iconbar { display:flex; gap:2px; } .ds-icon-btn { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; padding:0; border:0; background:transparent; border-radius:var(--radius-toolbar-button,6px); color:var(--fg-muted,#6c707e); cursor:default; transition:background var(--dur-fast,80ms) var(--ease), color var(--dur-fast,80ms) var(--ease); } .ds-icon-btn:hover { background:var(--bg-toolbar-hover,#00000012); color:var(--fg-strong,#000); } .ds-icon-btn:active { background:var(--bg-toolbar-pressed,#00000020); } .ds-icon-btn[aria-pressed=\"true\"] { background:var(--bg-toolbar-selected,#d0dffe); color:var(--fg-strong,#000); } .ds-icon-btn:focus-visible { outline:2px solid var(--focus-ring,#3871e1); outline-offset:-2px; }"
|
||||
},
|
||||
{
|
||||
"name": "Text Field",
|
||||
"kind": "input",
|
||||
"refersTo": "input",
|
||||
"description": "Framed text field; the frame doubles in Workbench Blue on focus.",
|
||||
"html": "<input class=\"ds-input\" placeholder=\"Project name\" />",
|
||||
"css": ".ds-input { height:var(--h-field,28px); padding:0 8px; border:0; appearance:none; border-radius:var(--radius-control,4px); background:var(--bg-field,#fff); color:var(--fg-strong,#000); font-family:var(--font-ui); font-size:var(--fs-ui,13px); outline:none; box-shadow:inset 0 0 0 1px var(--border-button,#d1d3d9); transition:box-shadow var(--dur-fast,80ms) var(--ease); } .ds-input::placeholder { color:var(--fg-faint,#9fa2a8); } .ds-input:focus { box-shadow:inset 0 0 0 1px var(--focus-ring,#3871e1), 0 0 0 1px var(--focus-ring,#3871e1); }"
|
||||
},
|
||||
{
|
||||
"name": "Chip",
|
||||
"kind": "chip",
|
||||
"refersTo": "chip",
|
||||
"description": "Flat read-only fact or picker trigger, sized like the toolbar widgets.",
|
||||
"html": "<button class=\"ds-chip\"><svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\"><circle cx=\"5\" cy=\"4\" r=\"1.5\" stroke=\"currentColor\"/><circle cx=\"5\" cy=\"12\" r=\"1.5\" stroke=\"currentColor\"/><circle cx=\"11\" cy=\"6\" r=\"1.5\" stroke=\"currentColor\"/><path d=\"M5 5.5v5M11 7.5c0 2-2 2.5-6 3\" stroke=\"currentColor\"/></svg><span>main</span></button>",
|
||||
"css": ".ds-chip { display:inline-flex; align-items:center; gap:var(--space-1,4px); height:22px; padding:0 6px; border:0; background:transparent; border-radius:var(--radius-toolbar-button,6px); color:var(--fg-secondary,#5f6269); font-family:var(--font-ui); font-size:var(--fs-small,12px); line-height:1; cursor:default; transition:background var(--dur-fast,80ms) var(--ease); } .ds-chip svg { color:var(--fg-muted,#6c707e); } .ds-chip:hover { background:var(--bg-toolbar-hover,#00000012); } .ds-chip:focus-visible { outline:2px solid var(--focus-ring,#3871e1); outline-offset:-2px; }"
|
||||
},
|
||||
{
|
||||
"name": "Tree Rows",
|
||||
"kind": "custom",
|
||||
"refersTo": "list-row-selected",
|
||||
"description": "24px rows with an inset rounded selection wash; unfocused selection turns neutral.",
|
||||
"html": "<div class=\"ds-tree\" tabindex=\"0\"><div class=\"ds-row\">src</div><div class=\"ds-row ds-row-sel\">main.tsx</div><div class=\"ds-row\">workbench</div></div>",
|
||||
"css": ".ds-tree { width:220px; padding:4px var(--tree-inset,6px); background:var(--bg-island,#fff); border-radius:var(--island-radius,10px); font-family:var(--font-ui); font-size:var(--fs-ui,13px); color:var(--fg,#000); outline:none; } .ds-row { height:var(--h-row,24px); display:flex; align-items:center; padding:0 8px; border-radius:var(--radius-row,4px); } .ds-row:hover { background:var(--bg-tree-hover,#0000000a); } .ds-row-sel, .ds-row-sel:hover { background:var(--bg-tree-selected-inactive,#e9eaee); } .ds-tree:focus .ds-row-sel { background:var(--bg-tree-selected,#d0dffe); }"
|
||||
},
|
||||
{
|
||||
"name": "Island on Frame",
|
||||
"kind": "card",
|
||||
"description": "The signature layout unit: rounded islands 6px apart on the grey frame, flat at rest.",
|
||||
"html": "<div class=\"ds-frame\"><div class=\"ds-island ds-side\"><div class=\"ds-head\">Project</div></div><div class=\"ds-island ds-main\"><code>fn main() {}</code></div></div>",
|
||||
"css": ".ds-frame { display:flex; gap:var(--island-gap,6px); padding:var(--island-gap,6px); background:var(--bg-frame,#e9eaee); height:160px; } .ds-island { background:var(--bg-island,#fff); border-radius:var(--island-radius,10px); } .ds-side { width:140px; } .ds-main { flex:1; padding:12px; font-family:var(--font-mono); font-size:var(--fs-code,13px); color:var(--fg-editor,#080808); } .ds-head { height:40px; display:flex; align-items:center; padding:0 12px; font-family:var(--font-ui); font-size:var(--fs-ui,13px); font-weight:600; color:var(--fg-strong,#000); }"
|
||||
},
|
||||
{
|
||||
"name": "Tooltip",
|
||||
"kind": "custom",
|
||||
"refersTo": "tooltip",
|
||||
"description": "Floating hover help: one of the few surfaces allowed a shadow.",
|
||||
"html": "<div class=\"ds-tooltip\">Run 'main' <span class=\"ds-kbd\">⌃R</span></div>",
|
||||
"css": ".ds-tooltip { display:inline-flex; gap:8px; align-items:center; padding:6px 10px; border-radius:var(--radius-tooltip,6px); background:var(--bg-tooltip,#fff); color:var(--fg-tooltip,#000); border:1px solid var(--border-tooltip,#d1d3d9); box-shadow:var(--shadow-tooltip,0 4px 12px rgba(0,0,0,.12)); font-family:var(--font-ui); font-size:var(--fs-ui,13px); } .ds-kbd { font-family:var(--font-keys); color:var(--fg-muted,#6c707e); }"
|
||||
}
|
||||
],
|
||||
"narrative": {
|
||||
"northStar": "The Quiet Workbench",
|
||||
"overview": "The interface is a workbench, not a showroom. Code, trees, logs and diffs are the work. The chrome around them stays quiet, so the eye goes to the content and a long session stays calm.\n\nThe visual language is the JetBrains new UI in its **Islands** form, and this document records it rather than inventing one. The tokens in `src/styles/tokens.css` take their values from the Islands Light and Islands Dark theme JSON and editor schemes, at 100% zoom. Component metrics follow the matching IntelliJ theme keys (a Swing `arc` is a diameter, so the CSS radius is half of it), and component CSS names the key it follows. Behaviour follows IDEA as well, from focus and selection to dialogs and drag and drop. Users bring their JetBrains muscle memory, so a layout, metric or state that looks or behaves differently from IDEA counts as a bug, not a style choice.\n\nEvery panel sits on a grey frame as a rounded island (10px corners, 6px gaps). Depth comes from that tonal step, not from decoration. The density is that of a professional desktop tool: 13px UI text, 24px rows, 28px controls, with a compact mode that tightens all of them.\n\nThe tokens are a theming contract, not one palette. The built-in themes are Islands Light (the default), Islands Dark, High Contrast, Solarized Light and Solarized Dark. Users can also change the accent colour, give tool windows a different background from the editor, set a background image, use contrast scrollbars, or adjust colours for red-green vision deficiency. Imported IntelliJ themes and plugin themes set the same tokens at runtime. A component that looks right only in Islands Light is broken.\n\nExpression is kept to precise details: one blue accent, controls with no frame until they're hovered, hairline frames on fields and secondary buttons, and fast state transitions. Three things are rejected outright. It must not look like a web app: no big rounded cards, airy marketing whitespace, decorative gradients or illustrations. It has no second accent colour. And it has no eye-catching animation.",
|
||||
"keyCharacteristics": [
|
||||
"JetBrains new UI (Islands): metrics and behaviour follow IntelliJ's theme keys.",
|
||||
"Grey frame, rounded content islands, tonal layering only.",
|
||||
"A single accent (Workbench Blue) for primary actions, focus, selection and the active tool window.",
|
||||
"High density on a 4px grid. Compact mode is a first-class variant.",
|
||||
"Controls are quiet at rest: toolbar buttons and chips have no frame until hover.",
|
||||
"Semantic colour (status, VCS, diff, syntax) carries meaning and is never decoration.",
|
||||
"Every colour and metric is a token in `src/styles/tokens.css`. Tokens are the public theme API for plugins."
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"name": "The IDEA Reference Rule",
|
||||
"body": "When tokens and this document don't answer a question, the answer is what IntelliJ IDEA does in the Islands theme, with the same metric and the same state behaviour. Take the value from the theme key, add it as a token, and name the key in a CSS comment.",
|
||||
"section": "overview"
|
||||
},
|
||||
{
|
||||
"name": "The One Accent Rule",
|
||||
"body": "Workbench Blue is the only accent. Every other hue in the UI belongs to a functional vocabulary (status, VCS, diff, syntax, charts) and means something specific. If a new colour has no meaning to carry, it doesn't ship.",
|
||||
"section": "colors"
|
||||
},
|
||||
{
|
||||
"name": "The Token Only Rule",
|
||||
"body": "Components never contain hex, `rgb()` or named colour literals. A new colour is a new token with a value in every theme variant, named for its purpose. Run `pnpm gen:theme-docs` afterwards.",
|
||||
"section": "colors"
|
||||
},
|
||||
{
|
||||
"name": "The Flat Scale Rule",
|
||||
"body": "The UI uses 11, 12, 13 and 15px, and nothing in between. Emphasis is weight 600 or a stronger ink colour, not a bigger size.",
|
||||
"section": "typography"
|
||||
},
|
||||
{
|
||||
"name": "The User Owns Size Rule",
|
||||
"body": "Sizes are tokens because users change them (UI font size, editor font, compact mode's -1px chrome offset). Never hard-code a font size.",
|
||||
"section": "typography"
|
||||
},
|
||||
{
|
||||
"name": "The Flat at Rest Rule",
|
||||
"body": "No docked panel, island, row or control gets a shadow. A shadow means \"this floats over the workbench and will go away\". Depth inside the layout is only ever a tonal step.",
|
||||
"section": "elevation"
|
||||
}
|
||||
],
|
||||
"dos": [
|
||||
"**Do** match IntelliJ IDEA's Islands theme for any metric or state that isn't tokenized yet. Take the value from the theme key and name the key in a CSS comment (for example `Button.arc 8 (radius 4)`).",
|
||||
"**Do** take every colour and metric from `src/styles/tokens.css`, and add a token for every theme variant when you need a new one.",
|
||||
"**Do** separate regions with a tonal step (frame against island) or a 1px hairline, never with a shadow.",
|
||||
"**Do** keep toolbar buttons and chips without a frame at rest, with the toolbar hover wash over the full hit target.",
|
||||
"**Do** draw frames and focus rings as inset box-shadows (1px at rest, doubled on focus), and keep the 2px Workbench Blue focus outline visible.",
|
||||
"**Do** check every surface in Islands Light and Islands Dark at least, as the contribution guidelines require. Check High Contrast and compact density whenever a change touches colour or metrics.",
|
||||
"**Do** keep transitions to state changes: 80ms (`--dur-fast`), 140ms (`--dur`) or at most 220ms (`--dur-slow`) with `--ease`, and none under reduced motion.",
|
||||
"**Do** use icons from the `src/ui/icons.tsx` registry, drawn in `currentColor`."
|
||||
],
|
||||
"donts": [
|
||||
"**Don't** make it look like a web app: no large rounded cards, airy marketing whitespace, decorative gradients, hero illustrations or corners above 10px. The project wash is the one gradient in the chrome. Progress shimmer counts as activity, not decoration.",
|
||||
"**Don't** invent a look or behaviour where IDEA already has one. A custom variant of an IDEA pattern breaks muscle memory.",
|
||||
"**Don't** add a second accent. Any hue other than Workbench Blue must carry status, VCS, diff, syntax or chart meaning.",
|
||||
"**Don't** add attention-seeking animation: no bounces, no staggered entrances, and no state transition over 220ms. Looping animation is only for activity that is really happening (spinners, progress, loading shimmer, a running pulse, the caret), never decoration.",
|
||||
"**Don't** put shadows on docked panels, islands, rows or controls.",
|
||||
"**Don't** use sizes off the 11/12/13/15px scale, or hard-code a font size users can change.",
|
||||
"**Don't** use hex, `rgb()` or named colours in component CSS or inline styles.",
|
||||
"**Don't** use emoji as icons or decoration, or inline ad-hoc SVG in a feature."
|
||||
]
|
||||
}
|
||||
}
|
||||
Generated
-1
@@ -6762,7 +6762,6 @@ dependencies = [
|
||||
"webview2-com",
|
||||
"windows",
|
||||
"windows-sys 0.61.2",
|
||||
"wry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
---
|
||||
name: OpenIDEA
|
||||
description: The IDE you know, rebuilt in Rust.
|
||||
colors:
|
||||
workbench-blue: "#3871e1"
|
||||
link-blue: "#2f5eb9"
|
||||
frame-grey: "#e9eaee"
|
||||
island-white: "#ffffff"
|
||||
raised-paper: "#f7f8f9"
|
||||
ink: "#000000"
|
||||
ink-secondary: "#5f6269"
|
||||
ink-muted: "#6c707e"
|
||||
ink-faint: "#9fa2a8"
|
||||
hairline: "#e9eaee"
|
||||
control-edge: "#d1d3d9"
|
||||
selection-wash: "#d0dffe"
|
||||
tab-wash: "#e3ebfe"
|
||||
danger: "#c54e58"
|
||||
warning: "#a56906"
|
||||
success: "#338555"
|
||||
frame-grey-dark: "#26282c"
|
||||
island-dark: "#191a1c"
|
||||
ink-dark: "#d1d3d9"
|
||||
ink-strong-dark: "#dfe1e5"
|
||||
ink-muted-dark: "#8c8f95"
|
||||
control-edge-dark: "#40434a"
|
||||
selection-wash-dark: "#2a4371"
|
||||
typography:
|
||||
title:
|
||||
fontFamily: "Inter Variable, Inter, system-ui, -apple-system, sans-serif"
|
||||
fontSize: "13px"
|
||||
fontWeight: 600
|
||||
lineHeight: 1.4
|
||||
body:
|
||||
fontFamily: "Inter Variable, Inter, system-ui, -apple-system, sans-serif"
|
||||
fontSize: "13px"
|
||||
fontWeight: 400
|
||||
lineHeight: 1.4
|
||||
label:
|
||||
fontFamily: "Inter Variable, Inter, system-ui, -apple-system, sans-serif"
|
||||
fontSize: "12px"
|
||||
fontWeight: 400
|
||||
lineHeight: 1.4
|
||||
label-tiny:
|
||||
fontFamily: "Inter Variable, Inter, system-ui, -apple-system, sans-serif"
|
||||
fontSize: "11px"
|
||||
fontWeight: 400
|
||||
lineHeight: 1.4
|
||||
input-large:
|
||||
fontFamily: "Inter Variable, Inter, system-ui, -apple-system, sans-serif"
|
||||
fontSize: "15px"
|
||||
fontWeight: 400
|
||||
code:
|
||||
fontFamily: "JetBrains Mono, JetBrains Mono Variable, ui-monospace, Menlo, monospace"
|
||||
fontSize: "13px"
|
||||
fontWeight: 400
|
||||
lineHeight: "22px"
|
||||
fontFeature: "\"liga\" 0"
|
||||
rounded:
|
||||
small: "4px"
|
||||
control: "4px"
|
||||
row: "4px"
|
||||
selection: "5px"
|
||||
tab: "6px"
|
||||
toolbar-button: "6px"
|
||||
tooltip: "6px"
|
||||
popup: "8px"
|
||||
island: "10px"
|
||||
popup-large: "10px"
|
||||
dialog: "10px"
|
||||
spacing:
|
||||
space-0-5: "2px"
|
||||
space-1: "4px"
|
||||
space-1-5: "6px"
|
||||
space-2: "8px"
|
||||
space-3: "12px"
|
||||
space-4: "16px"
|
||||
components:
|
||||
button-primary:
|
||||
backgroundColor: "{colors.workbench-blue}"
|
||||
textColor: "{colors.island-white}"
|
||||
typography: "{typography.body}"
|
||||
rounded: "{rounded.control}"
|
||||
padding: "0 16px"
|
||||
height: "28px"
|
||||
button-secondary:
|
||||
backgroundColor: "{colors.island-white}"
|
||||
textColor: "{colors.ink}"
|
||||
typography: "{typography.body}"
|
||||
rounded: "{rounded.control}"
|
||||
padding: "0 16px"
|
||||
height: "28px"
|
||||
button-ghost:
|
||||
textColor: "{colors.ink-secondary}"
|
||||
typography: "{typography.body}"
|
||||
rounded: "{rounded.control}"
|
||||
padding: "0 8px"
|
||||
height: "28px"
|
||||
icon-button:
|
||||
textColor: "{colors.ink-muted}"
|
||||
rounded: "{rounded.toolbar-button}"
|
||||
size: "24px"
|
||||
icon-button-selected:
|
||||
backgroundColor: "{colors.selection-wash}"
|
||||
textColor: "{colors.ink}"
|
||||
rounded: "{rounded.toolbar-button}"
|
||||
size: "24px"
|
||||
input:
|
||||
backgroundColor: "{colors.island-white}"
|
||||
textColor: "{colors.ink}"
|
||||
typography: "{typography.body}"
|
||||
rounded: "{rounded.control}"
|
||||
padding: "0 8px"
|
||||
height: "28px"
|
||||
chip:
|
||||
textColor: "{colors.ink-secondary}"
|
||||
typography: "{typography.label}"
|
||||
rounded: "{rounded.toolbar-button}"
|
||||
padding: "0 6px"
|
||||
height: "22px"
|
||||
tooltip:
|
||||
backgroundColor: "{colors.island-white}"
|
||||
textColor: "{colors.ink}"
|
||||
typography: "{typography.body}"
|
||||
rounded: "{rounded.tooltip}"
|
||||
padding: "6px 10px"
|
||||
list-row-selected:
|
||||
backgroundColor: "{colors.selection-wash}"
|
||||
textColor: "{colors.ink}"
|
||||
rounded: "{rounded.row}"
|
||||
height: "24px"
|
||||
---
|
||||
|
||||
# Design System: OpenIDEA
|
||||
|
||||
## Overview
|
||||
|
||||
**Creative North Star: "The Quiet Workbench"**
|
||||
|
||||
The interface is a workbench, not a showroom. Code, trees, logs and diffs are the work. The chrome around them stays quiet, so the eye goes to the content and a long session stays calm.
|
||||
|
||||
The visual language is the JetBrains new UI in its **Islands** form, and this document records it rather than inventing one. The tokens in `src/styles/tokens.css` take their values from the Islands Light and Islands Dark theme JSON and editor schemes, at 100% zoom. Component metrics follow the matching IntelliJ theme keys (a Swing `arc` is a diameter, so the CSS radius is half of it), and component CSS names the key it follows. Behaviour follows IDEA as well, from focus and selection to dialogs and drag and drop. Users bring their JetBrains muscle memory, so a layout, metric or state that looks or behaves differently from IDEA counts as a bug, not a style choice.
|
||||
|
||||
Every panel sits on a grey frame as a rounded island (10px corners, 6px gaps). Depth comes from that tonal step, not from decoration. The density is that of a professional desktop tool: 13px UI text, 24px rows, 28px controls, with a compact mode that tightens all of them.
|
||||
|
||||
The tokens are a theming contract, not one palette. The built-in themes are Islands Light (the default), Islands Dark, High Contrast, Solarized Light and Solarized Dark. Users can also change the accent colour, give tool windows a different background from the editor, set a background image, use contrast scrollbars, or adjust colours for red-green vision deficiency. Imported IntelliJ themes and plugin themes set the same tokens at runtime. A component that looks right only in Islands Light is broken.
|
||||
|
||||
Expression is kept to precise details: one blue accent, controls with no frame until they're hovered, hairline frames on fields and secondary buttons, and fast state transitions. Three things are rejected outright. It must not look like a web app: no big rounded cards, airy marketing whitespace, decorative gradients or illustrations. It has no second accent colour. And it has no eye-catching animation.
|
||||
|
||||
### Named Rules
|
||||
|
||||
**The IDEA Reference Rule.** When tokens and this document don't answer a question, the answer is what IntelliJ IDEA does in the Islands theme, with the same metric and the same state behaviour. Take the value from the theme key, add it as a token, and name the key in a CSS comment.
|
||||
|
||||
**Key Characteristics:**
|
||||
|
||||
- JetBrains new UI (Islands): metrics and behaviour follow IntelliJ's theme keys.
|
||||
- Grey frame, rounded content islands, tonal layering only.
|
||||
- A single accent (Workbench Blue) for primary actions, focus, selection and the active tool window.
|
||||
- High density on a 4px grid. Compact mode is a first-class variant.
|
||||
- Controls are quiet at rest: toolbar buttons and chips have no frame until hover.
|
||||
- Semantic colour (status, VCS, diff, syntax) carries meaning and is never decoration.
|
||||
- Every colour and metric is a token in `src/styles/tokens.css`. Tokens are the public theme API for plugins.
|
||||
|
||||
## Colors
|
||||
|
||||
A near-neutral grey ramp with one cool blue accent. Status, VCS and syntax colours are functional vocabularies with fixed meanings. Values in the frontmatter are Islands Light (the default), and `-dark` keys are the Islands Dark counterparts. High Contrast, the Solarized themes, imported IntelliJ themes and plugin themes override the same tokens, so the names describe roles, not hexes.
|
||||
|
||||
### Project colour
|
||||
|
||||
- **Project wash** (`--project-color`): a radial tint of the project's colour (22% strength, 600 × 300px) that fades in from the frame's top-left corner, as the IDEA project gradient does. It identifies the project window. It is the one gradient in the chrome.
|
||||
|
||||
### Primary
|
||||
|
||||
- **Workbench Blue** (`--accent`): primary buttons, the focus ring, the selected-and-active stripe button, and search-match emphasis. The appearance setting can override it, so components reference `--accent`, never the hex.
|
||||
- **Link Blue** (`--link`): inline links. In Dark it lightens to stay readable on the dark islands.
|
||||
|
||||
### Neutral
|
||||
|
||||
- **Frame Grey** (`--bg-frame`): the window frame behind the islands, and the stripes (the tool window button bars).
|
||||
- **Island White** (`--bg-island`, `--bg-app`): editor and tool window surfaces. This is where the work lives.
|
||||
- **Raised Paper** (`--bg-elev`, `--bg-dialog`): dialog bodies and inline popups, one tonal step off the island.
|
||||
- **Ink** (`--fg`, `--fg-strong`): primary text. **Ink Secondary / Muted / Faint** (`--fg-secondary`, `--fg-muted`, `--fg-faint`): metadata, icons and placeholders, then disabled text.
|
||||
- **Hairline** (`--border`): dividers between regions inside an island. **Control Edge** (`--border-button`, `--border-strong`): the 1px inset frame of fields and secondary buttons.
|
||||
- **Selection Wash** (`--bg-tree-selected`, `--bg-selected`, `--bg-toolbar-selected`): the selected row in focused trees and lists, and pressed-on toolbar toggles. When the tree loses focus, the selection drops to the neutral `--bg-tree-selected-inactive`.
|
||||
|
||||
### Functional vocabularies
|
||||
|
||||
- **Status:** `--danger`, `--warning`, `--success` and `--info`, each with `--bg-feedback-*` and `--border-feedback-*` pairs for banners.
|
||||
- **VCS and diff:** `--vcs-*` for file status in trees and tabs, `--gutter-*` for gutter marks, and `--diff-*` for diff fills and their error-stripe marks.
|
||||
- **Syntax:** `--syn-*`, from the editor colour scheme. Users and plugins replace these per scheme.
|
||||
|
||||
### Named Rules
|
||||
|
||||
**The One Accent Rule.** Workbench Blue is the only accent. Every other hue in the UI belongs to a functional vocabulary (status, VCS, diff, syntax, charts) and means something specific. If a new colour has no meaning to carry, it doesn't ship.
|
||||
|
||||
**The Token Only Rule.** Components never contain hex, `rgb()` or named colour literals. A new colour is a new token with a value in every theme variant, named for its purpose. Run `pnpm gen:theme-docs` afterwards.
|
||||
|
||||
## Typography
|
||||
|
||||
**UI Font:** Inter Variable (with system-ui and -apple-system fallbacks)
|
||||
**Code Font:** JetBrains Mono (with ui-monospace and Menlo fallbacks)
|
||||
**Key Glyph Font:** the system UI font (`--font-keys`), so shortcut glyphs such as ⌘⇧⌥⌃↵ render as they do in native menus
|
||||
|
||||
**Character:** a neutral sans for chrome and a coding mono for content. Neither performs. Hierarchy comes from weight and colour, not size.
|
||||
|
||||
### Hierarchy
|
||||
|
||||
- **Title** (600, 13px, 1.4): tool window titles, section headers, dialog titles and emphasised names. Weight 600 is the system's main emphasis.
|
||||
- **Body** (400, 13px, 1.4): default UI text, menus, tree and list rows, and buttons.
|
||||
- **Label** (400, 12px): the most common size. It covers secondary metadata, chips, status bar items, table cells and hints.
|
||||
- **Label Tiny** (400, 11px): stripe labels, counters and badges.
|
||||
- **Input Large** (400, 15px): Search Everywhere and similar large query fields.
|
||||
- **Code** (400, 13px, 22px line height): the editor, console, terminal and every monospace preview. Ligatures are off by default and follow the `editor.ligatures` setting. Users set the weights (`--fw-code`, `--fw-code-bold`) and the size.
|
||||
|
||||
### Named Rules
|
||||
|
||||
**The Flat Scale Rule.** The UI uses 11, 12, 13 and 15px, and nothing in between. Emphasis is weight 600 or a stronger ink colour, not a bigger size.
|
||||
|
||||
**The User Owns Size Rule.** Sizes are tokens because users change them (UI font size, editor font, compact mode's -1px chrome offset). Never hard-code a font size.
|
||||
|
||||
## Layout
|
||||
|
||||
The window is a grey frame holding docked islands: the editor in the centre, tool windows around it, stripes of tool window buttons on the edges (58px wide), a titlebar with the main toolbar (40px), and a status bar (30px). The status bar sits directly on the frame with no divider. Islands sit 6px apart and have 10px corners. Trees are inset 6px inside their island.
|
||||
|
||||
Spacing follows a 4px grid (`--space-0-5` to `--space-4`, 2–16px). It is used for gaps, with component heights doing most of the rhythm work: rows 24px, fields and buttons 28px, small controls 24px or 20px, tabs 28px in a 38px tab bar, and tool window headers 40px.
|
||||
|
||||
**Compact mode** (`data-compact`) is a full variant, not an afterthought. Rows drop to 22px, fields and buttons to 24px, the titlebar and headers to 32px, the status bar to 24px, the island gap to 4px and island corners to 8px, and chrome text gets 1px smaller. Every layout must hold in both modes.
|
||||
|
||||
The app is a desktop window. It is never a scrolling page: the document never scrolls, and every scroll region is its own scroller inside an island. Dialogs open about 10vh from the top and below the titlebar. Wide reading surfaces, such as an agent conversation, cap their width (900px) inside the island.
|
||||
|
||||
## Elevation & Depth
|
||||
|
||||
Static layout is flat and layered by tone. The grey frame sits under white islands (in Dark, a lighter frame under darker islands). Shadows exist only on surfaces that float above the layout: popups, menus, dialogs, tooltips, balloons, undocked tool windows and drag ghosts. Dialogs use a window-style shadow, because they are separate windows in spirit.
|
||||
|
||||
### Shadow Vocabulary
|
||||
|
||||
- **Popup** (`--shadow-popup`; Light `0 6px 20px rgba(0,0,0,0.12)`): popups, menus, completion and the floating editor toolbar.
|
||||
- **Dialog** (`--shadow-dialog`): a hairline ring plus two soft drops, like a native window shadow.
|
||||
- **Tooltip** (`--shadow-tooltip`) and **Balloon** (`--shadow-balloon`): small and medium drops for hover help and notifications.
|
||||
|
||||
### Named Rules
|
||||
|
||||
**The Flat at Rest Rule.** No docked panel, island, row or control gets a shadow. A shadow means "this floats over the workbench and will go away". Depth inside the layout is only ever a tonal step.
|
||||
|
||||
## Shapes
|
||||
|
||||
Corners scale with the size of the surface. Small controls get 4px (buttons, fields, combos, rows, small icon buttons). Toolbar buttons, chips, tabs and tooltips get 6px, and selection highlights get 5px. Popups get 8–10px, and islands and dialogs get 10px. Compact mode tightens island corners to 8px and combo corners to 2px. Frames are drawn as 1px inset box-shadows rather than borders, so they never shift layout and can double on focus. There are no pills, circles (apart from macOS window buttons and status dots), or rounding beyond 10px.
|
||||
|
||||
## Components
|
||||
|
||||
Quiet and dependable. Components don't call attention to themselves, they behave the same everywhere, and they come from `src/ui/` primitives before anything custom.
|
||||
|
||||
### Buttons
|
||||
|
||||
- **Shape:** gently rounded (4px). Minimum width 72px, 28px tall, 16px horizontal padding. The small variant is 24px tall with 10px padding.
|
||||
- **Primary:** Workbench Blue fill with white text. Hover mixes it toward the strong ink colour (`--accent-hover`). Use it for one default action per dialog.
|
||||
- **Secondary:** island-coloured with a 1px Control Edge inset frame. Hover darkens the fill by about 6%.
|
||||
- **Ghost:** no fill or frame, secondary ink colour, 8px padding. Hover shows the toolbar hover wash and strong ink. Pressed is a stronger wash.
|
||||
- **Focus:** a 2px Workbench Blue outline, 1px outside the button. **Disabled:** transparent fill, faint text and a hairline frame.
|
||||
- **Motion:** background, colour and frame change over 80ms (`--dur-fast`) with `--ease`. There are no transitions under `prefers-reduced-motion`, and forced-colours mode gets a real border.
|
||||
|
||||
### Icon Buttons (toolbar actions)
|
||||
|
||||
- 20, 24 or 28px square, with 6px corners (4px at 20px). The icon is muted at rest.
|
||||
- Hover shows the toolbar hover wash (`--bg-toolbar-hover`, a translucent ink) across the full hit target, and the icon turns strong ink. Pressed shows `--bg-toolbar-pressed`.
|
||||
- A toggled-on button (`aria-pressed`) shows Selection Wash. The focus ring is drawn 2px inside the button.
|
||||
- Tone variants (`danger`, `accent`) recolour only the icon.
|
||||
|
||||
### Chips
|
||||
|
||||
- **Style:** flat, like the main toolbar's project and branch widgets. They are 22px tall with 6px corners, have no fill or frame at rest, and use 12px secondary ink with a muted icon.
|
||||
- **State:** a chip that opens a picker gets the toolbar hover wash. A read-only chip never changes on hover.
|
||||
|
||||
### Inputs / Fields
|
||||
|
||||
- **Style:** 28px tall with 8px horizontal padding and 4px corners. Island fill with a 1px Control Edge inset frame. Placeholders use the faint ink.
|
||||
- **Focus:** the frame turns Workbench Blue and doubles with a 1px outer ring, drawn entirely with box-shadow.
|
||||
- **Error:** the same doubled ring in `--danger`. **Disabled:** transparent fill, faint text and a hairline frame.
|
||||
- Search fields have a muted leading icon. Monospace fields use the code font.
|
||||
|
||||
### Lists and Trees
|
||||
|
||||
- Rows are 24px (22px compact). The selection is a 4–5px rounded wash inset from the island edge, not a full-bleed bar.
|
||||
- A focused selection uses Selection Wash, and an unfocused one drops to a neutral grey. Hover is a faint translucent wash. Search matches use `--bg-search-match`.
|
||||
|
||||
### Popups, Menus and Dialogs
|
||||
|
||||
- **Popups and menus:** `--bg-popup` with a 1px popup frame, 10px corners (`--radius-popup-large`) and the popup shadow.
|
||||
- **Dialogs:** Raised Paper body with 10px corners and the dialog shadow. They behave like IDEA's dialogs, which are separate windows: the modal layer blocks the workbench but never dims it. The footer actions are right-aligned buttons. Focus returns to wherever it came from when the dialog closes.
|
||||
|
||||
### Tabs
|
||||
|
||||
- 28px tabs (24px compact) in a 38px bar, with 6px corners and 8px horizontal padding.
|
||||
- As in IDEA, only the part holding focus accents its selected tab (`--bg-tab-selected` with `--border-tab-selected`). Elsewhere the selected tab drops to the neutral inactive pair.
|
||||
- **Tooltips:** 6px corners with 6px × 10px padding, using `--bg-tooltip` (white in Light, dark grey in Dark) and the tooltip shadow.
|
||||
|
||||
### Tool Window Stripes (signature)
|
||||
|
||||
The edge bars of tool window buttons are 58px wide on Frame Grey, with icons over 11px labels. Hover and selected states are translucent ink washes. The selected button of the active tool window fills with Workbench Blue and white content. This is the one place the accent fills a large shape in the chrome, and it marks the active tool window.
|
||||
|
||||
## Do's and Don'ts
|
||||
|
||||
### Do:
|
||||
|
||||
- **Do** match IntelliJ IDEA's Islands theme for any metric or state that isn't tokenized yet. Take the value from the theme key and name the key in a CSS comment (for example `Button.arc 8 (radius 4)`).
|
||||
- **Do** take every colour and metric from `src/styles/tokens.css`, and add a token for every theme variant when you need a new one.
|
||||
- **Do** separate regions with a tonal step (frame against island) or a 1px hairline, never with a shadow.
|
||||
- **Do** keep toolbar buttons and chips without a frame at rest, with the toolbar hover wash over the full hit target.
|
||||
- **Do** draw frames and focus rings as inset box-shadows (1px at rest, doubled on focus), and keep the 2px Workbench Blue focus outline visible.
|
||||
- **Do** check every surface in Islands Light and Islands Dark at least, as the contribution guidelines require. Check High Contrast and compact density whenever a change touches colour or metrics.
|
||||
- **Do** keep transitions to state changes: 80ms (`--dur-fast`), 140ms (`--dur`) or at most 220ms (`--dur-slow`) with `--ease`, and none under reduced motion.
|
||||
- **Do** use icons from the `src/ui/icons.tsx` registry, drawn in `currentColor`.
|
||||
|
||||
### Don't:
|
||||
|
||||
- **Don't** make it look like a web app: no large rounded cards, airy marketing whitespace, decorative gradients, hero illustrations or corners above 10px. The project wash is the one gradient in the chrome. Progress shimmer counts as activity, not decoration.
|
||||
- **Don't** invent a look or behaviour where IDEA already has one. A custom variant of an IDEA pattern breaks muscle memory.
|
||||
- **Don't** add a second accent. Any hue other than Workbench Blue must carry status, VCS, diff, syntax or chart meaning.
|
||||
- **Don't** add attention-seeking animation: no bounces, no staggered entrances, and no state transition over 220ms. Looping animation is only for activity that is really happening (spinners, progress, loading shimmer, a running pulse, the caret), never decoration.
|
||||
- **Don't** put shadows on docked panels, islands, rows or controls.
|
||||
- **Don't** use sizes off the 11/12/13/15px scale, or hard-code a font size users can change.
|
||||
- **Don't** use hex, `rgb()` or named colours in component CSS or inline styles.
|
||||
- **Don't** use emoji as icons or decoration, or inline ad-hoc SVG in a feature.
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
# Product
|
||||
|
||||
<!-- impeccable:product-schema 1 -->
|
||||
|
||||
## Platform
|
||||
|
||||
web
|
||||
|
||||
The IDE is a Tauri desktop app for macOS, Windows and Linux. Its UI is a web frontend (React, CSS Modules) inside the system webview, with its own design language rather than each operating system's native one. Scope: this record covers the IDE application only. The openidea.sh docs site and home page (`docs/`) are out of scope.
|
||||
|
||||
## Users
|
||||
|
||||
- **Primary: JetBrains users who want something lighter.** They already know the IntelliJ IDEA keymap, tool windows and search-everything habits, and find IDEA heavy and slow. They do everyday multi-language development on the desktop: editing, navigating, refactoring, running and debugging, Git, terminal, database and HTTP clients.
|
||||
- **Primary: developers working with AI coding agents.** They run CLI agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor and others over ACP) inside the IDE as tasks, often several at once, each in its own Git worktree or in the checkout. They review the agents' diffs, answer their permission requests, and give agents the IDE's own tools through the built-in MCP server.
|
||||
- **Secondary: people moving from VS Code or Eclipse.** Their keymaps are built in.
|
||||
|
||||
## Product Purpose
|
||||
|
||||
OpenIDEA brings the IntelliJ IDEA way of working to a native app with a Rust core: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages. Success means people who know the IDEA way of working can switch without relearning anything, and it opens, responds and quits much faster while using a fraction of the memory.
|
||||
|
||||
## Positioning
|
||||
|
||||
"The IDE you know, rebuilt in Rust." The habits are familiar (keymap, tool windows, Search Everywhere, Alt+Enter), the app is open source (Apache 2.0), and performance is measured: on the published benchmark, the window opens in 0.9 s against 3.1 s and the app uses 169 MB against 2011 MB. Coding agents are part of the IDE (tasks, worktrees, diffs and the IDE's tools over MCP) rather than a separate chat app.
|
||||
|
||||
## Operating Context
|
||||
|
||||
- Long sessions in one desktop window: the editor in the middle, tool windows docked around it, and keyboard-first navigation (Search Everywhere, Find Action, Go to Class/File/Symbol).
|
||||
- Local projects, and remote development over SSH or in dev containers through the `openidea-server` backend.
|
||||
- Agent tasks running alongside the developer's own work, with diff review and permission prompts.
|
||||
- Built-in themes: Islands Light (the default), Islands Dark, High Contrast, Solarized Light and Solarized Dark, with an option to follow the OS's light or dark mode. Users can import IntelliJ themes and `.icls` colour schemes, and plugins add more themes.
|
||||
|
||||
## Capabilities and Constraints
|
||||
|
||||
Hard constraints future work must preserve:
|
||||
|
||||
1. The default keymap and interaction habits stay the same as IDEA's.
|
||||
2. All user-visible text is written in English and must also have a Chinese translation, through the text catalog (`T`, translated `aria-label`).
|
||||
3. WebKit floor is Safari 15.4 (macOS 12). No regex lookbehind or `v` flag, no import attributes, and no newer runtime APIs in startup code. `scripts/check-webkit.ts` enforces this.
|
||||
4. Design tokens in `src/styles/tokens.css` are the public theme API for plugins. Components use tokens only and never colour literals. A new token needs a value for every theme variant, and the docs must be regenerated with `pnpm gen:theme-docs`.
|
||||
5. Every user operation is an action with a stable id, reachable from the keyboard and Find Action, not only by mouse.
|
||||
6. No emoji as icons or decoration, in the UI or in user-visible text. Icons come from the `src/ui/icons.tsx` registry.
|
||||
7. Performance (startup, memory, idle CPU) is the core selling point. UI work must not slow it down.
|
||||
|
||||
Other facts:
|
||||
|
||||
- Plugins are sandboxed WebAssembly components that add actions, completion, quick fixes, tool windows, custom editors, themes, file icons and languages. The plugin API is still a preview.
|
||||
- UI is built from the primitives in `src/ui/` (Button, Dialog, Popup, Menu, List, Tree, Tabs and others). Workbench pieces come from contributions, not custom layout.
|
||||
|
||||
## Brand Commitments
|
||||
|
||||
- Name: OpenIDEA. Wordmarks are in `src-tauri/icons/source/` (`openidea-wordmark.svg` and `openidea-wordmark-dark.svg`).
|
||||
- Not affiliated with JetBrains. IntelliJ IDEA is a trademark of JetBrains s.r.o.
|
||||
- Voice is plain, short and factual. It states measurements with their conditions rather than superlatives.
|
||||
|
||||
## Evidence on Hand
|
||||
|
||||
- Benchmark table and method: `README.md`, `perf/compare`. The conditions are stated with it: freqtrade, warm caches, median of 5 runs, Windows 11, 32-core AMD.
|
||||
- Demo video linked from `README.md`.
|
||||
- No testimonials, customer logos or user counts exist. Do not fabricate them.
|
||||
|
||||
## Product Principles
|
||||
|
||||
1. **Familiar first.** Existing IDEA habits must keep working. New behaviour must not break that muscle memory.
|
||||
2. **Speed is a feature.** Every surface is judged by how much it costs in startup time, memory and responsiveness.
|
||||
3. **Keyboard reachable.** If something can be done, it is an action that can be found and bound.
|
||||
4. **Agents work inside the IDE.** Agent work is reviewed and controlled with the IDE's own tools: diffs, worktrees and permissions.
|
||||
5. **Themeable by contract.** Visual decisions go through tokens that themes and plugins can rely on.
|
||||
|
||||
## Accessibility & Inclusion
|
||||
|
||||
- Use real `<button>` and `<input>` elements or the primitives that render them. Every icon-only button has a translated `aria-label`.
|
||||
- Keep focus visible and predictable. Dialogs and popups return focus to where it came from.
|
||||
- A dark high-contrast theme (`dark-hc`) ships and must be kept working.
|
||||
@@ -114,12 +114,6 @@ pub async fn debug_start(host: &Host, window: &str, config: LaunchConfig) -> Ide
|
||||
extra["__adapterJavaHome"] = serde_json::json!(runtime.home);
|
||||
config.extra_json = Some(extra.to_string());
|
||||
}
|
||||
if finds_java_sources(&config)
|
||||
&& let Ok(project) = host.project(window)
|
||||
{
|
||||
let roots = host.blocking(move || Ok(java_source_roots(&project))).await?;
|
||||
config = add_java_source_paths(config, &roots);
|
||||
}
|
||||
let root = config.cwd.clone().map(PathBuf::from).unwrap_or_default();
|
||||
let mut ruby_tools = Vec::new();
|
||||
if config.adapter == "rdbg" && config.request == "launch" {
|
||||
@@ -314,46 +308,6 @@ fn start_java_attach_listener(mut config: LaunchConfig, windows: bool) -> Launch
|
||||
config
|
||||
}
|
||||
|
||||
/// The project's source and test roots, as the IDE detects them (no Maven / Gradle import needed).
|
||||
fn java_source_roots(project: &crate::project::Project) -> Vec<PathBuf> {
|
||||
use ide_workspace::roots::RootKind;
|
||||
project
|
||||
.roots()
|
||||
.roots
|
||||
.iter()
|
||||
.filter(|r| matches!(r.kind, RootKind::Source | RootKind::Test))
|
||||
.map(|r| project.root.join(&r.path))
|
||||
.filter(|p| p.is_dir())
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Debuggers that look a frame's source up in `sourcePaths` when their own model has no file:
|
||||
/// java-debug after jdtls (which has not imported a project whose Maven sync failed), and
|
||||
/// java-analyzer after the module it debugs (whose sibling modules it does not load).
|
||||
fn finds_java_sources(config: &LaunchConfig) -> bool {
|
||||
matches!(config.adapter.as_str(), "java-debug" | ide_dap::adapter::JAVA_ANALYZER)
|
||||
}
|
||||
|
||||
/// Without a file for the stopped frame the editor cannot follow the execution point, so Java
|
||||
/// sessions get every source root of the project. The user's own list wins.
|
||||
fn add_java_source_paths(mut config: LaunchConfig, roots: &[PathBuf]) -> LaunchConfig {
|
||||
if !finds_java_sources(&config) || roots.is_empty() {
|
||||
return config;
|
||||
}
|
||||
let mut extra = match config.extra_json.as_deref().map(serde_json::from_str) {
|
||||
None => serde_json::Map::new(),
|
||||
Some(Ok(serde_json::Value::Object(extra))) => extra,
|
||||
Some(_) => return config,
|
||||
};
|
||||
if extra.get("sourcePaths").is_some_and(|v| !v.is_null()) {
|
||||
return config;
|
||||
}
|
||||
let paths: Vec<String> = roots.iter().map(|r| r.to_string_lossy().into_owned()).collect();
|
||||
extra.insert("sourcePaths".into(), paths.into());
|
||||
config.extra_json = Some(serde_json::Value::Object(extra).to_string());
|
||||
config
|
||||
}
|
||||
|
||||
/// A JVM launched by java-debug writes what java-debug decodes its output as
|
||||
/// (see [`ide_core::output_encoding::java_debug_vm_args`]).
|
||||
fn match_java_debug_encoding(mut config: LaunchConfig, windows: bool) -> LaunchConfig {
|
||||
@@ -783,34 +737,6 @@ mod tests {
|
||||
serde_json::from_str::<serde_json::Value>(config.extra_json.as_deref().unwrap()).unwrap()["vmArgs"].clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn java_debug_sessions_look_up_sources_in_project_roots() {
|
||||
let roots = [PathBuf::from("/p/src/main/java"), PathBuf::from("/p/src/test/java")];
|
||||
let source_paths = |config: &LaunchConfig| {
|
||||
serde_json::from_str::<serde_json::Value>(config.extra_json.as_deref().unwrap()).unwrap()["sourcePaths"]
|
||||
.clone()
|
||||
};
|
||||
for adapter in ["java-debug", ide_dap::adapter::JAVA_ANALYZER] {
|
||||
for request in ["launch", "attach"] {
|
||||
let config = add_java_source_paths(launch(adapter, request, serde_json::json!({"port": 5005})), &roots);
|
||||
assert_eq!(source_paths(&config), serde_json::json!(["/p/src/main/java", "/p/src/test/java"]));
|
||||
}
|
||||
}
|
||||
let mut bare = launch("java-debug", "attach", serde_json::json!({}));
|
||||
bare.extra_json = None;
|
||||
assert_eq!(
|
||||
source_paths(&add_java_source_paths(bare, &roots)),
|
||||
serde_json::json!(["/p/src/main/java", "/p/src/test/java"])
|
||||
);
|
||||
|
||||
let own = launch("java-debug", "launch", serde_json::json!({"sourcePaths": ["/elsewhere"]}));
|
||||
assert_eq!(source_paths(&add_java_source_paths(own, &roots)), serde_json::json!(["/elsewhere"]));
|
||||
let other = launch("debugpy", "launch", serde_json::json!({}));
|
||||
assert_eq!(add_java_source_paths(other.clone(), &roots).extra_json, other.extra_json);
|
||||
let none = launch("java-debug", "launch", serde_json::json!({}));
|
||||
assert_eq!(add_java_source_paths(none.clone(), &[]).extra_json, none.extra_json);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn java_debug_launches_on_windows_write_utf8() {
|
||||
let extra =
|
||||
|
||||
@@ -8,7 +8,7 @@ use ide_core::proxy_settings::{ProxyMode, ProxySettings};
|
||||
use std::time::Duration;
|
||||
|
||||
/// Whether `url` names this machine (`localhost` or a loopback address).
|
||||
pub fn is_loopback(url: &reqwest::Url) -> bool {
|
||||
fn is_loopback(url: &reqwest::Url) -> bool {
|
||||
let host = url.host_str().unwrap_or_default().trim_start_matches('[').trim_end_matches(']');
|
||||
host.eq_ignore_ascii_case("localhost") || host.parse::<std::net::IpAddr>().is_ok_and(|ip| ip.is_loopback())
|
||||
}
|
||||
|
||||
@@ -136,10 +136,6 @@ pub trait PluginWorkspace: Send + Sync {
|
||||
fn apply_edits(&self, path: &Path, version: u64, edits: &[TextEdit], background: bool) -> Result<u64, HostError>;
|
||||
/// Code from the project may run (git hooks and config on fetch).
|
||||
fn trusted(&self, root: &Path) -> bool;
|
||||
/// Git roots with the same directory mappings as the VCS tool window.
|
||||
fn repositories(&self, _root: &Path) -> Result<ide_vcs::Repos, HostError> {
|
||||
Err(HostError::NotFound("no open project repositories".into()))
|
||||
}
|
||||
/// The git executable of the project at `root` (see [`crate::Project::git_executable`]).
|
||||
fn git_executable(&self, _root: &Path) -> Option<PathBuf> {
|
||||
None
|
||||
@@ -2398,40 +2394,8 @@ impl HostApi for PluginApi {
|
||||
|
||||
fn vcs_remotes(&self, root: &Path) -> Result<Vec<(String, String)>, HostError> {
|
||||
let Some(repo) = ide_vcs::Repo::discover(root).map_err(failed)? else { return Ok(Vec::new()) };
|
||||
plugin_remotes(&repo)
|
||||
}
|
||||
|
||||
fn vcs_roots(&self, root: &Path) -> Result<Vec<String>, HostError> {
|
||||
let workspace = self.shared.workspace().ok_or(HostError::Cancelled)?;
|
||||
Ok(workspace
|
||||
.repositories(root)?
|
||||
.roots()
|
||||
.iter()
|
||||
.filter(|r| r.starts_with(root) || root.starts_with(r))
|
||||
.map(|r| to_ipc(r))
|
||||
.collect())
|
||||
}
|
||||
|
||||
fn vcs_repository_at(&self, root: &Path, path: &str) -> Result<Option<ide_plugin::RepositoryInfo>, HostError> {
|
||||
let workspace = self.shared.workspace().ok_or(HostError::Cancelled)?;
|
||||
if !workspace.trusted(root) {
|
||||
return Err(HostError::Failed("the project is in Restricted Mode: git does not run there".into()));
|
||||
}
|
||||
let path = ide_plugin::resolve_in_root(root, path).map_err(HostError::Invalid)?;
|
||||
let repos = workspace.repositories(root)?;
|
||||
// A link to a nested worktree directory denotes that worktree, not its entry in the parent.
|
||||
let Some(repo) = repos.at_root(&path).or_else(|| repos.for_path(&path)) else { return Ok(None) };
|
||||
let relative = path.strip_prefix(repo.root()).map_err(failed)?;
|
||||
let info = repo.branch_info().map_err(failed)?;
|
||||
Ok(Some(ide_plugin::RepositoryInfo {
|
||||
root: to_ipc(repo.root()),
|
||||
relative_path: to_ipc(relative),
|
||||
branch: info.head,
|
||||
commit: info.head_commit,
|
||||
upstream: info.upstream,
|
||||
ahead: info.ahead,
|
||||
remotes: plugin_remotes(repo)?,
|
||||
}))
|
||||
let remotes = repo.remotes().map_err(failed)?;
|
||||
Ok(remotes.into_iter().map(|r| (r.name, without_credentials(&r.url))).collect())
|
||||
}
|
||||
|
||||
fn vcs_fetch(&self, root: &Path, cancel: &CancellationToken) -> Result<(), HostError> {
|
||||
@@ -3766,13 +3730,6 @@ impl PluginWorkspace for HostWorkspace {
|
||||
HostWorkspace::project_covering(self, root).is_some_and(|p| p.is_trusted())
|
||||
}
|
||||
|
||||
fn repositories(&self, root: &Path) -> Result<ide_vcs::Repos, HostError> {
|
||||
Ok(self
|
||||
.project_covering(root)
|
||||
.ok_or_else(|| HostError::NotFound("the project is no longer open".into()))?
|
||||
.repos())
|
||||
}
|
||||
|
||||
fn git_executable(&self, root: &Path) -> Option<PathBuf> {
|
||||
HostWorkspace::project_covering(self, root)?.git_executable()
|
||||
}
|
||||
@@ -4737,10 +4694,6 @@ fn from_window<'a>(client: Option<&'a str>, what: &str) -> Result<&'a str, HostE
|
||||
client.ok_or_else(|| HostError::Invalid(format!("can only {what} from a command the user invoked")))
|
||||
}
|
||||
|
||||
fn plugin_remotes(repo: &ide_vcs::Repo) -> Result<Vec<(String, String)>, HostError> {
|
||||
Ok(repo.remotes().map_err(failed)?.into_iter().map(|r| (r.name, without_credentials(&r.url))).collect())
|
||||
}
|
||||
|
||||
/// `url` without the `user:password@` a remote may carry (`https://user:token@host/…`):
|
||||
/// `vcs.read` must not hand out credentials. scp-style `git@host:path` has no password.
|
||||
fn without_credentials(url: &str) -> String {
|
||||
|
||||
@@ -2361,11 +2361,8 @@ fn git_metadata_watch(root: &Path, sink: &SharedSink) -> Option<Arc<ide_vcs::Met
|
||||
.ok()
|
||||
}
|
||||
|
||||
/// Whether a VCS metadata path changed for a reason other than our own status run
|
||||
/// refreshing an index: the main repository's `.git/index` or a linked worktree's
|
||||
/// `.git/worktrees/<id>/index`.
|
||||
fn vcs_path_changed(path: &Path) -> bool {
|
||||
path.file_name().is_none_or(|n| n != "index") || !ide_vcs::is_own_index_write(path)
|
||||
!path.ends_with(".git/index") || !ide_vcs::is_own_index_write(path)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -2449,40 +2446,6 @@ mod index_event_tests {
|
||||
std::fs::remove_file(&index).unwrap();
|
||||
assert!(vcs_path_changed(&index));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn status_write_in_a_linked_worktree_is_suppressed() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let main = tmp.path().join("main");
|
||||
std::fs::create_dir(&main).unwrap();
|
||||
let git = |dir: &std::path::Path, args: &[&str]| {
|
||||
let output = std::process::Command::new("git")
|
||||
.current_dir(dir)
|
||||
.args(["-c", "user.name=t", "-c", "user.email=t@t"])
|
||||
.args(args)
|
||||
.output()
|
||||
.unwrap();
|
||||
assert!(output.status.success(), "{}", String::from_utf8_lossy(&output.stderr));
|
||||
};
|
||||
git(&main, &["init", "-q"]);
|
||||
std::fs::write(main.join("file.txt"), "original\n").unwrap();
|
||||
git(&main, &["add", "file.txt"]);
|
||||
git(&main, &["commit", "-qm", "init"]);
|
||||
let linked = tmp.path().join("linked");
|
||||
git(&main, &["worktree", "add", "-q", linked.to_str().unwrap()]);
|
||||
std::fs::File::options()
|
||||
.write(true)
|
||||
.open(linked.join("file.txt"))
|
||||
.unwrap()
|
||||
.set_modified(std::time::SystemTime::UNIX_EPOCH + std::time::Duration::from_secs(1))
|
||||
.unwrap();
|
||||
let index = main.join(".git/worktrees/linked/index");
|
||||
let before = std::fs::read(&index).unwrap();
|
||||
ide_vcs::Repo::discover(&linked).unwrap().unwrap().status().unwrap();
|
||||
assert_ne!(before, std::fs::read(&index).unwrap(), "status must actually write the index");
|
||||
assert!(!vcs_path_changed(&index));
|
||||
assert!(vcs_path_changed(&main.join(".git/worktrees/linked/HEAD")));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(test, unix))]
|
||||
|
||||
@@ -81,10 +81,6 @@ impl TestWorkspace {
|
||||
}
|
||||
|
||||
impl PluginWorkspace for TestWorkspace {
|
||||
fn repositories(&self, root: &Path) -> Result<ide_vcs::Repos, HostError> {
|
||||
ide_vcs::Repos::discover(root, &|_| false).map_err(|e| HostError::Failed(e.message))
|
||||
}
|
||||
|
||||
fn run_configuration(&self, _client: &str, plugin: &str, id: &str) -> Result<ide_run::RunConfig, HostError> {
|
||||
if !(plugin == "execution" && matches!(id, "detected" | "dynamic") || plugin == "api14" && id == "tests") {
|
||||
return Err(HostError::NotFound(id.into()));
|
||||
@@ -3613,36 +3609,6 @@ fn commands_see_the_paths_they_were_run_on() {
|
||||
assert_eq!(f.run("jobs", "selection", None).unwrap().as_deref(), Some(""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_reads_the_repository_owning_the_path() {
|
||||
let f = fixture(Limits::default());
|
||||
f.install(&sample("jobs"));
|
||||
let lookup = |path: Option<&str>| f.run("jobs", "repository-at", path);
|
||||
for name in ["alpha", "beta", "alpha/nested"] {
|
||||
let dir = f.project.join(name);
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
git(&dir, &["init", "-b", "work"]);
|
||||
git(&dir, &["remote", "add", "origin", &format!("https://user:[email protected]/{name}.git")]);
|
||||
std::fs::write(dir.join("file.txt"), name).unwrap();
|
||||
}
|
||||
assert_eq!(lookup(None).unwrap().unwrap().lines().count(), 3);
|
||||
for (path, repo, relative) in [
|
||||
("alpha/file.txt", "alpha", "file.txt"),
|
||||
("beta/file.txt", "beta", "file.txt"),
|
||||
("alpha/nested/file.txt", "alpha/nested", "file.txt"),
|
||||
("alpha/nested", "alpha/nested", ""),
|
||||
] {
|
||||
let root = to_ipc(&f.project.join(repo));
|
||||
let expected = format!("{root}|{relative}|work|[(\"origin\", \"https://example.org/{repo}.git\")]");
|
||||
assert_eq!(lookup(Some(path)).unwrap().as_deref(), Some(expected.as_str()));
|
||||
}
|
||||
assert_eq!(lookup(Some(".")).unwrap(), None);
|
||||
assert!(lookup(Some("..")).unwrap_err().contains("outside"));
|
||||
f.host.set_capability("jobs", "vcs.read", false).unwrap();
|
||||
assert!(lookup(None).unwrap_err().contains("vcs.read"));
|
||||
assert!(lookup(Some("alpha/file.txt")).unwrap_err().contains("vcs.read"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vcs_remotes_clipboard_and_open_url() {
|
||||
let f = fixture(Limits::default());
|
||||
|
||||
@@ -317,8 +317,6 @@ pub trait HostApi: Send + Sync {
|
||||
fn storage_keys(&self, prefix: &str) -> Result<Vec<String>, HostError>;
|
||||
fn vcs_status(&self, root: &Path) -> Result<Option<RepositoryStatus>, HostError>;
|
||||
fn vcs_remotes(&self, root: &Path) -> Result<Vec<(String, String)>, HostError>;
|
||||
fn vcs_roots(&self, root: &Path) -> Result<Vec<String>, HostError>;
|
||||
fn vcs_repository_at(&self, root: &Path, path: &str) -> Result<Option<crate::RepositoryInfo>, HostError>;
|
||||
fn vcs_fetch(&self, root: &Path, cancel: &CancellationToken) -> Result<(), HostError>;
|
||||
/// The commit being prepared in `client`'s window (`None`: no repository),
|
||||
/// waiting for the window until `cancel` fires.
|
||||
|
||||
@@ -408,18 +408,6 @@ pub struct RepositoryStatus {
|
||||
pub changed_files: u32,
|
||||
}
|
||||
|
||||
/// Reference and remotes of a path's mapped worktree (WIT `vcs.repository-info`).
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub struct RepositoryInfo {
|
||||
pub root: String,
|
||||
pub relative_path: String,
|
||||
pub branch: Option<String>,
|
||||
pub commit: Option<String>,
|
||||
pub upstream: Option<String>,
|
||||
pub ahead: u32,
|
||||
pub remotes: Vec<(String, String)>,
|
||||
}
|
||||
|
||||
/// A file a pending commit changes (WIT `commit.commit-change`).
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
@@ -1446,34 +1446,6 @@ impl vcs::Host for StoreData {
|
||||
let root = self.table.get(&project)?.root.clone();
|
||||
Ok(self.host.vcs_remotes(&root).map_err(to_wit))
|
||||
}
|
||||
|
||||
fn roots(&mut self, project: Resource<ProjectRes>) -> Fallible<Vec<String>> {
|
||||
if let Err(e) = self.require(Capability::VcsRead) {
|
||||
return Ok(Err(e));
|
||||
}
|
||||
Ok(self.host.vcs_roots(&self.table.get(&project)?.root).map_err(to_wit))
|
||||
}
|
||||
|
||||
fn repository_at(&mut self, project: Resource<ProjectRes>, path: String) -> Fallible<Option<vcs::RepositoryInfo>> {
|
||||
if let Err(e) = self.require(Capability::VcsRead) {
|
||||
return Ok(Err(e));
|
||||
}
|
||||
Ok(self
|
||||
.host
|
||||
.vcs_repository_at(&self.table.get(&project)?.root, &path)
|
||||
.map(|r| {
|
||||
r.map(|r| vcs::RepositoryInfo {
|
||||
root: r.root,
|
||||
relative_path: r.relative_path,
|
||||
branch: r.branch,
|
||||
commit: r.commit,
|
||||
upstream: r.upstream,
|
||||
ahead: r.ahead,
|
||||
remotes: r.remotes,
|
||||
})
|
||||
})
|
||||
.map_err(to_wit))
|
||||
}
|
||||
}
|
||||
|
||||
impl build::Host for StoreData {
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
68517d169bea40ca5a5426a3a05ace3389417073b9369e79157a2beb051dcfc0
|
||||
1bd593215a298e86d1dcbccd5431d7efd3d0e0f0d83c0a05ecf95cd597cb89b1
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
6edda84fad0ee7cd56a3a28b55e6c559db7b7f6b9c8c0ca645be805b545c01e7
|
||||
fce80835362944cf050a430a134a8c742e3365af32ad45ae2156918bd0c74575
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
ecc6b6c52753b11521ae033a5a66c2a289119e09e07d22742203d3a13122dd97
|
||||
e7d65dbf92a0edce8f1a6abf5a502dfc4fb4d818599ac1c54e8f82f60e62648a
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
4ec581c69a62bbf424983e241a79d0bfdb5d025a3e86d27eea745adcb1906253
|
||||
c79c1613b8ce1dd69a2889b6a80a7608c6862b115d4283a8a9bae179e0fb57b9
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
5fb89ee3d07e4275433ad9ad930ad781ef4f227af11aa5eb9dfc9174c015b1b8
|
||||
cc7ff6388700b72a9c8785f7935a79d018752e86ce32407ecd7a3b51f4093f09
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
236db5a85d3e7e9fee01c3ff0b9f5e66fad7e3d64fa618a0c1c980d9e5883839
|
||||
fcf00edd43ed4fc26201ccdd4d1c102e51b9e0080603204d566e437bedc28fcf
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
4f89bd09b571016cbb9feb0674e668aa66996997c6b53a91d1a4ffbf161083a3
|
||||
3f00290d04844109a9175f91dae042d3f377f0b2badf56955c589f1c1fbe71db
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
c5c3bac9e2b69e4957bd5049d4f560dd04faf4dfc2d7523bb7968aa29f3bdcfb
|
||||
b9812539466c03233fabd6a428a1598bed0e485841ec462f577889da2f8c1831
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
a75758a44e255b7df3adf53e5f81b8f1283270d28f78ad0d8b358d9feea98a99
|
||||
4a9eaf0b5374baf7cca82553d8209b7750f34c9e6dfd923bb491b07294b564d2
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
7e658a971fd58b84fcadc1f4939991d5f4506936989d4c8a7302ccebc0455e9c
|
||||
4d9403692c7bb8698f06c6336c5d9db7934004d6dd09362f77aa361b215108ca
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
6b7c0d8971cfd3ba1d80c5fc6428e5890c820350972597a11be4ea6f0324973f
|
||||
df21a4a36dbfeb99505d24da6f18011531f581327f2c5069479ad47ab03bb8b3
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
20e43b6ac3aaa1527874f98f4b502ef88dd4676b6096b989c7bfba7a521e723d
|
||||
545723b3a96ef095c60cc2e16743fcd23bb8568a023507e2f1c33cba27478717
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
f879df5a331ec439c7e74af4d9c7d249477239e3a0a59d5e612548623cf5e9e2
|
||||
698653d9344a009b0682becb67708d8e4e49d6880bce448f865b985f2605a330
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
de1fc37d8fd5993164e0d903a0f1b4ba15005f2a90de325d7f4b4902a363fdf1
|
||||
03da30c1e589f499ae0889af62d39cfdbdcdc9f1035f8ed1479058843ef39ebf
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
367366c14b69d8f3837e731e061768ec5cb344d86fba89ced63fb196e5ca475e
|
||||
f080d959792a14554e6978923d4c5461a1b3d31dead0b7ec69131acb98e47f27
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
b7bccc7f93b409263293d2dff8a31dbdcfcdfba133815f3ff60bc70a073257de
|
||||
b48218bf3d0f76b519cce52856c5f5c577a2273eb7e0afd63c771c0222342450
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
f28d85f2004adcdf4e43faa57b7a5b52ab5d8233579979062461b0c5b4c63e10
|
||||
e34aabcbc0fb1cb26d5c913a8ddece8eea205128b4985c24e89935a49c4e290d
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
23c2c5e6e208104979e1f5b8620d2279547d372f0accf893c2d7797399fe39b0
|
||||
a6c412b5e9f0f5b677a0d6ec64f50e90a62a5559a25f70a2f40fa83defc35823
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
57fc9ea26136a56fa2f502e4bb17531df3f5eed092fde1267199e2447c8fbc23
|
||||
d364826baf1beeefbd582325a67c95d2d66a58ce2643100974a52e10c7cd7afe
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
105017e20dd7a93cecb178576f2718ccf8433a6fac027b5708d6e2121f85e27a
|
||||
f130b73f1a32c5a87d052dc3d8274ec92d21083d738775328cd6a587e92bd7b5
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
ae72f5db42f508bd8faac6134f6e9a785a8fdcdda823af32cb56e5936c157bf9
|
||||
d01472c658cb3cda802603d4a6db5ff976c7ae958929c03dafdc54820a9990f2
|
||||
@@ -35,15 +35,6 @@ impl Plugin for Jobs {
|
||||
fn run_command(&mut self, id: &str, ctx: &Invocation, arg: Option<&str>) -> Result<Option<String>, Error> {
|
||||
match id {
|
||||
"follow" => self.follow().map(|()| None),
|
||||
"repository-at" => {
|
||||
let project = ctx.project().ok_or("no project is open")?;
|
||||
Ok(match arg {
|
||||
None => Some(project.vcs_roots()?.join("\n")),
|
||||
Some(path) => project.vcs_repository_at(path)?.map(|r| {
|
||||
format!("{}|{}|{}|{:?}", r.root, r.relative_path, r.branch.unwrap_or_default(), r.remotes)
|
||||
}),
|
||||
})
|
||||
}
|
||||
"remotes" => {
|
||||
let project = ctx.project().ok_or("no project is open")?;
|
||||
let remotes = project.vcs_remotes()?;
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
d773509ce0beebc88b769d8346aaafa39b1201d959c4afd16d680c63cef919d5
|
||||
2a4e83aac16df6c12fcaac2f1b2bdc52c7426b3262a9172563b6760ca7b0f27f
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
1b15f24dc006f18260c746d9651cdaa2416e7871397e21f2935f50d316b88f67
|
||||
6e5f70de45fc4d9d5392ba9260eb4d2a85518076a0d6952e38913f09183cea12
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
8249c0aa3ab7621f5cb33e2afea6babf3370749757f0957360e5c40f0c15ff66
|
||||
5a31c423c02f6f95b3f2d350c0f6abce1a2d93540d1c50e635a240382c5a551b
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
0006724d54d1acb732d2d4f77d67c855b5a560747537c11eb48cb0cb988d9783
|
||||
dc6d6308f6b228a349ece32b253f278009149ad1244722a79463747f04ef6a1a
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
5985abd096cf5d957f17302ecd9d785fbc975e409b945c3b5c7ef84b2890e6b0
|
||||
307396d257af1b732a7cdb8b69e25fe37d2a63b1a8bd2d6faee325aebbad3f54
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
5e0ee5752d6c418b96b7dd3f0bfaea3e034eb868d4edb847b42cc8c33eef1257
|
||||
86886cbeed8325adffde61a07b0ae97195cc76ee8fc4f85b3763d0cf28c24cd1
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
281c04d6fb2999a6f4967475fa19dd9f0ee887c7cf2b323951f124562ea27389
|
||||
d6f9e669b02bc4f3fe5aa23e2908112eb9c4134889474c2321f82c7fa3934487
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
ca75434712f4f1709943a84f7bb8907479395109d1e160171314fcf768c73ef8
|
||||
fec0b2f041f5362ddb8c3eec0edceaab2555c44e5694c226d11ea272a5d79b87
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
51d29c00405b9e364755dec2ce22eeaaa3b06ef5218244179be73e8ab03e815f
|
||||
89a930f275b2b6b087bd22e0ac9f520379efaa380fb1a141d190018a351e44c1
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
5e9db81302adfaab77c1cf6545cdc2cd7b0b1bed29e68ed8160b487694da043a
|
||||
c743ba515c8a329e45e441bb48d32fe4ff9cedc5835f8c23dca4893c23b19a4e
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
e66d84009ab855107a8614a146e3e21c34a767c590f2b0f10157b0546e532008
|
||||
a09d11f1f1d278ca11e1e799f15108dcfd19d8b35687a898a71799663c11e9a5
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
42e2ca709640744b0a00c0ab44911b2204417744c7402271f759ee630de79cf2
|
||||
d9ec893a3b270d6df8f7225ac532afd7b48efb511fa1f48df041ae7ebef6f21a
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
161f4797c5a371dd3fe5e9c02a75d444c357e88db7a55e53b3cc6d22af021d38
|
||||
4cf100f956d75ab7e6bd9ba1b77a4daed1514072a364ecd84f9a62af756944a2
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
f5e228a477aee1f902d74b532838b96cd6c07b0416037c76dfe25744724d3094
|
||||
73df9e3929d160a0ec75a0dab38c89cc3f4fb5110b8d3245870345ea58693a75
|
||||
@@ -784,25 +784,10 @@ impl EventFilter {
|
||||
}
|
||||
}
|
||||
|
||||
/// Relative to `.git/worktrees`: the first component is the worktree ID. Like the main
|
||||
/// gitdir, a linked worktree's gitdir only reports the files that describe its state; the
|
||||
/// rest is Git's (and our own) scratch space. Even read-only queries write there
|
||||
/// (fsmonitor cookies, temporary indexes, reflogs), and reporting those would schedule
|
||||
/// another query.
|
||||
fn worktree_metadata(parts: &[&OsStr]) -> bool {
|
||||
match parts {
|
||||
[] | [_] => true,
|
||||
[_, name] => matches!(
|
||||
name.to_str(),
|
||||
Some("HEAD" | "index" | "config.worktree" | "gitdir" | "commondir" | "locked" | "refs")
|
||||
),
|
||||
[_, first, ..] => *first == "refs",
|
||||
}
|
||||
}
|
||||
|
||||
/// Directories below `.git/worktrees` that need a watch: the worktree entries and their refs.
|
||||
fn watch_worktree_dir(parts: &[&OsStr]) -> bool {
|
||||
matches!(parts, [] | [_]) || matches!(parts, [_, first, ..] if *first == "refs")
|
||||
/// Relative to `.git/worktrees`: the first component is the worktree ID. Even read-only
|
||||
/// Git queries create fsmonitor cookies; reporting those would schedule another query.
|
||||
fn watch_worktree_entry(parts: &[&OsStr]) -> bool {
|
||||
!matches!(parts, [_, name, ..] if *name == "fsmonitor--daemon" || *name == "fsmonitor--daemon.ipc")
|
||||
}
|
||||
|
||||
/// `Some(true)` for interesting VCS metadata, `Some(false)` for other `.git`
|
||||
@@ -830,7 +815,7 @@ impl EventFilter {
|
||||
let metadata = *first == "refs"
|
||||
// Linked-worktree gitdirs: a worktree added or removed below
|
||||
// the project writes its HEAD here.
|
||||
|| (*first == "worktrees" && Self::worktree_metadata(parts));
|
||||
|| (*first == "worktrees" && Self::watch_worktree_entry(parts));
|
||||
metadata && !rest.last().is_some_and(|l| l.to_string_lossy().ends_with(".lock"))
|
||||
}
|
||||
// The `.git` path itself: a linked worktree's `.git` is a plain
|
||||
@@ -863,7 +848,7 @@ impl EventFilter {
|
||||
return match rest.as_slice() {
|
||||
[] => true,
|
||||
[first, ..] if *first == "refs" => true,
|
||||
[first, parts @ ..] if *first == "worktrees" => Self::watch_worktree_dir(parts),
|
||||
[first, parts @ ..] if *first == "worktrees" => Self::watch_worktree_entry(parts),
|
||||
[only] => *only == "info",
|
||||
_ => false,
|
||||
};
|
||||
@@ -1517,13 +1502,6 @@ mod tests {
|
||||
// Linked-worktree gitdir metadata below the main repository.
|
||||
assert_eq!(g(".git/worktrees/wt/HEAD"), Some(true));
|
||||
assert_eq!(g(".git/worktrees/wt/index.lock"), Some(false));
|
||||
for path in ["index", "config.worktree", "gitdir", "commondir", "locked", "refs", "refs/bisect/bad"] {
|
||||
assert_eq!(g(&format!(".git/worktrees/wt/{path}")), Some(true), "{path}");
|
||||
}
|
||||
// Scratch files Git and the IDE write during read-only queries.
|
||||
for path in ["openidea-index-1-2", "openidea-partial-index", "logs/HEAD", "ORIG_HEAD", "rebase-merge/done"] {
|
||||
assert_eq!(g(&format!(".git/worktrees/wt/{path}")), Some(false), "{path}");
|
||||
}
|
||||
// The depth-1 directories themselves: `git init` or the first
|
||||
// `git worktree add` creates them in an already-watched gitdir.
|
||||
assert_eq!(g(".git/refs"), Some(true));
|
||||
@@ -1741,8 +1719,7 @@ mod tests {
|
||||
assert!(!w(".git/objects") && !w(".git/objects/ab") && !w(".git/logs"));
|
||||
// Linked-worktree gitdirs are watched so worktrees added below the
|
||||
// project while it is open are discovered.
|
||||
assert!(w(".git/worktrees") && w(".git/worktrees/wt") && w(".git/worktrees/wt/refs/bisect"));
|
||||
assert!(!w(".git/worktrees/wt/rebase-merge") && !w(".git/worktrees/wt/logs"));
|
||||
assert!(w(".git/worktrees") && w(".git/worktrees/wt") && w(".git/worktrees/wt/rebase-merge"));
|
||||
assert!(!filter.should_watch_dir(Path::new("/elsewhere")));
|
||||
// Excludes are replaced in place (Watcher::set_excludes).
|
||||
*filter.excludes.write() = ExcludeMatcher::new(&["gen".into()]);
|
||||
|
||||
@@ -3,11 +3,11 @@ title: "UI guidelines"
|
||||
description: "Rules for frontend UI code: design tokens, CSS Modules, icons, the UI primitives, accessibility and WebKit compatibility."
|
||||
---
|
||||
|
||||
The visual style is dark, low-contrast greys and one cool accent. Consistency comes from a small set of rules that apply to every component.
|
||||
The visual style is the JetBrains new UI in its Islands form: rounded content islands on a grey frame, low-contrast greys and one cool accent. Islands Light is the default theme, and Islands Dark, High Contrast and the Solarized themes set the same tokens. Consistency comes from a small set of rules that apply to every component.
|
||||
|
||||
## Design tokens
|
||||
|
||||
[`src/styles/tokens.css`](https://github.com/l0ng-ai/openidea/blob/main/src/styles/tokens.css) is the source of truth for colours and metrics (spacing, sizes, radii, font weights). `:root` holds the dark theme; `[data-theme="light"]` and `[data-theme="dark-hc"]` (high contrast) override it. Themes from plugins and colour-scheme settings set the same variables at runtime.
|
||||
[`src/styles/tokens.css`](https://github.com/l0ng-ai/openidea/blob/main/src/styles/tokens.css) is the source of truth for colours and metrics (spacing, sizes, radii, font weights). `:root` holds the dark theme; `[data-theme="light"]` (the default) and `[data-theme="dark-hc"]` (high contrast) override it. Themes from plugins and colour-scheme settings set the same variables at runtime.
|
||||
|
||||
- **Use only tokens in components.** No hex, `rgb()` or named colour literals in a component's CSS or inline styles: `color: var(--fg-muted)`, not `color: #8c8c8c`.
|
||||
- **Need a new colour or metric?** Add a token to `tokens.css` for every theme variant, with a name that says what it is for, not what it looks like.
|
||||
|
||||
@@ -5,12 +5,6 @@ description: "Carets and selections, line editing, the clipboard history, foldin
|
||||
|
||||
The editor follows IntelliJ IDEA's behaviour and default keymap. Shortcuts below are the defaults of the **macOS** keymap on macOS and the **Windows** keymap on Windows and Linux; you can change any of them in **Settings › Keymap** (see [Keymaps](/en/guide/keymap)). Every command is also available from **Find Action** (`⇧⌘A` / `Ctrl+Shift+A`).
|
||||
|
||||
## Browse a local development server
|
||||
|
||||
In a trusted local project, use **Find Action › Open Local Browser**. Enter a loopback HTTP or HTTPS URL, then choose **Open**. Links, **Back**, **Forward**, and **Reload** operate on the page in the panel. Hiding the panel preserves the page and its history; **Close** ends the session. Navigation stays on the original origin. To switch development servers or ports, close the session and open the new address.
|
||||
|
||||
Choose **Inspect Element**, then click an element in the page. Review its selector, opening tag and styles before choosing **Add to Agent Draft**. This appends to the draft without sending it. Press **Escape** in the page to return to normal browsing without selecting anything.
|
||||
|
||||
## Carets and selections
|
||||
|
||||
| Action | macOS | Windows / Linux |
|
||||
@@ -51,11 +45,8 @@ Choose **Inspect Element**, then click an element in the page. Review its select
|
||||
| **Unwrap/Remove…** | `⇧⌘⌦` | `Ctrl+Shift+Delete` |
|
||||
| **Move Caret to Matching Brace** | `⌃M` | `Ctrl+Shift+M` |
|
||||
| **Move Caret to Code Block Start** / **End** | `⌥⌘[` / `⌥⌘]` | `Ctrl+[` / `Ctrl+]` |
|
||||
| **Move Caret to Page Top** / **Bottom** | `⌘⇞` / `⌘⇟` | `Ctrl+PageUp` / `Ctrl+PageDown` |
|
||||
| **Toggle Insert/Overwrite** | `Insert` | `Insert` |
|
||||
|
||||
**Move Caret to Page Top** / **Bottom** put the caret on the first / last line the editor shows in full, in the same column, without scrolling; with `⇧` / `Shift` added they select up to it.
|
||||
|
||||
**Edit › Sort Lines** and **Edit › Reverse Lines** reorder the selected lines (the whole file without a selection); they have no default shortcut. Sort Lines orders by character code, so uppercase letters come before lowercase ones.
|
||||
|
||||
**Duplicate Entire Lines** copies every line touched by a caret or selection below itself, even when only part of a line is selected, and keeps the selection on the copy. It has no default shortcut; run it from **Find Action** or assign one in **Settings › Keymap**.
|
||||
@@ -120,8 +111,6 @@ To format on every save, enable **Reformat code** (and optionally **Optimize imp
|
||||
|
||||
**Window › Editor Tabs** also has **Pin Tab**, **Close Other Tabs**, **Close All Tabs** and **Reopen Closed Tab**, all without default shortcuts. **Window › Move Tab to New Window** detaches the current tab into its own window.
|
||||
|
||||
The tab context menu's **Close Unmodified Tabs**, **Close All but Pinned**, **Close Tabs to the Left**, **Close Tabs to the Right** and **Close All Read-Only Tabs** are also actions on the current tab and its group: run them from **Find Action** or assign a shortcut in **Settings › Keymap**. Pinned tabs stay open.
|
||||
|
||||
Tab placement, the tab limit and what happens when it is reached, the preview tab, sorting, and which tab is activated after one closes are set in **Settings › Editor › General › Editor Tabs**.
|
||||
|
||||
With tabs placed left or right, the tab column is as wide as its longest name, up to a limit. Drag the column's inner edge (or focus it and press `←` / `→`) to change the limit; it applies to every editor group and is remembered.
|
||||
|
||||
@@ -18,8 +18,8 @@ Showing an empty Terminal window opens a tab in the start directory (the project
|
||||
|
||||
- **+** (**New Tab**) opens a tab with the default shell.
|
||||
- The **▾** button (**More Terminal Options**) has **New Terminal Tab**, **New Predefined Session** (one entry per installed shell, plus **SSH Session…**), **Split Right**, **Split Down** and **Settings**.
|
||||
- Right-click a tab for **Rename Session…**, **Move to Editor**, **Close Tab**, **Close Other Tabs**, **Split Right**, **Split and Move Right**, **Split Down**, **Split and Move Down** and **Unsplit**. Double-clicking a tab also renames it.
|
||||
- Drag tabs to reorder them, drop a tab on the edge of another group to split, or drag a tab into an editor group (or its edge) to keep the session running as an editor tab.
|
||||
- Right-click a tab for **Rename Session…**, **Close Tab**, **Close Other Tabs**, **Split Right**, **Split and Move Right**, **Split Down**, **Split and Move Down** and **Unsplit**. Double-clicking a tab also renames it.
|
||||
- Drag tabs to reorder them, or drop a tab on the edge of another group to split.
|
||||
|
||||
A tab is named after your custom name, otherwise after the program running in it (when the shell reports it), otherwise `Local`, `Local (2)` and so on. A spinner shows while a command runs; **Exited** or **Failed** shows once the session ends.
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ title: "UI 规范"
|
||||
description: "前端 UI 代码的规则:设计 token、CSS Modules、图标、UI 基础组件、无障碍以及 WebKit 兼容性。"
|
||||
---
|
||||
|
||||
视觉风格是深色、低对比度的灰阶,加一种冷色强调色。一致性靠一小组适用于所有组件的规则来保证。
|
||||
视觉风格是 JetBrains 新 UI 的 Islands 形态:灰色底框上的圆角内容岛、低对比度的灰阶,加一种冷色强调色。默认主题是 Islands Light,Islands Dark、High Contrast 和 Solarized 主题使用同一套 token。一致性靠一小组适用于所有组件的规则来保证。
|
||||
|
||||
## 设计 token
|
||||
|
||||
[`src/styles/tokens.css`](https://github.com/l0ng-ai/openidea/blob/main/src/styles/tokens.css) 是颜色和尺寸(间距、大小、圆角、字重)的唯一来源。`:root` 是深色主题,`[data-theme="light"]` 和 `[data-theme="dark-hc"]`(高对比度)在其上覆盖。插件主题和配色设置在运行时改写的也是这些变量。
|
||||
[`src/styles/tokens.css`](https://github.com/l0ng-ai/openidea/blob/main/src/styles/tokens.css) 是颜色和尺寸(间距、大小、圆角、字重)的唯一来源。`:root` 是深色主题,`[data-theme="light"]`(默认主题)和 `[data-theme="dark-hc"]`(高对比度)在其上覆盖。插件主题和配色设置在运行时改写的也是这些变量。
|
||||
|
||||
- **组件里只用 token。** 组件的 CSS 或内联样式中不出现十六进制、`rgb()` 或颜色名字面量:写 `color: var(--fg-muted)`,不写 `color: #8c8c8c`。
|
||||
- **需要新的颜色或尺寸?** 在 `tokens.css` 里为每个主题变体都加上 token,名字说明用途,而不是描述外观。
|
||||
|
||||
@@ -5,12 +5,6 @@ description: "多光标与选区、行编辑、剪贴板历史、代码折叠、
|
||||
|
||||
编辑器的行为和默认快捷键沿用 IntelliJ IDEA。下文的快捷键在 macOS 上是 **macOS** 键位映射的默认值,在 Windows 和 Linux 上是 **Windows** 键位映射的默认值;任何一个都可以在 **设置 › 按键映射** 中修改(见 [键位映射](/zh/guide/keymap))。所有命令也都能在 **查找操作**(`⇧⌘A` / `Ctrl+Shift+A`)里找到。
|
||||
|
||||
## 浏览本地开发服务器
|
||||
|
||||
在受信任的本地项目中,选择**查找操作 › 打开本地浏览器**。输入指向本机回环地址的 HTTP 或 HTTPS 网址,点击**打开**。可以直接在面板中点击链接、后退、前进和重新加载。隐藏面板会保留页面和浏览历史;点击**关闭**才会结束会话。浏览范围限于原来的源;如需切换开发服务器或端口,请先关闭会话,再打开新地址。
|
||||
|
||||
点击**检查元素**,然后在页面中点选元素。确认选择器、起始标签和样式后,可将其添加到 Agent 草稿,不会自动发送。在页面中按 **Escape** 可退出检查并继续浏览。
|
||||
|
||||
## 光标与选区
|
||||
|
||||
| 操作 | macOS | Windows / Linux |
|
||||
@@ -51,11 +45,8 @@ description: "多光标与选区、行编辑、剪贴板历史、代码折叠、
|
||||
| **解包/移除…** | `⇧⌘⌦` | `Ctrl+Shift+Delete` |
|
||||
| **将文本光标移至匹配的大括号** | `⌃M` | `Ctrl+Shift+M` |
|
||||
| **将光标移至代码块开头** / **末尾** | `⌥⌘[` / `⌥⌘]` | `Ctrl+[` / `Ctrl+]` |
|
||||
| **将光标移至页面顶部** / **底部** | `⌘⇞` / `⌘⇟` | `Ctrl+PageUp` / `Ctrl+PageDown` |
|
||||
| **切换插入/改写** | `Insert` | `Insert` |
|
||||
|
||||
**将光标移至页面顶部** / **底部** 把光标放到编辑器完整显示的第一行 / 最后一行,保持所在列,不滚动视图;再加上 `⇧` / `Shift` 则选择到该处。
|
||||
|
||||
**编辑 › 对行排序** 和 **编辑 › 反转行** 对选中的行(没有选区时为整个文件)重新排序,默认没有快捷键。对行排序按字符编码排序,大写字母排在小写字母之前。
|
||||
|
||||
**复制整行** 把光标或选区涉及的每一行完整复制到其下方(即使只选中了行的一部分),并让选区落在副本上。它默认没有快捷键,可在查找操作中运行,或在 **设置 › 按键映射** 中分配快捷键。
|
||||
@@ -120,8 +111,6 @@ description: "多光标与选区、行编辑、剪贴板历史、代码折叠、
|
||||
|
||||
**窗口 › 编辑器标签页** 中还有 **固定标签页**、**关闭其他标签页**、**关闭所有标签页** 和 **重新打开已关闭的标签页**,默认都没有快捷键。在查找操作中运行 **将标签页移到新窗口**,可以把当前标签页拆到一个独立窗口。
|
||||
|
||||
标签页右键菜单中的 **关闭未修改的标签页**、**关闭除已固定外的所有标签页**、**关闭左侧标签页**、**关闭右侧标签页** 和 **关闭所有只读标签页** 也是作用于当前标签页及其所在组的操作:可在查找操作中运行,或在 **设置 › 按键映射** 中分配快捷键。已固定的标签页会保留。
|
||||
|
||||
标签页的位置、数量上限以及达到上限后的处理方式、预览标签页、排序方式,以及关闭标签页后激活哪一个,都在 **设置 › 编辑器 › 常规 › 编辑器标签页** 中设置。
|
||||
|
||||
标签页放在左侧或右侧时,标签页列的宽度随最长的名称变化,但不超过一个上限。拖动该列靠近编辑器的边缘(或聚焦后按 `←` / `→`)可以调整上限;调整对所有编辑器组生效,并会被记住。
|
||||
|
||||
@@ -18,8 +18,8 @@ description: "使用内置终端:标签页、拆分、Shell、链接、查找
|
||||
|
||||
- **+**(**新建标签页**)用默认 Shell 打开一个标签页。
|
||||
- **▾** 按钮(**更多终端选项**)包含 **新建终端标签页**、**新建预定义会话**(每个已安装的 Shell 一项,另有 **SSH 会话…**)、**向右拆分**、**向下拆分** 和 **设置**。
|
||||
- 右键标签页可以 **重命名会话…**、**移至编辑器**、**关闭标签页**、**关闭其他标签页**、**向右拆分**、**向右拆分并移动**、**向下拆分**、**向下拆分并移动**、**取消拆分**。双击标签页也能重命名。
|
||||
- 拖动标签页可以调整顺序,拖到另一组的边缘会拆分;拖入编辑器分组(或其边缘)则会带着正在运行的会话作为编辑器标签页打开。
|
||||
- 右键标签页可以 **重命名会话…**、**关闭标签页**、**关闭其他标签页**、**向右拆分**、**向右拆分并移动**、**向下拆分**、**向下拆分并移动**、**取消拆分**。双击标签页也能重命名。
|
||||
- 拖动标签页可以调整顺序,拖到另一组的边缘则会拆分。
|
||||
|
||||
标签页名称优先用你设置的名字,其次是 Shell 报告的正在运行的程序名,否则就是 `本地`、`本地 (2)` 等默认名称。命令运行时标签上会显示转圈图标,会话结束后显示 **已退出** 或 **失败**。
|
||||
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, ipcCalls, stubDesktop, test } from "./fixtures";
|
||||
|
||||
const script = readFileSync(new URL("../src-tauri/src/browser_picker/element.js", import.meta.url), "utf8");
|
||||
const element = {
|
||||
selector: "main:nth-of-type(1) > button:nth-of-type(2)",
|
||||
html: '<button aria-disabled="true">',
|
||||
styles: "display: inline-flex;\nposition: relative;\nvisibility: visible;\npointer-events: none;",
|
||||
};
|
||||
|
||||
test("a trusted gesture captures structure without page text or form values", async ({ page }) => {
|
||||
await page.addInitScript({
|
||||
content: `window.ipc = { postMessage(value) { window.lastSignal = value; } };\n${script}`,
|
||||
});
|
||||
await page.route("http://localhost:3000/**", (route) =>
|
||||
route.fulfill({
|
||||
contentType: "text/html",
|
||||
body: '<main><input type="password" value="fixture-password"><button>First</button><button disabled data-note="fixture-note" style="display:inline-flex">Fixture customer</button></main><iframe srcdoc="<p>Frame</p>"></iframe>',
|
||||
}),
|
||||
);
|
||||
await page.goto("http://localhost:3000/sample?key=fixture-key");
|
||||
const button = page.getByRole("button", { name: "Fixture customer" });
|
||||
await page.getByRole("button", { name: "First" }).click();
|
||||
expect(await page.evaluate("window.__openideaPickedElement")).toBeNull();
|
||||
await page.evaluate("window.__openideaInspect(true)");
|
||||
await button.dispatchEvent("pointerdown", { isPrimary: true, button: 0 });
|
||||
expect(await page.evaluate("window.__openideaPickedElement")).toBeNull();
|
||||
expect(await page.frames()[1]!.evaluate("window.__openideaPickedElement")).toBeUndefined();
|
||||
const rect = await button.boundingBox();
|
||||
await page.mouse.click(rect!.x + 4, rect!.y + 4);
|
||||
const picked = await page.evaluate(() => String(Reflect.get(window, "__openideaPickedElement")));
|
||||
expect(await page.evaluate("window.lastSignal")).toBe("picked");
|
||||
expect(JSON.parse(picked)).toMatchObject({
|
||||
path: [
|
||||
{ tag: "html", index: 1 },
|
||||
{ tag: "body", index: 1 },
|
||||
{ tag: "main", index: 1 },
|
||||
{ tag: "button", index: 2 },
|
||||
],
|
||||
disabled: true,
|
||||
display: "inline-flex",
|
||||
});
|
||||
expect(picked).not.toMatch(/fixture-|Fixture customer|First/);
|
||||
});
|
||||
|
||||
async function openBrowser(page: Page) {
|
||||
await page.evaluate(async () => {
|
||||
const actions = "/src/platform/actions.ts";
|
||||
await (await import(actions)).executeAction("web.inspectLocalPage");
|
||||
});
|
||||
await expect(page.getByRole("textbox", { name: "Local page URL" })).toBeVisible();
|
||||
}
|
||||
|
||||
async function stubBrowser(page: Page) {
|
||||
await page.evaluate((snapshot) => {
|
||||
let history: string[] = [],
|
||||
index = 0,
|
||||
inspecting = false;
|
||||
window.__ipc.handlers.cancel_request = () => null;
|
||||
window.__ipc.handlers.web_browser_open = ({ url }) => {
|
||||
history = [String(url)];
|
||||
index = 0;
|
||||
};
|
||||
window.__ipc.handlers.web_browser_control = ({ action }) => {
|
||||
const command = action as { type: string; url: string };
|
||||
let element = null;
|
||||
switch (command.type) {
|
||||
case "navigate":
|
||||
history.splice(++index, Infinity, command.url);
|
||||
break;
|
||||
case "back":
|
||||
index--;
|
||||
break;
|
||||
case "forward":
|
||||
index++;
|
||||
break;
|
||||
case "inspect":
|
||||
inspecting = true;
|
||||
break;
|
||||
case "cancel":
|
||||
inspecting = false;
|
||||
break;
|
||||
case "status":
|
||||
if (inspecting && !document.body.hasAttribute("data-hold-pick")) {
|
||||
inspecting = false;
|
||||
element = snapshot;
|
||||
}
|
||||
}
|
||||
return { url: history[index], canBack: index > 0, canForward: index + 1 < history.length, inspecting, element };
|
||||
};
|
||||
}, element);
|
||||
}
|
||||
|
||||
async function visit(page: Page, url: string) {
|
||||
await page.getByLabel("Local page URL").fill(url);
|
||||
await page.getByRole("region", { name: "Browser" }).getByRole("button", { name: "Open", exact: true }).click();
|
||||
}
|
||||
|
||||
for (const key of ["home", "checkout-task"]) {
|
||||
test(`review appends to the ${key === "home" ? "new" : "active"} Codex task draft`, async ({
|
||||
workbench: page,
|
||||
}, info) => {
|
||||
await stubDesktop(page);
|
||||
await stubBrowser(page);
|
||||
await page.evaluate(async (key) => {
|
||||
const storePath = "/src/features/agents/store.ts";
|
||||
const store = await import(storePath);
|
||||
const task = {
|
||||
id: key,
|
||||
title: "Checkout review",
|
||||
provider: "codex",
|
||||
status: "ready",
|
||||
isolation: "local",
|
||||
model: null,
|
||||
cwd: "/dev/acme-api",
|
||||
branch: null,
|
||||
base: null,
|
||||
baseCommit: null,
|
||||
error: null,
|
||||
createdMs: 0,
|
||||
updatedMs: 0,
|
||||
config: [],
|
||||
commands: [],
|
||||
usage: null,
|
||||
queue: [],
|
||||
};
|
||||
store.useAgents.setState({
|
||||
loaded: true,
|
||||
sessionLocation: key === "home" ? "editor" : "toolWindow",
|
||||
...(key === "home"
|
||||
? {}
|
||||
: { tasks: new Map([[key, task]]), entries: new Map([[key, []]]), docked: key, homeOpen: false }),
|
||||
draft: { provider: "codex", config: {}, isolation: "local", base: null },
|
||||
});
|
||||
store.updateComposer(key, {
|
||||
text: "Why is the checkout button disabled?",
|
||||
files: [{ path: "/dev/acme-api/README.md", rel: "README.md", attached: true }],
|
||||
});
|
||||
}, key);
|
||||
await openBrowser(page);
|
||||
await visit(page, "http://localhost:3000");
|
||||
await page.getByRole("button", { name: "Inspect Element", exact: true }).click();
|
||||
await expect(page.getByRole("heading", { name: "Selected element" })).toBeVisible();
|
||||
await expect(page.getByText(element.html, { exact: false })).toBeVisible();
|
||||
await page.screenshot({ path: info.outputPath("preview.png"), animations: "disabled" });
|
||||
await page.getByRole("button", { name: "Add to Agent Draft" }).click();
|
||||
const box = page.getByRole("textbox", { name: "Message", exact: true });
|
||||
await expect(box).toBeVisible();
|
||||
const draft = await page.evaluate(async (key) => {
|
||||
const storePath = "/src/features/agents/store.ts";
|
||||
const store = await import(storePath);
|
||||
return {
|
||||
...store.composerDraft(key),
|
||||
provider:
|
||||
key === "home"
|
||||
? store.useAgents.getState().draft.provider
|
||||
: store.useAgents.getState().tasks.get(key)?.provider,
|
||||
};
|
||||
}, key);
|
||||
expect(draft).toMatchObject({
|
||||
text: expect.stringContaining("Why is the checkout button disabled?\n\n"),
|
||||
files: [{ path: "/dev/acme-api/README.md", rel: "README.md", attached: true }],
|
||||
provider: "codex",
|
||||
});
|
||||
expect(draft.text).toContain(element.selector);
|
||||
expect(draft.text).toContain(element.html);
|
||||
expect(draft.text).toContain(element.styles);
|
||||
await expect(box).toBeEditable();
|
||||
await page.screenshot({ path: info.outputPath("draft.png"), animations: "disabled" });
|
||||
expect(await ipcCalls(page, "agent_prompt")).toEqual([]);
|
||||
expect(await ipcCalls(page, "agent_create")).toEqual([]);
|
||||
});
|
||||
}
|
||||
|
||||
test("cancelling or revoking trust discards a delayed selection", async ({ workbench: page }) => {
|
||||
await stubDesktop(page);
|
||||
await stubBrowser(page);
|
||||
await page.evaluate(() => document.body.setAttribute("data-hold-pick", ""));
|
||||
await openBrowser(page);
|
||||
await visit(page, "http://localhost:3000");
|
||||
const inspect = page.getByRole("button", { name: "Inspect Element", exact: true });
|
||||
await inspect.click();
|
||||
await page.getByRole("button", { name: "Cancel", exact: true }).click();
|
||||
await expect(inspect).toBeEnabled();
|
||||
await expect(page.getByRole("button", { name: "Add to Agent Draft" })).toHaveCount(0);
|
||||
await inspect.click();
|
||||
await page.evaluate(async () => {
|
||||
const projectPath = "/src/platform/project.ts";
|
||||
const { useProject } = await import(projectPath);
|
||||
useProject.setState({ project: { ...useProject.getState().project, trusted: false } });
|
||||
});
|
||||
await expect(page.getByText("Element inspection requires a trusted local project.")).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Add to Agent Draft" })).toHaveCount(0);
|
||||
expect(await ipcCalls(page, "cancel_request")).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("navigates the same session and keeps native history until Close", async ({ workbench: page }) => {
|
||||
await stubDesktop(page);
|
||||
await stubBrowser(page);
|
||||
await openBrowser(page);
|
||||
const panel = page.getByRole("region", { name: "Browser" });
|
||||
const address = panel.getByLabel("Local page URL");
|
||||
await visit(page, "http://localhost:3000/first");
|
||||
await expect(panel.getByRole("button", { name: "Back", exact: true })).toBeDisabled();
|
||||
await visit(page, "http://localhost:3000/next");
|
||||
await page.evaluate(async () => {
|
||||
const path = "/src/workbench/contributions.ts";
|
||||
(await import(path)).toolWindowService().hide("browser");
|
||||
});
|
||||
await expect(panel).toBeHidden();
|
||||
await openBrowser(page);
|
||||
await panel.getByRole("button", { name: "Back", exact: true }).click();
|
||||
await expect(address).toHaveValue("http://localhost:3000/first");
|
||||
await panel.getByRole("button", { name: "Forward", exact: true }).click();
|
||||
await expect(address).toHaveValue("http://localhost:3000/next");
|
||||
await panel.getByRole("button", { name: "Reload", exact: true }).click();
|
||||
expect(await ipcCalls(page, "web_browser_open")).toHaveLength(1);
|
||||
await panel.getByRole("button", { name: "Close", exact: true }).click();
|
||||
await expect(panel.getByRole("button", { name: "Reload", exact: true })).toHaveCount(0);
|
||||
expect(await ipcCalls(page, "cancel_request")).toHaveLength(1);
|
||||
});
|
||||
+1
-109
@@ -1,4 +1,4 @@
|
||||
import { expect, stubDesktop, test } from "./fixtures";
|
||||
import { expect, test } from "./fixtures";
|
||||
|
||||
test("terminal output menu groups session, clipboard and split actions and opens Find", async ({ workbench: page }) => {
|
||||
await page.evaluate(async () => {
|
||||
@@ -360,111 +360,3 @@ test("terminal composition follows a drawn caret inside the session", async ({ w
|
||||
})
|
||||
.toBe(true);
|
||||
});
|
||||
|
||||
test("dragging terminal tabs into editor strips and split edges preserves live sessions and scrollback", async ({
|
||||
workbench: page,
|
||||
}) => {
|
||||
await stubDesktop(page);
|
||||
await page.evaluate(async () => {
|
||||
const handlers = window.__ipc.handlers;
|
||||
let id = 0;
|
||||
const killed: number[] = [];
|
||||
(window as unknown as { __killedPtys: number[] }).__killedPtys = killed;
|
||||
handlers.term_default_shell = () => "/bin/zsh";
|
||||
handlers.term_available_shells = () => ["/bin/zsh"];
|
||||
handlers.term_spawn = () => ({ id: ++id, title: "zsh", pid: id });
|
||||
handlers.term_resize = () => null;
|
||||
handlers.term_write = () => null;
|
||||
handlers.term_is_busy = () => false;
|
||||
handlers.term_kill = (args: unknown) => {
|
||||
killed.push((args as { id: number }).id);
|
||||
return null;
|
||||
};
|
||||
|
||||
const contributions = "/src/workbench/contributions.ts";
|
||||
const editor = (await import(contributions)).editorService();
|
||||
await editor.openFile("/dev/acme-api/App.tsx", { focus: false });
|
||||
await editor.openFile("/dev/acme-api/README.md", { focus: false });
|
||||
const store = "/src/workbench/toolwindows/store.ts";
|
||||
const layout = await import(store);
|
||||
layout.setToolWindowSize("bottom", 240);
|
||||
layout.showToolWindow("terminal", true);
|
||||
});
|
||||
|
||||
const terminal = page.getByRole("region", { name: "Terminal", exact: true });
|
||||
await expect(terminal.locator(".xterm-helper-textarea")).toBeFocused();
|
||||
|
||||
// Open a second terminal tab and write distinct output into both sessions.
|
||||
await terminal.getByRole("button", { name: "New Tab", exact: true }).click();
|
||||
const termStrip = terminal.getByRole("tablist", { name: "Terminal sessions" });
|
||||
await expect(termStrip.getByRole("tab")).toHaveCount(2);
|
||||
|
||||
await page.evaluate(async () => {
|
||||
const store = "/src/features/terminal/store.ts";
|
||||
const rt = await import(store);
|
||||
const [first, second] = rt.useTerminals.getState().tabs;
|
||||
const s1 = rt.getSession(first!.session)!;
|
||||
const s2 = rt.getSession(second!.session)!;
|
||||
await new Promise<void>((done) => s1.term.write("ALPHA-SESSION-OUTPUT\r\n", done));
|
||||
await new Promise<void>((done) => s2.term.write("BETA-TEST-RUNNER\r\n", done));
|
||||
});
|
||||
|
||||
// 1) Drag "Local" into the editor tab strip between App.tsx and README.md.
|
||||
const localTab = termStrip.getByRole("tab", { name: "Local", exact: true });
|
||||
const readmeTab = page.getByRole("tablist", { name: "Editor tabs" }).getByRole("tab", { name: "README.md" });
|
||||
const from1 = (await localTab.boundingBox())!;
|
||||
const to1 = (await readmeTab.boundingBox())!;
|
||||
await page.mouse.move(from1.x + from1.width / 2, from1.y + from1.height / 2);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(to1.x + 6, to1.y + to1.height / 2, { steps: 8 });
|
||||
if (process.env.OPENIDEA_TERMINAL_SHOTS)
|
||||
await page.screenshot({
|
||||
path: `${process.env.OPENIDEA_TERMINAL_SHOTS}/after-strip-hover.png`,
|
||||
animations: "disabled",
|
||||
});
|
||||
await page.mouse.up();
|
||||
|
||||
const editorLists = page.getByRole("tablist", { name: "Editor tabs" });
|
||||
await expect(editorLists.first().getByRole("tab")).toHaveText(["App.tsx", "Local", "README.md"]);
|
||||
await expect(termStrip.getByRole("tab")).toHaveCount(1);
|
||||
|
||||
const editorArea = page.locator("[data-pane-id]");
|
||||
await expect(editorArea.locator(".xterm-rows")).toContainText("ALPHA-SESSION-OUTPUT");
|
||||
await expect(editorArea.locator(".xterm-helper-textarea")).toBeFocused();
|
||||
|
||||
// 2) Drag the remaining "Local (2)" onto the right edge of the editor pane to split it, hiding the empty tool window.
|
||||
const local2Tab = termStrip.getByRole("tab", { name: "Local (2)", exact: true });
|
||||
const paneBox = (await editorArea.first().locator('[role="tabpanel"]').boundingBox())!;
|
||||
const from2 = (await local2Tab.boundingBox())!;
|
||||
await page.mouse.move(from2.x + from2.width / 2, from2.y + from2.height / 2);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(paneBox.x + paneBox.width - 20, paneBox.y + paneBox.height / 2, { steps: 8 });
|
||||
if (process.env.OPENIDEA_TERMINAL_SHOTS)
|
||||
await page.screenshot({
|
||||
path: `${process.env.OPENIDEA_TERMINAL_SHOTS}/after-split-hover.png`,
|
||||
animations: "disabled",
|
||||
});
|
||||
await page.mouse.up();
|
||||
|
||||
await expect(terminal).toBeHidden();
|
||||
await expect(editorArea).toHaveCount(2);
|
||||
await expect(editorArea.nth(1).locator(".xterm-rows")).toContainText("BETA-TEST-RUNNER");
|
||||
await expect(editorArea.nth(1).locator(".xterm-helper-textarea")).toBeFocused();
|
||||
|
||||
// 3) Resize the editor split divider and confirm both panes and the live PTY survive.
|
||||
const widthBefore = (await editorArea.nth(1).boundingBox())!.width;
|
||||
const divider = page.locator("[data-editor-area]").getByRole("separator");
|
||||
const divBox = (await divider.boundingBox())!;
|
||||
await page.mouse.move(divBox.x + divBox.width / 2, divBox.y + divBox.height / 2);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(divBox.x - 100, divBox.y + divBox.height / 2, { steps: 6 });
|
||||
await page.mouse.up();
|
||||
await expect.poll(async () => (await editorArea.nth(1).boundingBox())!.width).toBeGreaterThan(widthBefore + 50);
|
||||
await expect(editorArea.nth(1).locator(".xterm-rows")).toContainText("BETA-TEST-RUNNER");
|
||||
if (process.env.OPENIDEA_TERMINAL_SHOTS)
|
||||
await page.screenshot({
|
||||
path: `${process.env.OPENIDEA_TERMINAL_SHOTS}/after-final.png`,
|
||||
animations: "disabled",
|
||||
});
|
||||
expect(await page.evaluate(() => (window as unknown as { __killedPtys: number[] }).__killedPtys)).toEqual([]);
|
||||
});
|
||||
@@ -432,12 +432,6 @@ are always available. Calling a gated function without its capability returns
|
||||
API 1.16.0 is in development on `main`. Use `engines.openidea = "^1.16"` and the
|
||||
matching SDK. Plugins for 1.15 and earlier keep working. New in 1.16:
|
||||
|
||||
- `Project::vcs_repository_at(path)` returns the mapped worktree owning an existing project file
|
||||
or directory, its repository-relative path, branch, commit, upstream, ahead count and sanitized
|
||||
remotes, or `None` outside Git. The innermost root wins, including for the worktree directory
|
||||
itself. It requires `vcs.read` and trust. `Project::vcs_roots()` lists the possible roots
|
||||
without choosing one on the user's behalf.
|
||||
|
||||
- `host::pick_file(title, &dialog)` lets an interactive command or view event choose an existing file
|
||||
or a save destination. The path belongs to the host running the project, including in remote windows.
|
||||
See [File selection](#file-selection-api-116).
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
657eb2ab2d2c0e1bffa6e5852af883d38a507341bc2d9c5879717ccaef6a4100
|
||||
ebbb9ce6869a540c782bfb6c38e918bfac342571d909deeae307a4ed93491a85
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
cab71634347487537f5310bdcb883482e94387707d57dd3eb271be378186dfff
|
||||
4a7199396c05dcb26810332beae3c4e20d54d5c0c04f9e982051a7920160640f
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
a802ccc1608628f2e97d91b5e4ba3f0d77b8addffdb7ada532d52b089c878b72
|
||||
4e69aee5ba09bc2cd142489b283d881b443e73371f9bcc9dee5d4328b7c67ab9
|
||||
Loaded 100 of 219 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user