Show 'Add New'/'Duplicate' form in a persistent side panel#783
Conversation
Replaces the modal dialog shown when creating ("Add New") or duplicating
configuration objects with a collapsible panel docked on the right of the
page. The panel keeps its state across page navigation, so the user can
look up related data while filling in a new entry, and can collapse/expand
it with arrow buttons.
- Add circuit-scoped CreationPanelService holding one active CreationSession
(asks to discard when another creation is started while one is open).
- Extract the creation form into a reusable ItemCreationForm component;
ModalCreateNew now hosts it, so account/user/plugin creation stay modal.
- EditConfigGrid create/duplicate hand their context to the panel and reload
the grid via the ItemCreated event.
- ItemTable nested "Create" uses the same panel (page-bound: cancelled when
navigating away from the edit page, since it reuses the page's context).
- Link the AdminPanel scoped CSS bundle in App.razor so the panel styles are
actually delivered to the browser.
- Fix the MonsterDefinition singular caption ("Monsters" -> "Monster").
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the user experience for creating and duplicating configuration objects by moving these workflows from transient modal dialogs to a persistent side panel. This change allows users to navigate the application while keeping their input data intact, significantly improving multitasking capabilities. The implementation introduces a centralized service to manage creation sessions and refactors existing form components to support this new UI pattern. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a persistent side panel for creating and duplicating items, replacing the previous modal-based workflow. Key changes include the addition of a circuit-scoped CreationPanelService to manage creation sessions across page navigations, a new CreationPanel UI component, and the refactoring of creation logic into a reusable ItemCreationForm. Feedback focuses on ensuring that EditForm validation is properly enforced by using the OnValidSubmit event, improving resource management by wrapping context creation in try-catch blocks for reliable disposal, and correctly awaiting all subscribers of asynchronous events within the service.
- ItemCreationForm: use EditForm.OnValidSubmit so DataAnnotations validation is enforced before submit instead of bypassing it via the button onclick. - EditConfigGrid.OnCreateButtonClickAsync: wrap context creation in try/catch so the context is disposed if an exception occurs before the session starts (consistent with OnDuplicateButtonClickAsync). - CreationPanelService: await every ItemCreated subscriber via the invocation list rather than only the last one. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a persistent side panel for object creation and duplication, replacing the previous modal-based workflow. Key additions include the CreationPanel component, a CreationPanelService for managing creation sessions across page navigations, and the ItemCreationForm for unified form handling. Feedback highlights an opportunity to optimize asynchronous calls in EditConfigGrid by removing unnecessary Task.Run usage. Additionally, several comments point out hardcoded strings in UI components and services that should be moved to resource files to support localization.
Addresses the second round of review feedback: - Move user-facing strings to resource files: the Submit/Cancel buttons and the discard-confirmation dialog (Web.Shared), and the creation success toast and panel collapse tooltips (AdminPanel). - ItemTable creation title now uses the localized type caption (GetTypeCaption) instead of the raw CLR type name. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
MainLayout, it survives page navigation — so a user can look up related data (on other pages) while filling in a new entry, then save. The panel can be collapsed/expanded with arrow buttons.How it works
CreationPanelServiceholds a single activeCreationSession(item, type, context, save/cancel delegates) and raisesStateChanged/ItemCreatedevents.CreationPanel.razor(inMainLayout) renders the form for the active session.ModalCreateNewinto a reusableItemCreationForm.ModalCreateNewnow hosts it, so the remaining modal flows (account/user creation, plugin config) are unchanged.EditConfigGridcreate/duplicate transfer their persistence context to the panel (the panel owns and disposes it) and reload the grid via theItemCreatedevent.ItemTable's nested "Create" uses the same panel, but page-bound: it reuses the edit page's context and is cancelled when navigating away from that page (its context can't outlive the page).Notes
App.razornow also links the AdminPanel scoped-CSS bundle (_content/MUnique.OpenMU.Web.AdminPanel/...styles.css). The host (Startup.styles.css) only imports the library bundles, not AdminPanel's own scoped CSS, so the panel's styles weren't being delivered without this.MonsterDefinitionsingular type caption from "Monsters" to "Monster" (also improves the edit-page heading).Test plan
🤖 Generated with Claude Code