Skip to content

Demo floating window#678

Merged
fomalhautb merged 8 commits into
devfrom
demo-floating-window
May 15, 2025
Merged

Demo floating window#678
fomalhautb merged 8 commits into
devfrom
demo-floating-window

Conversation

@fomalhautb
Copy link
Copy Markdown
Contributor

@fomalhautb fomalhautb commented May 14, 2025

image

Important

Adds DemoFloatingWindow component for development, integrated into demo layout and stack initialization, providing user actions like sign-in and account settings.

  • Behavior:
    • Adds DemoFloatingWindow component in demo-floating-window.tsx, visible only in development mode.
    • Provides user actions: sign-in, sign-out, account settings.
  • Integration:
    • Integrates DemoFloatingWindow into layout.tsx within the StackProvider and StackTheme.
    • Updates getUpdatedLayout() in index.ts to include DemoFloatingWindow in the layout.
  • Exports:
    • Exports DemoFloatingWindow in index.ts for external use.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2025

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

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 4:11pm
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 4:11pm
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 4:11pm

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added a new draggable DemoFloatingWindow component for displaying user authentication UI, with conditional rendering based on login status.

  • Added /packages/template/src/components/demo-floating-window.tsx implementing drag-and-drop functionality with mouse event handling and proper cleanup
  • Component displays user avatar, email, and account options when logged in, or sign in/up buttons when logged out
  • Uses backdrop blur and semi-transparent background for modern UI aesthetics
  • Integrated into /examples/demo/src/app/page.tsx alongside existing PageClient component
  • Exports component through /packages/template/src/index.ts while maintaining platform-specific structure

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread packages/template/src/components/demo-floating-window.tsx
@recurseml
Copy link
Copy Markdown

recurseml Bot commented May 14, 2025

✨ No issues found! Your code is sparkling clean! ✨

🗒️ View all ignored comments in this repo
  • The constraint 'TokenStoreType extends string' is too restrictive. It should likely be 'TokenStoreType extends string | object' to match the condition check in line 113 where TokenStoreType is checked against {}
  • Return type mismatch - the interface declares useUsers() returning ServerUser[] but the Team interface that this extends declares useUsers() returning TeamUser[]
  • There is a syntax error in the super constructor call due to the ellipsis operator used incorrectly. Objects aren't being merged correctly. This syntax usage can lead to runtime errors when trying to pass the merged object to 'super()'. Verify that the intended alterations to the object occur before or outside of the super() call if needed.
  • Throwing an error when no active span is found is too aggressive. The log function should gracefully fallback to console.log or another logging mechanism when there's no active span, since not all execution contexts will have an active span. This makes the code less resilient and could break functionality in non-traced environments.

📚 Relevant Docs

  • Function sets backendContext with a new configuration but doesn't pass 'defaultProjectKeys'. Since defaultProjectKeys is required in the type definition and cannot be updated (throws error if tried to set), this will cause a type error.
  • The schema is using array syntax for pick() which is incorrect for Yup schemas. The pick() method in Yup expects individual arguments, not an array. Should be changed to: emailConfigSchema.pick('type', 'host', 'port', 'username', 'sender_name', 'sender_email')

📚 Relevant Docs

  • Creating a refresh token with current timestamp as expiration means it expires immediately. Should set a future date for token expiration.
  • The 'tools' object is initialized as an empty object, even though 'tools' is presumably expected to contain tool definitions. This could cause the server capabilities to lack necessary tool configurations, thus potentially impacting functionalities that depend on certain tool setups.

📚 Relevant Docs

  • 'STACK_SECRET_SERVER_KEY' is potentially being included in every request header without checking its existence again here. Although it's checked during initialization, this could lead to security issues as it's exposed in all communications where the header is logged or captured.

📚 Relevant Docs

  • When adding 'use client' directive at the beginning, it doesn't check if file.text already contains the 'use client' directive. This could lead to duplicate 'use client' directives if the file already has one.

📚 Relevant Docs

Comment thread packages/template/src/components/demo-floating-window.tsx Outdated
Comment thread packages/template/src/components/demo-floating-window.tsx
Comment thread packages/template/src/components/demo-floating-window.tsx
- Changed mouse event handlers to pointer event handlers for better compatibility.
- Added `e.preventDefault()` to prevent text selection during drag.
- Updated event listeners to handle pointer events for dragging functionality.
@fomalhautb fomalhautb assigned N2D4 and unassigned fomalhautb May 14, 2025
Comment thread packages/template/src/components/demo-floating-window.tsx
Comment thread packages/template/src/components/demo-floating-window.tsx Outdated
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@fomalhautb fomalhautb requested a review from N2D4 May 15, 2025 19:56
@fomalhautb fomalhautb merged commit 4205c11 into dev May 15, 2025
16 checks passed
@fomalhautb fomalhautb deleted the demo-floating-window branch May 15, 2025 21:56
N2D4 added a commit that referenced this pull request May 20, 2025
N2D4 added a commit that referenced this pull request May 20, 2025
N2D4 added a commit to willothy/stack that referenced this pull request Jun 23, 2025
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<img width="474" alt="image"
src="https://github.com/user-attachments/assets/5fb5a632-d605-49ed-89d6-b26533d84a2f"
/>

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Adds `DemoFloatingWindow` component for development, integrated into
demo layout and stack initialization, providing user actions like
sign-in and account settings.
> 
>   - **Behavior**:
> - Adds `DemoFloatingWindow` component in `demo-floating-window.tsx`,
visible only in development mode.
>     - Provides user actions: sign-in, sign-out, account settings.
>   - **Integration**:
> - Integrates `DemoFloatingWindow` into `layout.tsx` within the
`StackProvider` and `StackTheme`.
> - Updates `getUpdatedLayout()` in `index.ts` to include
`DemoFloatingWindow` in the layout.
>   - **Exports**:
>     - Exports `DemoFloatingWindow` in `index.ts` for external use.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 98aa609. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
N2D4 added a commit to willothy/stack that referenced this pull request Jun 23, 2025
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