Skip to content

Conversation

@lixl39505
Copy link
Contributor

@lixl39505 lixl39505 commented Nov 10, 2025

Related Issue

Major Changes

  1. improved: support for add-page and remove-page

Screenshots

  • Records
image
  • remove page
image
  • add page
image

Test Plan

  • remove multi page success
  • add two pages at once success

Checklist

  • This change requires documentation updates. I have updated the relevant documentation, or created a documentation update issue and linked it here.
  • The changes are covered by existing tests, and I have adjusted test coverage for the modified parts.
  • Newly added code logic is covered by tests.
  • This change adds dependencies, and they are correctly categorized in dependencies or devDependencies.
  • This change adds or updates npm dependencies, and it does not introduce multiple versions of the same dependency (check the diff of pnpm-lock.yaml).

Summary by AIGNE

Release Notes

New Features:

  • Added ability to add new pages to website structure with automatic link integration
  • Implemented recursive page deletion to remove parent pages along with all child pages
  • Added automatic detection and removal of invalid internal links after page deletions

Bug Fixes:

  • Improved error handling for file reading operations during link validation
  • Enhanced page structure validation to prevent orphaned content

Refactor:

  • Streamlined page clearing function return signature
  • Updated website structure schema to support recursive operations

@github-actions
Copy link

Image description AIGNE CodeSmith

Pull Request Title Suggestions

  1. feat: add user page management with add and remove functionality
  2. feat(pages): implement page addition and removal with link management
  3. feat: add comprehensive page management system with structure updates

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Image description AIGNE CodeSmith

Walkthrough

This pull request implements comprehensive page management functionality for a website structure system. The changes add capabilities for adding new pages with automatic link integration, removing pages with proper cleanup of invalid links, and recursive deletion of page hierarchies. The implementation includes interactive user interfaces, validation systems, and proper error handling for most operations, though some critical issues exist with process termination and error handling patterns.

Changes

Files Summary
agents/clear/clear-generated-pages.mjs Removes the results property from the return object of the clearGeneratedPages function, modifying the function's return signature.
agents/plan/user-add-page/add-links-to-pages.mjs Adds new function to integrate links to newly added pages into existing page content using filesystem operations and content update agents.
agents/plan/user-add-page/add-pages-to-structure.mjs Introduces interactive interface for adding pages to website structure with user prompts, validation, and structure updates. CRITICAL: Uses process.exit(0) which terminates the entire Node.js process instead of proper error handling.
agents/plan/user-remove-page/find-pages-with-invalid-links.mjs, agents/plan/user-remove-page/remove-invalid-links-from-page.mjs, agents/plan/user-remove-page/remove-pages-from-structure.mjs Implements page removal functionality with invalid link detection and cleanup. CRITICAL: Multiple issues including missing error handling, potential data loss, incorrect action parameters, and improper use of process.exit(0).
agents/plan/website-structure-tools/delete-page.mjs, types/website-structure-schema.mjs Enhances page deletion to support recursive deletion of child pages with updated schema and error messaging.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description AIGNE CodeSmith

Commits Files that changed from the base of the PR and between 9e937e0 and ebf901c commits.
Files selected (8)
  • agents/clear/clear-generated-pages.mjs (1)
  • agents/plan/user-add-page/add-links-to-pages.mjs (1)
  • agents/plan/user-add-page/add-pages-to-structure.mjs (1)
  • agents/plan/user-remove-page/find-pages-with-invalid-links.mjs (1)
  • agents/plan/user-remove-page/remove-invalid-links-from-page.mjs (1)
  • agents/plan/user-remove-page/remove-pages-from-structure.mjs (1)
  • agents/plan/website-structure-tools/delete-page.mjs (3)
  • types/website-structure-schema.mjs (2)
Files ignored due to filter (5)
  • agents/plan/user-add-page/find-pages-to-add-links.yaml
  • agents/plan/user-add-page/index.yaml
  • agents/plan/user-remove-page/index.yaml
  • aigne.yaml
  • prompts/plan/find-pages-to-add-links.md
Review comments generated (14)
  • Review: 7
  • LGTM: 7

提示

Image description AIGNE CodeSmith (@codesmith) 聊天

  • 回复此机器人留下的审查评论以提出后续问题。审查评论是对差异或文件的评论。
  • 通过在回复中标记 @codesmith 邀请机器人加入审查评论链。

代码建议

  • 机器人可能会提出代码建议,但在提交前请仔细审查它们,因为行号范围可能会不对齐。
  • 你可以编辑机器人做出的评论,并在建议稍有偏差时手动调整。

暂停增量审查

  • 在 PR 描述中的任何位置添加 @codesmith: ignore 以暂停机器人的进一步审查。

@lixl39505 lixl39505 changed the title WIP:feat: support for add-page and remove-page feat: support for add-page and remove-page Nov 11, 2025
@wangshijun wangshijun requested a review from Copilot November 11, 2025 22:56
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 adds support for adding and removing pages from the website structure through new CLI commands add-page and remove-page. The implementation includes recursive page deletion, automatic link management, and proper translation handling for modified pages.

Key Changes:

  • Added add-page and remove-page CLI commands with corresponding agent workflows
  • Implemented recursive page deletion to handle parent-child page relationships
  • Added automatic detection and cleanup of invalid internal links after page removal
  • Centralized YAML stringification options to ensure consistent formatting

Reviewed Changes

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

Show a summary per file
File Description
aigne.yaml Registers new add-page and remove-page CLI commands and agent configurations
types/website-structure-schema.mjs Adds optional recursive parameter to delete page schema for cascading deletions
agents/plan/website-structure-tools/delete-page.mjs Implements recursive deletion logic to remove child pages before parent
agents/plan/user-add-page/* New workflow for adding pages, finding related pages, and inserting appropriate links
agents/plan/user-remove-page/* New workflow for removing pages and cleaning up invalid references
utils/constants.mjs Defines shared YAML_STRINGIFY_OPTIONS constant for consistent serialization
Multiple agent files Updates to use centralized YAML_STRINGIFY_OPTIONS instead of inline options
agents/clear/clear-generated-pages.mjs Removes unused results from return value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lban2049
lban2049 previously approved these changes Nov 12, 2025
@lban2049 lban2049 self-requested a review November 12, 2025 02:08
@lban2049 lban2049 dismissed their stale review November 12, 2025 02:08

误操作

Copy link
Contributor

@wangshijun wangshijun left a comment

Choose a reason for hiding this comment

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

新增的代码有些需要单元测试覆盖,可以都加上

Copy link
Contributor

@lban2049 lban2049 left a comment

Choose a reason for hiding this comment

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

LGTM

@lixl39505 lixl39505 merged commit d02fe21 into main Nov 13, 2025
1 check passed
@lixl39505 lixl39505 deleted the feat-add-page branch November 13, 2025 03: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.

4 participants