Skip to content

[FEAT]Write page 구현 #12

Merged
psm1st merged 9 commits intomainfrom
psm@write
Jun 8, 2025
Merged

[FEAT]Write page 구현 #12
psm1st merged 9 commits intomainfrom
psm@write

Conversation

@psm1st
Copy link
Copy Markdown
Member

@psm1st psm1st commented Jun 8, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a new writing interface accessible to logged-in users, featuring a title input and multiple collapsible sections for structured content creation.
    • Added markdown editing capabilities within each section, supporting real-time content updates and preview.
    • Integrated React Query for enhanced state management and caching of draft content.
  • Chores
    • Updated the application title to "fixLog".
    • Added new dependencies for markdown editing, icons, and data fetching.

@psm1st psm1st linked an issue Jun 8, 2025 that may be closed by this pull request
@netlify
Copy link
Copy Markdown

netlify bot commented Jun 8, 2025

Deploy Preview for fixlog ready!

Name Link
🔨 Latest commit c973f22
🔍 Latest deploy log https://app.netlify.com/projects/fixlog/deploys/684570e80c3dfb00082cc65b
😎 Deploy Preview https://deploy-preview-12--fixlog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 8, 2025

Walkthrough

This update introduces a new protected /write route and a full-featured writing interface. It adds dependencies for markdown editing and React Query, integrates React Query at the app level, and implements new components for collapsible sections and markdown editing. The document title is also updated.

Changes

File(s) Change Summary
index.html Changed the <title> from "Vite + React + TS" to "fixLog".
package.json Added dependencies: @tanstack/react-query, @uiw/react-md-editor, and react-icons.
src/main.tsx Integrated React Query provider and imported markdown editor styles.
src/App.tsx Added /write route under RouteGuard, importing the new WritePage component.
src/components/write/Accordion.tsx Added new Accordion component for collapsible UI sections.
src/components/write/SectionEditor.tsx Added new SectionEditor component for markdown editing, using React Query for state management.
src/pages/WritePage/WritePage.tsx Added new WritePage component with editable title, tag prompt, and multiple collapsible section editors.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant RouteGuard
    participant WritePage
    participant Accordion
    participant SectionEditor
    participant ReactQuery

    User->>App: Navigate to /write
    App->>RouteGuard: Check authentication
    RouteGuard-->>App: Allow if authenticated
    App->>WritePage: Render WritePage
    WritePage->>Accordion: Render for each section
    Accordion->>SectionEditor: Render editor for section
    SectionEditor->>ReactQuery: Load/save section markdown state
Loading

Possibly related PRs

  • FixLog/FixLog_Client#7: Establishes the initial router and RouteGuard structure, which this PR extends by adding the /write route and associated components.

Poem

In a burrow of code, a new page appears,
With sections that open and markdown to cheer.
Accordions hop and editors gleam,
React Query caches each bunny's dream.
"fixLog" now shines in the browser's crown—
A writer's new playground, where bugs are written down!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-08T11_17_26_006Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e00f783 and c973f22.

📒 Files selected for processing (1)
  • src/components/write/SectionEditor.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/write/SectionEditor.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/main.tsx (1)

8-8: Consider configuring QueryClient for production use.

While the basic QueryClient instantiation works, consider adding configuration for production environments.

-const queryClient = new QueryClient();
+const queryClient = new QueryClient({
+  defaultOptions: {
+    queries: {
+      staleTime: 1000 * 60 * 5, // 5 minutes
+      gcTime: 1000 * 60 * 10,   // 10 minutes
+      retry: 1,
+    },
+  },
+});
src/components/write/SectionEditor.tsx (2)

16-16: Remove console.log from production code.

The console.log statement should be removed or wrapped in a development environment check to avoid cluttering the console in production.

-      console.log(`Initializing section "${sectionKey}"`);

Or wrap in a development check:

-      console.log(`Initializing section "${sectionKey}"`);
+      if (process.env.NODE_ENV === 'development') {
+        console.log(`Initializing section "${sectionKey}"`);
+      }

26-26: Remove console.log from production code.

Similar to the initialization log, this onChange log should be removed or wrapped in a development environment check.

-          console.log("onChange:", sectionKey, val);
src/pages/WritePage/WritePage.tsx (1)

42-47: Consider improving title fallback UX.

The current implementation shows the placeholder text both as initial state and when the title is empty. This might be confusing for users who have cleared their title, as they can't distinguish between "never set a title" and "cleared the title".

Consider separating the placeholder logic:

      <h1
        className="text-2xl font-bold cursor-pointer"
        onClick={() => setIsEditing(true)}
      >
-        {title || "제목을 입력하세요"}
+        {title === "제목을 입력하세요" ? "제목을 입력하세요" : (title || "제목 없음")}
      </h1>

Or initialize with an empty string and always show the placeholder when empty.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 19efed7 and e00f783.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • index.html (1 hunks)
  • package.json (1 hunks)
  • src/App.tsx (2 hunks)
  • src/components/write/Accordion.tsx (1 hunks)
  • src/components/write/SectionEditor.tsx (1 hunks)
  • src/main.tsx (1 hunks)
  • src/pages/WritePage/WritePage.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/App.tsx (1)
src/pages/WritePage/WritePage.tsx (1)
  • WritePage (16-62)
src/pages/WritePage/WritePage.tsx (2)
src/components/write/Accordion.tsx (1)
  • Accordion (11-38)
src/components/write/SectionEditor.tsx (1)
  • SectionEditor (9-33)
🔇 Additional comments (10)
index.html (1)

7-7: LGTM! Title properly reflects the application branding.

The title change from the default Vite template to "fixLog" appropriately reflects the application's identity.

src/App.tsx (2)

13-13: LGTM! Clean import addition.

The WritePage import follows the established import pattern in the file.


31-31: LGTM! Proper route protection for writing functionality.

The /write route is correctly placed within the protected RouteGuard, ensuring only authenticated users can access the writing interface.

src/main.tsx (3)

5-5: LGTM! Proper React Query imports.

The import statement correctly brings in the necessary React Query components.


6-7: LGTM! Global CSS imports for markdown editor.

The markdown editor CSS imports are appropriately placed at the global level to ensure proper styling across the application.


10-14: LGTM! Proper provider hierarchy.

The QueryClientProvider correctly wraps the app while maintaining StrictMode, enabling React Query throughout the application.

src/components/write/Accordion.tsx (1)

1-38: LGTM! Well-implemented collapsible component.

The Accordion component is cleanly structured with appropriate state management, proper event handling, and good accessibility considerations. The toggle functionality and conditional rendering are correctly implemented.

src/components/write/SectionEditor.tsx (1)

9-33: Approve the React Query integration and editor setup.

The component correctly uses React Query for caching draft content and the MDEditor integration is well-implemented. The cache key structure and useEffect dependencies are appropriate.

src/pages/WritePage/WritePage.tsx (2)

21-25: Approve the focus management implementation.

The useEffect correctly handles focusing the input when entering edit mode, which provides good UX.


51-59: Approve the sections rendering and component integration.

The mapping of sections to Accordion components with embedded SectionEditor instances is clean and well-structured. The component composition effectively creates a coherent writing interface.

Comment on lines +13 to +14
"@tanstack/react-query": "^5.80.6",
"@uiw/react-md-editor": "^4.0.7",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify dependency versions are current and secure.

The new dependencies support the markdown writing feature well. Please verify these package versions are current and free from security vulnerabilities.

Also applies to: 17-17


🌐 Web query:

What are the latest stable versions of @tanstack/react-query, @uiw/react-md-editor, and react-icons npm packages?

💡 Result:

As of June 8, 2025, the latest stable versions of the specified npm packages are:

  • @tanstack/react-query: Version 5.68.0, published 2 days ago. (npmjs.com)

  • @uiw/react-md-editor: Version 4.0.5, published 3 months ago. (npmjs.com)

  • react-icons: Version 4.8.0, published 2 months ago.

Please note that the version information for react-icons is based on the latest available data and may not reflect the most current release.

Citations:


Update dependency versions in package.json to match published npm releases

This PR references versions that don’t exist on npm and will break npm install. Please align them with the latest stable releases:

• File: package.json
– Lines 13–14, 17

Proposed diff:

--- package.json
+++ package.json
@@ –13,3 +13,3 @@
-    "@tanstack/react-query": "^5.80.6",
-    "@uiw/react-md-editor": "^4.0.7",
-    "react-icons": "^5.5.0"
+    "@tanstack/react-query": "^5.68.0",
+    "@uiw/react-md-editor": "^4.0.5",
+    "react-icons": "^4.8.0"

After updating, run npm install and npm audit to confirm everything installs correctly and has no known vulnerabilities.

🤖 Prompt for AI Agents
In package.json at lines 13-14 and line 17, the specified versions for
@tanstack/react-query and @uiw/react-md-editor do not match the latest stable
releases on npm and may cause installation failures. Update the version of
@tanstack/react-query to 5.68.0 and @uiw/react-md-editor to 4.0.5 to align with
the published stable versions. Also verify and update the react-icons version at
line 17 to 4.8.0. After making these changes, run npm install and npm audit to
ensure proper installation and no security vulnerabilities.

@psm1st psm1st merged commit 41a82c5 into main Jun 8, 2025
5 checks passed
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.

[feat]Accordion 컴포넌트 형성

1 participant