Skip to content

add setting modal #1874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

spartan-vutrannguyen
Copy link
Contributor

@spartan-vutrannguyen spartan-vutrannguyen commented May 19, 2025

Description

  • Add setting modal with ability to setup page metadata

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


Important

Add settings modal with page metadata management, including metadata extraction and UI enhancements for project settings.

  • Behavior:
    • Adds SettingsModal to Modals in index.tsx for managing page metadata.
    • Implements scanProjectMetadata() in ProjectManager to extract metadata from layout.tsx.
    • Updates SiteTab to handle metadata form submission and favicon/image uploads.
  • Metadata Extraction:
    • Introduces extractMetadata() in metadata.ts to parse and extract metadata from a file.
    • Utilizes Babel to traverse AST and extract metadata properties.
  • UI Components:
    • Adds BaseDomain and DangerZone components for domain management in settings.
    • Updates PreferencesTab to manage user preferences like language and theme.
  • Models:
    • Extends Project interface in project.ts to include siteMetadata and domains.
  • Misc:
    • Removes unused code and comments in several files for cleanup.

This description was created by Ellipsis for 22eb91d. You can customize this summary. It will automatically update as commits are pushed.

Copy link

vercel bot commented May 19, 2025

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 9:07am
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 9:07am

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 22eb91d in 1 minute and 34 seconds. Click for details.
  • Reviewed 443 lines of code in 11 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. apps/web/client/src/components/ui/modal/settings/index.tsx:34
  • Draft comment:
    The useEffect that triggers scans when settingsOpen becomes true depends on both editorEngine.state.settingsOpen and project. Consider adding 'project' to the dependency array to avoid missing updates when the project changes.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
2. apps/web/client/src/components/store/project/manager.ts:31
  • Draft comment:
    Since 'domains' and 'versions' are always initialized in the constructor, consider removing the null union from their types to clarify that these properties are always set.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. apps/web/client/src/components/ui/modal/settings/preferences.tsx:33
  • Draft comment:
    Remove the commented-out updateAnalytics function if it's not needed to improve code clarity.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
4. apps/web/client/src/components/ui/modal/settings/site/index.tsx:59
  • Draft comment:
    When constructing the favicon path using the uploaded file name, ensure the filename is properly sanitized to prevent potential security issues.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. apps/web/client/src/components/ui/modal/settings/index.tsx:201
  • Draft comment:
    It looks like there’s an extraneous closing comment (*/) after <Separator />. This seems unintentional and should be removed, unless intended for a specific purpose.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
6. apps/web/client/src/components/ui/modal/settings/preferences.tsx:200
  • Draft comment:
    There's an unexpected '*/' token at the end of this line, which appears to be a leftover from a block comment. If this was not intended, please remove it.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_tFbYpNDWyOe3n0hg

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.


export async function extractMetadata(filePath: string): Promise<PageMetadata | undefined> {
try {
const editorEngine = useEditorEngine();
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the React hook useEditorEngine inside an async utility function is a violation of hook rules. Consider refactoring (e.g. pass editorEngine as a parameter or use a custom hook) so the hook is only called within React components.

@spartan-vutrannguyen spartan-vutrannguyen marked this pull request as draft May 20, 2025 04:13
@Kitenite Kitenite marked this pull request as ready for review May 21, 2025 00:04
@Kitenite Kitenite self-requested a review May 21, 2025 00:04
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.

1 participant