From aa7830f01a41f0046218a7c0b60849e617e13917 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Thu, 2 Apr 2026 11:21:10 +0200 Subject: [PATCH] feat: update project settings UI for expanded instruction discovery - Show application mode badges (always/file/task/manual) on instruction cards - Display instruction name, description, and applyTo glob when present - Update section descriptions to reflect recursive scanning paths - Update empty states to list all discovery locations - Add InstructionModeBadge component for visual mode indicators Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../components/ProjectSettingsPanel.tsx | 69 ++++++++++++++++--- 1 file changed, 61 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/ProjectSettingsPanel.tsx b/src/renderer/components/ProjectSettingsPanel.tsx index d162a15..6d5fea2 100644 --- a/src/renderer/components/ProjectSettingsPanel.tsx +++ b/src/renderer/components/ProjectSettingsPanel.tsx @@ -5,7 +5,7 @@ import { ToggleSwitch } from '@renderer/components/ui'; import type { ProjectRecord, ProjectGitContext } from '@shared/domain/project'; import type { DiscoveredMcpServer } from '@shared/domain/discoveredTooling'; import { listAcceptedDiscoveredMcpServers, listPendingDiscoveredMcpServers } from '@shared/domain/discoveredTooling'; -import type { ProjectAgentProfile, ProjectInstructionFile, ProjectPromptFile } from '@shared/domain/projectCustomization'; +import type { ProjectAgentProfile, ProjectInstructionApplicationMode, ProjectInstructionFile, ProjectPromptFile } from '@shared/domain/projectCustomization'; /* ── Types ────────────────────────────────────────────────── */ @@ -335,7 +335,7 @@ function InstructionsContent({ return (
@@ -343,7 +343,7 @@ function InstructionsContent({ {instructions.length === 0 ? ( - No instruction files found. Add a .github/copilot-instructions.md or AGENTS.md file to your project root. + No instruction files found. Add .github/copilot-instructions.md, AGENTS.md, CLAUDE.md, or *.instructions.md files under .github/instructions/. ) : (
@@ -359,6 +359,7 @@ function InstructionsContent({ function InstructionCard({ instruction }: { instruction: ProjectInstructionFile }) { const [expanded, setExpanded] = useState(false); const isLong = instruction.content.length > 300; + const displayName = instruction.name ?? instruction.sourcePath; return (
@@ -368,13 +369,30 @@ function InstructionCard({ instruction }: { instruction: ProjectInstructionFile type="button" > - {instruction.sourcePath} +
+ {displayName} + + {instruction.applyTo && ( + + {instruction.applyTo} + + )} +
{expanded && (
+ {instruction.description && ( +

{instruction.description}

+ )} + {instruction.name && ( +

{instruction.sourcePath}

+ )}
             {instruction.content}
           
@@ -382,6 +400,9 @@ function InstructionCard({ instruction }: { instruction: ProjectInstructionFile )} {!expanded && (
+ {instruction.description && ( +

{instruction.description}

+ )}

{instruction.content}

@@ -391,6 +412,38 @@ function InstructionCard({ instruction }: { instruction: ProjectInstructionFile ); } +function InstructionModeBadge({ mode }: { mode: ProjectInstructionApplicationMode }) { + switch (mode) { + case 'always': + return ( + + always + + ); + case 'file': + return ( + + file + + ); + case 'task': + return ( + + task + + ); + case 'manual': + return ( + + manual + + ); + } +} + /* ── Custom Agents ────────────────────────────────────────── */ function AgentsContent({ @@ -407,7 +460,7 @@ function AgentsContent({ return (
@@ -415,7 +468,7 @@ function AgentsContent({ {agents.length === 0 ? ( - No custom agents found. Add .agent.md files to .github/agents/ in your project. + No custom agents found. Add .agent.md files under .github/agents/ in your project. ) : ( <> @@ -496,7 +549,7 @@ function PromptsContent({ return (
@@ -504,7 +557,7 @@ function PromptsContent({ {promptFiles.length === 0 ? ( - No prompt files found. Add .prompt.md files to .github/prompts/ in your project. + No prompt files found. Add .prompt.md files under .github/prompts/ in your project. ) : (