Skip to content

[Enhancements] [Bryce] - Publish Modal #2454

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 4 commits into
base: main
Choose a base branch
from

Conversation

BJP-GU
Copy link
Contributor

@BJP-GU BJP-GU commented Jul 15, 2025

Description

Updated UI/UX for the Publish Modal: Reduced cognitive load for initial publish action, refined error state experience, added new buttons to address publish errors, simplified UI for "Add custom domain" button.

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe): Enhancements to existing features/functionality

Testing

Compared updated results in localhost against my Figma mockups.

Screenshots from localhost:

Publish Update:
image

Error State Updates:
image


Important

Enhances Publish Modal UI/UX with improved error handling, domain linking, and debugging features.

  • UI/UX Enhancements:
    • Updated PublishDropdown in index.tsx to include PreviewDomainSection and CustomDomainSection with separators.
    • Added AdvancedSettingsSection and View Site button in index.tsx.
    • Modified UrlSection in url.tsx to handle invalid URLs and display error messages.
    • Enhanced CustomDomainSection and PreviewDomainSection to handle error states and retry logic.
  • Error Handling:
    • Added error UI for non-domain publishing errors in preview-domain-section.tsx and custom-domain-section.tsx.
    • Implemented demoNonDomainError flag for demo purposes in preview-domain-section.tsx and custom-domain-section.tsx.
  • Code Refactoring:
    • Exposed editorEngine to the window for debugging in editor/index.tsx.
    • Updated preview.ts to use HOSTING_DOMAIN constant for domain creation.
  • Miscellaneous:
    • Updated .husky/pre-commit to use absolute paths for bun commands.

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

BJP-GU added 3 commits July 9, 2025 15:35
Minor updates to the UI in the publish modal: Updated error states, hover states on "fix w/ AI button", implementing divider lines correctly.
Copy link

vercel bot commented Jul 15, 2025

@BJP-GU is attempting to deploy a commit to the Onlook Team on Vercel.

A member of the Team first needs to authorize it.

</div>
)}
</div>
);
};

const demoNonDomainError = true; // or false to disable the demo

return (
Copy link
Contributor

Choose a reason for hiding this comment

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

It appears that the functions 'renderDomain', 'renderNoDomain', and 'renderActionSection' are defined but not used in the final return. Remove unused code to keep the component clean.

</>
);
};

const renderActionSection = () => {
if (!domain?.url) {
console.warn('No domain URL found:', domain);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove or disable debug logging (console.log and console.warn) before production deployment to avoid exposing internal state.

Suggested change
console.warn('No domain URL found:', domain);

@@ -18,8 +18,13 @@ export const EditorEngineProvider = ({ children, projectId }: {
const editorEngine = useMemo(() => new EditorEngine(projectId), [projectId]);

useEffect(() => {
// Expose editor engine to window for debugging purposes
(window as any).editorEngine = editorEngine;
Copy link
Contributor

Choose a reason for hiding this comment

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

Exposing 'editorEngine' to the window is useful for debugging, but ensure to remove or restrict this in production to avoid potential security risks.

Suggested change
(window as any).editorEngine = editorEngine;
if (process.env.NODE_ENV !== "production") (window as any).editorEngine = editorEngine;

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
</div>
)}
</div>
);
};

const demoNonDomainError = true; // or false to disable the demo
Copy link
Contributor

Choose a reason for hiding this comment

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

The hardcoded flag demoNonDomainError = true will force error states to display in all environments including production. This appears to be intended for UI demonstration purposes only. For production deployment, this should either be:

  1. Set to false by default
  2. Replaced with actual error detection logic
  3. Made configurable via environment variables
  4. Removed entirely if no longer needed for demonstration

Without this change, users will always see error states regardless of actual publishing status.

Suggested change
const demoNonDomainError = true; // or false to disable the demo
const demoNonDomainError = false; // Set to true to demonstrate error states

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@drfarrell
Copy link
Collaborator

image

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