Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Implements editing for the currently selected project via the project switcher. Configuration keys are dynamically discovered from the /1.0/metadata/configuration endpoint per Incus documentation.

Changes

UI Components

  • Added "Edit Project" button in header, visible only when a specific project is selected
  • New EditProject dialog component with accordion-based configuration fields
  • Each config option displays key, description, and input field from metadata
  • Unsaved changes prompt on dialog close

API Integration

  • getProject(name): Fetch individual project details
  • updateProject(name, config, description): PATCH endpoint for project updates
  • useProject(name): SWR hook for project data fetching
  • Enhanced ConfigOption type with shortdesc, longdesc, defaultdesc fields from metadata

Data Flow

// Configuration options discovered dynamically
useConfigurableOptions()  /1.0/metadata/configuration
// Renders form fields based on metadata.configs.project

updateProject(name, config)  PATCH /1.0/projects/{name}
// Revalidates SWR cache for /1.0/projects?recursion=1

Error Handling

  • Consistent error response parsing (checks data.type === "error")
  • User-friendly toast notifications with context
  • Fallback UI when configuration metadata unavailable
  • Console logging for debugging

Files

  • app/(main)/_components/editProject.tsx - Main dialog (221 lines)
  • app/(main)/_components/header.tsx - Button integration
  • app/(main)/_hooks/project.ts - Individual project hook
  • app/(main)/_lib/projects.ts - API functions with JSDoc
  • app/_lib/server.d.ts - Enhanced type definitions

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: node /home/REDACTED/work/ararat-web/ararat-web/node_modules/.bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Project Editing</issue_title>
<issue_description>The ability to edit projects.

Should be an "edit project" button to edit the currently selected project using the project switcher dropdown.

See the Incus documentation for relevant configuration keys

These configuration keys should be discovered and displayed from the /1.0/metadata/configuration endpoint</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add edit project functionality with button Add project editing with dynamic configuration fields from Incus metadata Nov 20, 2025
Copilot AI requested a review from Hye-Dev November 20, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Editing

2 participants