Skip to content

feat(UI): added comment/title update API#1234

Merged
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main
Jul 15, 2025
Merged

feat(UI): added comment/title update API#1234
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented Jul 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2025 1:02pm

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 standardizes comment payloads, adds APIs for editing/deleting comments and MR/issue titles, and updates client hooks to use the new endpoints.

  • Replaced multiple SaveCommentRequest types with a single ContentPayload
  • Added edit_comment, delete_comment, edit_title endpoints and corresponding storage methods
  • Updated React Query hooks to use ContentPayload and the new conversation-based routes

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
moon/packages/types/generated.ts Introduced ContentPayload, removed SaveCommentRequest, added new response types
moon/apps/web/hooks/usePostMrComment.ts Switched hook to use ContentPayload
moon/apps/web/hooks/useDeleteMrCommentDelete.ts Updated hook to call deleteApiConversationByCommentId
moon/apps/web/hooks/issues/usePostIssueComment.ts Swapped in ContentPayload for issue comment hook
moon/apps/web/hooks/issues/useDeleteIssueComment.ts Pointed delete hook at conversation delete endpoint
mono/src/api/mr/mr_router.rs Replaced request bodies, removed old delete, added MR edit_title route
mono/src/api/issue/issue_router.rs Ditto for issues: removed delete, added edit_title route
mono/src/api/conversation/mod.rs Renamed SaveCommentRequest to ContentPayload
mono/src/api/conversation/conv_router.rs Added delete_comment and edit_comment routes
jupiter/src/storage/mr_storage.rs Implemented edit_title in MR storage
jupiter/src/storage/issue_storage.rs Implemented edit_title in issue storage
jupiter/src/storage/conversation_storage.rs Added update_comment in conversation storage
moon/api/lib/demo_orgs/data/notes.json Large formatting changes in seed data
moon/api/lib/demo_orgs/data/calls.json Large formatting changes in seed data
Comments suppressed due to low confidence (6)

mono/src/api/issue/issue_router.rs:252

  • Grammar nit: change "a Issue" to "an Issue" for clarity.
        ("link", description = "A string ID representing a Issue"),

mono/src/api/issue/issue_router.rs:249

  • [nitpick] The edit_title path is missing a @summary annotation. Adding one (e.g., @summary Edit issue title) will keep documentation consistent.
#[utoipa::path(

mono/src/api/conversation/conv_router.rs:101

  • [nitpick] The edit_comment route lacks a @summary annotation. Consider adding @summary Edit comment for consistent generated docs.
#[utoipa::path(

moon/apps/web/hooks/useDeleteMrCommentDelete.ts:5

  • [nitpick] The hook name useDeleteMrCommentDelete no longer matches the underlying deleteApiConversationByCommentId endpoint. Consider renaming to useDeleteComment or useDeleteConversationComment.
export function useDeleteMrCommentDelete(id: string, params?: RequestParams) {

jupiter/src/storage/mr_storage.rs:184

  • No tests accompany the new edit_title method. Adding unit or integration tests for title updates would improve confidence.
    pub async fn edit_title(&self, link: &str, title: &str) -> Result<(), MegaError> {

moon/api/lib/demo_orgs/data/notes.json:1

  • [nitpick] These massive seed‐data formatting changes seem unrelated to the API work and clutter the diff. Consider separating or reverting them to keep this PR focused.
[{"title":"2024 Park Plan","description_html":"<p>Welcome to the collaborative document for the <strong>2024 Park Plan!</strong> This document is intended to outline\n  our strategies, initiatives, and milestones for the upcoming year.</p>\n<h1>Table of Contents</h1>\n<ol>\n  <li>\n    <p>Introduction</p>\n  </li>\n  <li>\n    <p>Key Objectives</p>\n  </li>\n  <li>\n    <p>Project Proposals</p>\n  </li>\n  <li>\n    <p>Budget Overview</p>\n  </li>\n  <li>\n    <p>Timeline</p>\n  </li>\n</ol>\n<div data-hr-wrapper>\n  <hr>\n</div>\n<h2>Introduction</h2>\n<p>Frontier Park is dedicated to <em>preserving natural beauty and providing an exceptional experience to all\n    visitors</em>. As we move into 2024, we must focus on sustainability and innovation.</p>\n<h3>Our Mission</h3>\n<blockquote>\n  <p>To protect the park&apos;s natural resources while fostering an environment that allows visitors to enjoy and learn\n    from the wilderness.</p>\n</blockquote>\n<h3>Vision for 2024</h3>\n<p>Our vision is to make Frontier Park a model for conservation and visitor engagement, setting a benchmark for parks\n  nationwide.</p>\n<h2>Key Objectives</h2>\n<ul>\n  <li>\n    <p><strong>Sustainability</strong>: Implement eco-friendly practices park-wide.</p>\n  </li>\n  <li>\n    <p><strong>Education</strong>: Enhance visitor knowledge and appreciation of the natural world.</p>\n  </li>\n  <li>\n    <p><strong>Community Engagement</strong>: Strengthen relationships with local communities and stakeholders.</p>\n  </li>\n  <li>\n    <p><strong>Safety &amp; Infrastructure</strong>: Ensure a safe and accessible environment for all.</p>\n  </li>\n</ul>\n<h2>Project Proposals</h2>\n<ul>\n  <li>\n    <p>Eco-Lodges: Sustainable accommodation for visitors.</p>\n    <ul>\n      <li>\n        <p>Restrooms</p>\n      </li>\n      <li>\n        <p><a class=\"prose-link\" target=\"_blank\" href=\"https://campsite.com\"><span>Campsites</span></a></p>\n      </li>\n      <li>\n        <p>Overnight accommodations</p>\n      </li>\n    </ul>\n  </li>\n  <li>\n    <p>Interactive Exhibits: Using technology to educate visitors about wildlife.</p>\n  </li>\n</ul>\n<h2>Budget Overview</h2>\n<p>Here is a brief overview of the proposed budget:</p>\n<ul>\n  <li>\n    <p><strong>Operations</strong>: $500,000</p>\n  </li>\n  <li>\n    <p><strong>Conservation Projects</strong>: $350,000</p>\n  </li>\n  <li>\n    <p><strong>Marketing &amp; Outreach</strong>: $150,000</p>\n  </li>\n  <li>\n    <p><strong>Facility Upgrades</strong>: <s>$200,000</s> $100,000</p>\n  </li>\n</ul>\n<h2>Timeline</h2>\n<details class=\"details\">\n  <summary>Q1: Research and Development</summary>\n  <div data-type=\"detailsContent\">\n    <p>In the first quarter of the year, the focus will be on conducting surveys to gather visitor feedback, analyzing\n      biodiversity data, and exploring innovative ways to enhance visitor experiences. Additionally, research will be\n      carried out to identify potential conservation initiatives and sustainability projects for the park.</p>\n  </div>\n</details>\n<details class=\"details\">\n  <summary>Q2: Implementation of Pilot Programs</summary>\n  <div data-type=\"detailsContent\">\n    <p>During the second quarter, pilot programs will be implemented to test new visitor engagement activities,\n      conservation practices, and sustainable infrastructure initiatives within the park.</p>\n    <p>These pilot programs aim to assess their feasibility, effectiveness, and impact on enhancing the overall visitor\n      experience and environmental conservation efforts.</p>\n  </div>\n</details>\n<details class=\"details\">\n  <summary>Q3: Review &amp; Adjustments</summary>\n  <div data-type=\"detailsContent\">\n    <p>In the third quarter, a comprehensive review of the pilot programs will be conducted to&quot; evaluate their\n      outcomes, gather stakeholder feedback, and assess any necessary adjustments for optimization.</p>\n    <p>This phase involves:</p>\n    <ul>\n      <li>\n        <p>Analyzing data</p>\n      </li>\n      <li>\n        <p>Identifying strengths and areas for improvement</p>\n      </li>\n      <li>\n        <p>Making strategic adjustments to ensure the success and sustainability of the initiatives.</p>\n      </li>\n    </ul>\n  </div>\n</details>\n<details class=\"details\">\n  <summary>Q4: Full-Scale Rollout</summary>\n  <div data-type=\"detailsContent\">\n    <p>During the fourth quarter, the full-scale rollout of successful pilot programs and initiatives will take place\n      across the park. This phase involves expanding and implementing the refined strategies, integrating feedback from\n      the review phase, and ensuring seamless execution of planned activities to maximize visitor engagement,\n      conservation efforts, and sustainable practices park-wide.</p>\n  </div>\n</details>\n<h2>Communication Guidelines</h2>\n<p>Please adhere to the following when posting in our <strong>Frontier Park Spaces</strong>:</p>\n<ul>\n  <li>\n    <p><strong>Be respectful and constructive.</strong></p>\n  </li>\n  <li>\n    <p>Use proper grammar and punctuation.</p>\n  </li>\n  <li>\n    <p><em>Stay on topic in each Space.</em></p>\n  </li>\n</ul>\n<h3>Updates &amp; Progress</h3>\n<ul>\n  <li>\n    <p><strong>Visitor Center Renovation</strong>: In progress, on track for Q2 completion.</p>\n  </li>\n  <li>\n    <p><em>New Trails Campaign</em>: <s>Starting in April</s> <strong>Now starting in May</strong>.</p>\n  </li>\n</ul>\n<h3>Technical Notes</h3>\n<p>For those working on the new mobile app, here&apos;s a snippet of the code to integrate the park map:</p>\n<pre><code class=\"language-javascript\">const mapOptions = {\\n  center: { lat: 44.58, lng: -110.5 },\\n  zoom: 8,\\n};\\n\\nfunction initMap() {\\n  const parkMap = new google.maps.Map(document.getElementById(&apos;map&apos;), mapOptions);\\n}</code></pre>\n<p>This code block initializes the map with predefined <code>mapOptions</code>.</p>\n<div data-hr-wrapper>\n  <hr>\n</div>\n<p>Let&apos;s work together to make 2024 a milestone year for Frontier Park! 🌲</p>","public_visibility":false,"project":"General","project_permission":"view","member":"Ranger Rick","description_schema_version":4}]

@genedna
genedna enabled auto-merge July 15, 2025 13:24
@genedna
genedna added this pull request to the merge queue Jul 15, 2025
Merged via the queue into gitmono-dev:main with commit ce122c3 Jul 15, 2025
12 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Mega UI 重构 Jul 15, 2025
liuyangjuncong20202570 pushed a commit to liuyangjuncong20202570/mega that referenced this pull request Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants