fix(ui/templates): dereference string params with @ and stack toolbar below title

Smoke testing revealed two issues introduced by the modal extraction commit:

1. ErrorMessage / InitialName / TemplateName parameters on the dialog
   components were passed as bare strings (e.g. ErrorMessage="_newFolderError")
   instead of dereferenced C# expressions (ErrorMessage="@_newFolderError").
   Razor treats unquoted-but-not-@-prefixed values to string parameters as
   string literals — so the error block rendered the literal field name in
   red whenever the modal opened. Non-string parameters (int/IEnumerable)
   were fine since Razor treats those as C# expressions by default.

2. The Templates header + 4-button toolbar shared one flex row, but at
   col-md-4 / col-lg-3 width the buttons overflowed into the right-column
   empty-state area. Stack title above a full-width btn-group instead.
This commit is contained in:
Joseph Doherty
2026-05-11 12:20:40 -04:00
parent 3587ab4fcb
commit acead212b2

View File

@@ -21,25 +21,25 @@
<RenameFolderDialog @bind-IsVisible="_showRenameFolderDialog" <RenameFolderDialog @bind-IsVisible="_showRenameFolderDialog"
FolderId="_renameFolderId" FolderId="_renameFolderId"
InitialName="_renameFolderInitialName" InitialName="@_renameFolderInitialName"
ErrorMessage="_renameFolderError" ErrorMessage="@_renameFolderError"
OnSubmit="SubmitRenameFolder" /> OnSubmit="SubmitRenameFolder" />
<NewFolderDialog @bind-IsVisible="_showNewFolderDialog" <NewFolderDialog @bind-IsVisible="_showNewFolderDialog"
ParentFolderId="_newFolderParentId" ParentFolderId="_newFolderParentId"
ErrorMessage="_newFolderError" ErrorMessage="@_newFolderError"
OnSubmit="SubmitNewFolder" /> OnSubmit="SubmitNewFolder" />
<NewTemplateDialog @bind-IsVisible="_showNewTemplateDialog" <NewTemplateDialog @bind-IsVisible="_showNewTemplateDialog"
FolderId="_newTemplateFolderId" FolderId="_newTemplateFolderId"
ErrorMessage="_newTemplateError" ErrorMessage="@_newTemplateError"
OnSubmit="SubmitNewTemplate" /> OnSubmit="SubmitNewTemplate" />
<MoveTemplateDialog @bind-IsVisible="_showMoveTemplateDialog" <MoveTemplateDialog @bind-IsVisible="_showMoveTemplateDialog"
TemplateId="_moveTemplateId" TemplateId="_moveTemplateId"
TemplateName="_moveTemplateName" TemplateName="@_moveTemplateName"
FolderOptions="EnumerateFolderOptions()" FolderOptions="EnumerateFolderOptions()"
ErrorMessage="_moveTemplateError" ErrorMessage="@_moveTemplateError"
OnSubmit="SubmitMoveTemplate" /> OnSubmit="SubmitMoveTemplate" />
@if (_loading) @if (_loading)
@@ -54,9 +54,8 @@
{ {
<div class="row g-2"> <div class="row g-2">
<div class="col-md-4 col-lg-3"> <div class="col-md-4 col-lg-3">
<div class="d-flex justify-content-between align-items-center mb-2"> <h6 class="mb-2">Templates</h6>
<h6 class="mb-0">Templates</h6> <div class="btn-group btn-group-sm w-100 mb-2">
<div class="btn-group btn-group-sm">
<button class="btn btn-outline-secondary" title="New folder at root" <button class="btn btn-outline-secondary" title="New folder at root"
@onclick="() => OpenNewFolderDialog(null)">+ Folder</button> @onclick="() => OpenNewFolderDialog(null)">+ Folder</button>
<button class="btn btn-outline-secondary" title="New template at root" <button class="btn btn-outline-secondary" title="New template at root"
@@ -64,7 +63,6 @@
<button class="btn btn-outline-secondary" @onclick="() => _tree.ExpandAll()">Expand</button> <button class="btn btn-outline-secondary" @onclick="() => _tree.ExpandAll()">Expand</button>
<button class="btn btn-outline-secondary" @onclick="() => _tree.CollapseAll()">Collapse</button> <button class="btn btn-outline-secondary" @onclick="() => _tree.CollapseAll()">Collapse</button>
</div> </div>
</div>
<div style="max-height: calc(100vh - 160px); overflow-y: auto;"> <div style="max-height: calc(100vh - 160px); overflow-y: auto;">
<div class="templates-root-dropzone" <div class="templates-root-dropzone"