Skip to content

Refactor#7

Merged
lee-sihun merged 37 commits intomasterfrom
refactor
Oct 1, 2025
Merged

Refactor#7
lee-sihun merged 37 commits intomasterfrom
refactor

Conversation

@lee-sihun
Copy link
Copy Markdown
Member

No description provided.

@lee-sihun lee-sihun requested a review from Copilot October 1, 2025 11:51
Copy link
Copy Markdown
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 represents a major refactor of the DM Note application, migrating from a mix of JavaScript and TypeScript to a fully TypeScript codebase with improved architecture and modern patterns.

Key Changes:

  • Complete migration from Webpack to Vite for faster development and build processes
  • Migration from React to Preact for improved performance and smaller bundle size
  • Comprehensive TypeScript implementation with proper type definitions and schema validation
  • Architectural improvements including domain-driven design patterns and centralized state management

Reviewed Changes

Copilot reviewed 93 out of 98 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
webpack.config.js.bak Removed legacy Webpack configuration
vite.config.ts New Vite configuration with Preact support and build analysis tools
tsconfig.main.json New TypeScript configuration for main process
src/types/*.ts New comprehensive type definitions with Zod validation schemas
src/renderer/windows/overlay/* Overlay window migration to TypeScript with improved architecture
src/renderer/windows/main/* Main window migration to TypeScript with context-based internationalization
src/renderer/stores/*.ts Migrated Zustand stores to TypeScript with proper typing
src/renderer/hooks/*.ts React hooks migrated to TypeScript with improved error handling
src/renderer/contexts/I18nContext.tsx New context-based internationalization system
src/renderer/components/**/* Component migrations to TypeScript with improved prop typing
src/main/**/*.ts Complete main process migration to TypeScript with domain architecture

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


const scene = new Transform();
sceneRef.current = scene;

Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The file ends with an empty line numbered 324 but should end at line 780 based on the diff. This suggests incomplete content or formatting issues.

Copilot uses AI. Check for mistakes.
? "opacity-0 animate-modal-fade"
: "opacity-100";
const contentAnimClass = animate ? "animate-modal-scale" : "";
const pointerDownInsideRef = useRef(false);
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The click handling logic using pointerDownInsideRef is complex and could be simplified. Consider using a more straightforward approach with event.stopPropagation() in the content area.

Copilot uses AI. Check for mistakes.
Comment on lines +367 to +374
function normalizeNoteColor(value) {
if (!value) return "#FFFFFF";
if (typeof value === "string") {
return value;
}
if (typeof value === "object" && value.type === "gradient") {
const top = normalizeNoteColor(value.top);
const bottom = normalizeNoteColor(value.bottom);
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The normalizeNoteColor function lacks proper TypeScript typing. The parameter should be typed and the return type should be specified for better type safety.

Suggested change
function normalizeNoteColor(value) {
if (!value) return "#FFFFFF";
if (typeof value === "string") {
return value;
}
if (typeof value === "object" && value.type === "gradient") {
const top = normalizeNoteColor(value.top);
const bottom = normalizeNoteColor(value.bottom);
type GradientNoteColor = {
type: "gradient";
top: NoteColor;
bottom: NoteColor;
};
type NoteColor = string | GradientNoteColor;
function normalizeNoteColor(value: unknown): NoteColor {
if (!value) return "#FFFFFF";
if (typeof value === "string") {
return value;
}
if (
typeof value === "object" &&
value !== null &&
(value as any).type === "gradient"
) {
const top = normalizeNoteColor((value as any).top);
const bottom = normalizeNoteColor((value as any).bottom);

Copilot uses AI. Check for mistakes.
fullscreenable: false,
// 렌더링 최적화
vibrancy: "under-window",
vibrancy: "under-window" as const,
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The vibrancy property is macOS-specific and should be conditionally applied based on the platform to avoid potential issues on Windows/Linux.

Suggested change
vibrancy: "under-window" as const,
...(process.platform === "darwin" ? { vibrancy: "under-window" as const } : {}),

Copilot uses AI. Check for mistakes.
@lee-sihun lee-sihun merged commit ce6d87f into master Oct 1, 2025
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