You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
next: organization and account notifications improvements (#1930)
* Uses HashSet for user organization and roles.
Uses HashSet instead of Collection for storing user organization IDs and roles.
This change improves performance by leveraging the efficient lookup capabilities of HashSet,
ensuring uniqueness and faster access when checking for organization or role membership.
* Adds organization management links to UI
Adds links to manage organization settings and billing directly from the user and organization switcher dropdowns.
This provides quick access to organization management features, improving the user experience.
* Includes invites in user count
Corrects user pagination by including pending invites in the total user count for accurate "has more" calculations.
* Updates organization links to use A component
Replaces the `goto` function calls with the `A` component from the typography module for navigating to organization management and creation pages.
This change enhances the user experience and allows for styling.
* WIP - Account notifications
* updated svelte
* Updates dev dependencies
Updates Svelte and Typescript-eslint dev dependencies.
This ensures the project is using the latest available versions
of these packages, which may include bug fixes, performance
improvements, and new features.
* WIP account notification page updates
* Uses TimeProvider for testable delays
Refactors code to use the TimeProvider abstraction when introducing delays.
This allows for easier testing and mocking of time-dependent operations in jobs and migrations.
Also changes AllScopes to be an ISet.
* WIP: User notification settings.
* Fixes form rendering before data is loaded
Ensures the notification settings form only renders after the form data is available. This prevents errors that occur when attempting to access properties of an undefined object.
* Updates Beast Mode chatmode to v3.1
Refactors the Beast Mode chatmode configuration for improved tool usage and instruction clarity.
The update includes a refined set of available tools, clarifies internet research guidelines with more specific instructions on link fetching, and emphasizes the importance of memory management to avoid redundant file reads. Also enforces .env file creation and updates todo list formatting.
* Restructures notification settings forms
Refactors notification settings forms for users and integrations, improving UI and separating concerns.
Introduces a generic `UserNotificationSettingsForm` for user-specific settings and an `IntegrationNotificationSettingsForm` for integration settings, enhancing code organization and reusability.
Updates the UI to use a consistent card-based layout with descriptive text for each setting.
* Improves user notification settings UI
Enhances the user interface for the user notification settings form.
Replaces the heading component to ensure consistent styling.
Improves the loading state of the form by using a more visually appealing skeleton loader, providing a better user experience while data is being fetched.
* Improves appearance settings layout
Enhances the appearance settings page layout by aligning the theme options (Light, Dark, System) to the center using flexbox.
This provides a better user experience by visually centering the theme previews and labels.
* Updates package-lock.json and package.json
Updates dependencies to their latest versions.
This ensures the project benefits from the latest features,
bug fixes, and security patches in the updated libraries.
* Refactors notification settings forms
Refactors the notification settings forms for projects and users.
This change introduces a new `UserNotificationSettingsForm` component that provides a better UI, including descriptions for each notification type.
It also handles the display of settings based on plan features and email verification status.
* Uses Alert variants for styling
Refactors the alert component to use variants for styling,
and applies the 'information' variant to the alert in the user
notification settings form to enhance readability.
* Uses SvelteMap and SvelteDate for reactivity
Improves reactivity by utilizing SvelteMap for filter caching
and SvelteDate for date calculations, enhancing UI responsiveness.
* Updates notification settings form behavior
Refactors the notification settings form to use `onCheckedChange` instead of `onclick` for switch components, ensuring consistent event handling.
Moves `isEmailAddressVerified` declaration for better readability.
Improves project notification settings saving with toast notifications to provide user feedback.
* Improves Svelte form handling and data management
Introduces `structuredCloneState` utility to prevent cache mutation and reactive entanglement when working with forms.
Updates form components to use `structuredCloneState` for initializing and resetting form data, ensuring data isolation and predictable behavior.
Adds Svelte component guidelines to promote best practices and consistent development.
Improves performance by using reference comparison instead of JSON stringification for reset logic.
Also adds reactive binding pattern to handle query data.
* Enables Svelte experimental async components
Adds documentation for async components in Svelte.
Enables the `experimental.async` compiler option in the Svelte configuration file to allow using `await` directly in component scripts, `$derived` expressions, and template expressions.
* Updated deps
* Updates dependencies in package.json
Updates various dependencies to their latest versions.
This includes updates to `@lucide/svelte`, `bits-ui`, `shiki`,
`tailwind-variants`, `@chromatic-com/storybook`, `@iconify-json/lucide`,
`@playwright/test`, `@storybook/*`, `@sveltejs/kit`, `@types/node`,
`eslint-plugin-storybook`, `svelte`, `svelte-check`, `typescript`,
and `typescript-eslint/*`.
These updates may include bug fixes, performance improvements,
new features, and security patches from the updated libraries.
* Added shadcn-svelte calendar
* Documents frontend coding conventions
Adds documentation outlining best practices and patterns for frontend development, including dialog component structure, API integration, naming conventions, and type safety.
These guidelines aim to promote consistency, maintainability, and code quality across the frontend codebase.
* Renames DropDown component to Dropdown
Updates the component name from "DropDown" to "Dropdown" for consistency and to adhere to naming conventions.
This change affects the component itself, its import statements, and its usage within the application.
* Refactors organization API and components
Updates the organization API to use organization ID instead of email for user operations.
Changes `removeOrganizationUser` to `deleteOrganizationUser` and updates related components.
Renames `UpdateOrganizationRequest` to `PatchOrganizationRequest` and updates the corresponding API call to use PATCH.
* WIP - Organization Admin Actions
* next: perfectionist enum sorting rules.
azat-io/eslint-plugin-perfectionist#564
* Updates placeholder text in dialogs
Updates the placeholder text in the set event bonus and suspend organization dialogs.
This improves clarity and user experience by providing more helpful hints.
* Documents Superforms dialog patterns
Adds documentation for using Superforms within dialogs.
The new documentation covers specific patterns for handling
server-side validation, preventing focus theft by SvelteKit,
and ensuring proper error propagation. It also emphasizes
the importance of rethrowing errors from action functions
called within dialogs.
* Updates dependencies
Bumps various dependency versions, including `@lucide/svelte`, `@sveltejs/adapter-static`, `@sveltejs/kit`, `bits-ui`, and `svelte`.
Also, adds "unsuspended" to the VS Code settings.
* Handles server-side validation errors for bonus events
Improves error handling in the set bonus organization dialog.
Catches validation exceptions from the server and displays them
in the form. Also, fixes an issue where the expiration date was not
being correctly converted to UTC.
* Handles server-side errors in dialog forms
Improves error handling in dialog forms by applying server-side validation errors and displaying them to the user.
Also, throws errors from async mutations to be caught by the parent component.
* Refactors project instructions for clarity
Updates and reorganizes project instructions, removing the outdated 'Beast Mode' chatmode and improving the structure of the main copilot instructions.
Specifically:
- Removes the obsolete 'Beast Mode' chatmode file.
- Moves the 'Key Principles' section to the top of `copilot-instructions.md` for better visibility.
- Simplifies backend testing instructions.
* Updated deps
* Upgraded shadcn-svelte components
* Adds form ID to superform instances
This change adds a unique ID to each superform instance.
This will allow us to properly target and interact with forms, enabling improved testing and accessibility.
* Fixes facet filter builder errors
Handles cases where a facet filter builder is not found by returning `undefined` to prevent errors and then filters out any undefined values to prevent rendering issues.
* Removes unused pie chart component
Removes the pie chart card component as it is no longer needed.
* Replaces card components with typography components
Replaces the card components with typography components (H3, Muted) to improve visual consistency and styling control across the application. This change ensures a more uniform and maintainable UI by leveraging the typography components for titles and descriptions.
* Adds form IDs for Superforms
Adds unique IDs to Superforms for easier identification and manipulation, particularly when dealing with multiple forms on a single page or when needing to target specific forms via JavaScript. This enhancement improves form management and accessibility.
* Removes unnecessary key block.
Removes the key block surrounding the children render.
This change avoids potential issues related to state
management and component re-renders when the route changes.
* Update deps
* Updates Node.js version to 24
Updates the Node.js version used in the build environment and Dockerfile to version 24.
This ensures compatibility with the latest dependencies and features.
* lint fix
* Updates node version in Dockerfile
Updates the node version in the Dockerfile from 20.x to 24.x.
This ensures compatibility with the latest dependencies and features.
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
This project features an **ASP.NET Core** backend (REST API) and a **Svelte 5 TypeScript** frontend (SPA).
4
4
5
+
## Key Principles
6
+
7
+
All contributions must respect existing formatting and conventions specified in the `.editorconfig` file. You are a distinguished engineer and are expected to deliver high-quality code that adheres to the guidelines in the instruction files.
8
+
9
+
Let's keep pushing for clarity, usability, and excellence—both in code and user experience.
10
+
5
11
## Instructions Organization
6
12
7
13
This project uses modular instruction files for better organization and targeted guidance. The instructions are organized as follows:
@@ -16,9 +22,3 @@ This project uses modular instruction files for better organization and targeted
-**[Project Structure](instructions/project-structure.instructions.md)** - Understanding the codebase organization
19
-
20
-
## Key Principles
21
-
22
-
All contributions must respect existing formatting and conventions specified in the `.editorconfig` file. You are a distinguished engineer and are expected to deliver high-quality code that adheres to the guidelines in the instruction files.
23
-
24
-
Let's keep pushing for clarity, usability, and excellence—both in code and user experience.
Copy file name to clipboardExpand all lines: .github/instructions/backend.instructions.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,6 @@ applyTo: "**/*.cs"
13
13
## Conventions & Best Practices
14
14
15
15
- Adhere to the `.editorconfig` file and Microsoft's [coding conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions).
16
-
- Follow Microsoft's [unit testing best practices](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices).
- Use `import { page } from '$app/state'` instead of `'$app/stores'`
14
14
- Use snippets `{#snippet ...}` and `{@render ...}` instead of `<slot>` for content projection.
15
15
16
+
## Asynchronous Components (Experimental)
17
+
18
+
**Available in Svelte 5.36+ with experimental.async compiler option**
19
+
20
+
You can now use `await` directly in three places:
21
+
- At the top level of a component `<script>`
22
+
- In a `$derived` expression
23
+
- In template expressions (markup)
24
+
25
+
## Form Handling with Superforms
26
+
27
+
Always supply a unique, stable `id` option for every `superForm` instance (e.g. `id: 'login'`, `id: 'update-user'`, `id: 'invite-user'`). Missing ids lead to duplicate form data warnings when multiple forms (including dialogs) are present. Use short, kebab-case resource-action names and never reuse the same id on the same page.
28
+
29
+
### Safe Data Cloning Pattern
30
+
Always use the `structuredCloneState()` utility when initializing forms and resetting form data to prevent cache mutation and reactive entanglement:
31
+
32
+
```svelte
33
+
import { structuredCloneState } from '$features/shared/utils/state';
34
+
35
+
// Form initialization - use structuredCloneState utility
36
+
const form = superForm(defaults(structuredCloneState(settings) || new NotificationSettings(), classvalidatorClient(NotificationSettings)), {
37
+
// form options...
38
+
});
39
+
40
+
// Form reset in $effect - use structuredCloneState utility
41
+
$effect(() => {
42
+
if (!$submitting && !$tainted && settings !== previousSettingsRef) {
**Note:** This pattern uses Svelte 5's ability to override derived values (available since v5.25). The derived value automatically recalculates when dependencies change, but can be temporarily overridden for UI binding. The `$effect` ensures the local state resyncs when the source data changes.
69
+
70
+
### Superforms onUpdate Pattern for Dialogs
71
+
72
+
When using `superForm` inside dialogs, always use the following `onUpdate` pattern to ensure server-side validation errors are applied and dialogs don't close prematurely. This also prevents SvelteKit from stealing focus on success.
73
+
74
+
```svelte
75
+
const form = superForm(defaults(new MyForm(), classvalidatorClient(MyForm)), {
76
+
dataType: 'json',
77
+
id: 'my-form-id',
78
+
async onUpdate({ form, result }) {
79
+
if (!form.valid) {
80
+
return;
81
+
}
82
+
83
+
try {
84
+
await doAction(form.data);
85
+
86
+
open = false;
87
+
88
+
// HACK: Prevent SvelteKit from stealing focus
89
+
result.type = 'failure';
90
+
} catch (error: unknown) {
91
+
if (error instanceof ProblemDetails) {
92
+
applyServerSideErrors(form, error);
93
+
result.status = error.status ?? 500;
94
+
} else {
95
+
result.status = 500;
96
+
}
97
+
}
98
+
},
99
+
SPA: true,
100
+
validators: classvalidatorClient(MyForm)
101
+
});
102
+
```
103
+
104
+
Requirements:
105
+
- Import and use `ProblemDetails` from `@exceptionless/fetchclient` and `applyServerSideErrors` from `$features/shared/validation`.
106
+
- Close the dialog with `open = false` only after the action succeeds.
107
+
- Set `result.type = 'failure'` after success to avoid focus theft.
108
+
109
+
### Dialog Action Functions Must Rethrow
110
+
111
+
When passing action functions into dialogs (e.g., `save`, `suspend`, `setBonus`), if you display a toast in a `catch` block, you must rethrow the error so the dialog’s `onUpdate` handler can catch it and apply server-side validation errors.
0 commit comments