Skip to content

Conversation

@textGamex
Copy link
Member

No description provided.

@textGamex textGamex requested a review from XYY1411 July 1, 2025 10:06
@textGamex textGamex marked this pull request as ready for review July 10, 2025 16:31
@textGamex textGamex requested review from XYY1411 and Copilot and removed request for XYY1411 July 10, 2025 16:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a VS Code extension framework alongside backend tweaks to support a Vue-based UI, enhance logging, and enable cross‐origin requests.

  • Backend: Configures console logging format, bumps development log level to Debug, adds a CORS policy for the Vue app, and inserts a debug log in PackageController.
  • Extension scaffold: Sets up a Vite + Vue build, defines TypeScript types, implements a webview with PackageManager.vue, PackageDetails.vue, and a reusable ListBox.vue.
  • Tooling & docs: Adds tsconfig.json, ESLint rules, VS Code tasks/launch configs, a placeholder README, and the extension manifest.

Reviewed Changes

Copilot reviewed 26 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/ParadoxPM.Server/appsettings.json Added JSON console logger configuration
src/ParadoxPM.Server/appsettings.Development.json Changed default log level from Information to Debug
src/ParadoxPM.Server/Program.cs Registered CORS policy "AllowVueApp" and applied it
src/ParadoxPM.Server/Controllers/PackageController.cs Inserted a debug log for incoming package requests
src/ParadoxPM.Extension/vite.config.ts Configured Vite plugins for Vue and VSCode extension
src/ParadoxPM.Extension/tsconfig.json Established TypeScript compiler settings
src/ParadoxPM.Extension/src/types/packageInfo.ts Introduced PackageInfo, Version, Dependency
src/ParadoxPM.Extension/src/types/apiResponse.ts Introduced generic ApiResponse<T>
src/ParadoxPM.Extension/src/html/packageManager.html Added HTML template for the webview
src/ParadoxPM.Extension/src/entry/packageManager.ts Mounts Vue app to the webview container
src/ParadoxPM.Extension/src/components/PackageManager.vue Implements the main package-list UI
src/ParadoxPM.Extension/src/components/PackageDetails.vue Implements the package-detail UI
src/ParadoxPM.Extension/src/components/ListBox.vue Provides a generic list box with tooltip support
src/ParadoxPM.Extension/package.json Defines the VSCode extension manifest
src/ParadoxPM.Extension/extension/packagesManagerViewProvider.ts Registers the packages-manager view provider
src/ParadoxPM.Extension/extension/extension.ts Activates the extension
src/ParadoxPM.Extension/extension/WebviewHelpers.ts Supplies HTML for the webview
src/ParadoxPM.Extension/eslint.config.mjs Adds ESLint plugin/parser rules for TypeScript
src/ParadoxPM.Extension/README.md Placeholder README for the extension
src/ParadoxPM.Extension/.vscodeignore Specifies files to exclude in the packaged extension
src/ParadoxPM.Extension/.vscode/tasks.json Defines dev/build tasks
src/ParadoxPM.Extension/.vscode/settings.json Workspace settings overrides
src/ParadoxPM.Extension/.vscode/launch.json Debug configurations for extension development
src/ParadoxPM.Extension/.vscode/extensions.json Recommends VSCode extensions for editing
src/ParadoxPM.Extension/.npmrc Enables pre/post npm scripts
src/ParadoxPM.Extension/.gitignore Ignores dist/ builds
Comments suppressed due to low confidence (5)

src/ParadoxPM.Extension/src/html/packageManager.html:8

  • [nitpick] The page title "Traits" is misleading for a package manager view; consider updating it to something like "Package Manager".
	<title>Traits</title>

src/ParadoxPM.Extension/package.json:20

  • No activation events are specified, so the webview view provider may not be activated; add an entry like "onView:packages-manager" to ensure the extension loads when the view is opened.
  "activationEvents": [],

src/ParadoxPM.Extension/extension/extension.ts:5

  • [nitpick] The log message reference "ParadoxPM-Server" does not match the extension's display name ParadoxPM; update the string to avoid confusion.
  console.log('Congratulations, your extension "ParadoxPM-Server" is now active!');

src/ParadoxPM.Extension/extension/WebviewHelpers.ts:6

  • getHtml uses VITE_DEV_SERVER_URL without fallback for production builds; consider adding logic to load local asset HTML when the development server URL is undefined.
      serverUrl: `${process.env.VITE_DEV_SERVER_URL}src/html/${input}.html`,

src/ParadoxPM.Extension/README.md:1

  • README contains placeholder template content; update it to include actual project description, features, and usage instructions.
# ParadoxPM-Server README

[HttpGet("query/{packageId:int}/meta")]
public async Task<ActionResult<ApiResponse<Package>>> GetPackage(int packageId)
{
_logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取所有包");
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug log message says "请求获取所有包" (fetch all packages), but this endpoint returns a single package by ID; update the message to reflect the correct action.

Suggested change
_logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取所有包");
_logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取指定的包, Id: {packageId}");

Copilot uses AI. Check for mistakes.
<div class="container">
<div class="left-panel">
<div class="search-header">
<vscode-textfield class="search-box" placeholder="搜索包..." v-model="searchKeyword" @input="fetchPackages">
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling fetchPackages on every input event may trigger excessive API requests; consider debouncing the input handler.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +44
import { ref } from 'vue';
import type { PackageInfo } from '../types/packageInfo';
const selectedIndex = ref(0);
defineProps<{
package: PackageInfo | null
}>()
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the package prop changes, selectedIndex is not reset to 0, which can cause outdated or invalid version selections; add a watcher to reset selectedIndex when package updates.

Suggested change
import { ref } from 'vue';
import type { PackageInfo } from '../types/packageInfo';
const selectedIndex = ref(0);
defineProps<{
package: PackageInfo | null
}>()
import { ref, watch } from 'vue';
import type { PackageInfo } from '../types/packageInfo';
const selectedIndex = ref(0);
defineProps<{
package: PackageInfo | null
}>();
watch(() => package, () => {
selectedIndex.value = 0;
});

Copilot uses AI. Check for mistakes.
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [{
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint configuration targets only .ts files; consider adding rules or overrides for .vue files to ensure consistent linting across components.

Copilot uses AI. Check for mistakes.
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.

2 participants