Skip to content

feat: WebFormsForm component for interactive-mode Request.Form support (#533)#535

Merged
csharpfritz merged 16 commits intoFritzAndFriends:devfrom
csharpfritz:feature/webformsform-533
Apr 13, 2026
Merged

feat: WebFormsForm component for interactive-mode Request.Form support (#533)#535
csharpfritz merged 16 commits intoFritzAndFriends:devfrom
csharpfritz:feature/webformsform-533

Conversation

@csharpfritz
Copy link
Copy Markdown
Collaborator

Summary

Adds the WebFormsForm component that wraps Blazor's EditForm to capture form POST data and expose it via Request.Form in interactive Blazor Server mode.

Changes

  • WebFormsForm component with Request.Form integration
  • FormShim dual-mode support (SSR + interactive)
  • 39 unit tests for FormShim and WebFormsForm
  • Documentation, sample pages, and Playwright integration tests

Closes #533

csharpfritz and others added 4 commits April 11, 2026 16:38
…AndFriends#533)

- FormShimTests.cs: 27 tests covering SSR (IFormCollection) and interactive
  (Dictionary<string, StringValues>) modes for indexer, GetValues, AllKeys,
  Count, ContainsKey, and SetFormData mutation
- WebFormsFormTests.razor: 12 bUnit tests for form rendering, Method/Action
  parameters, ChildContent, HtmlAttributes, and default POST method
- Fix WebFormsForm.razor: add @inherits ComponentBase to prevent duplicate
  CaptureUnmatchedValues from BaseWebFormsComponent via _Imports.razor
- Fix RequestShim.cs: disambiguate FormShim(null) constructor call

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
FritzAndFriends#533)

- WebFormsForm.razor: dual-mode form component (SSR plain form, interactive
  with JS interop for FormData capture via bwfc-webformsform.js)
- FormShim.cs: dual-mode support (IFormCollection for SSR, Dictionary for
  interactive), SetFormData mutation, disambiguated constructor
- FormSubmitEventArgs.cs: EventArgs carrying form data to OnSubmit callback
- FormMethod.cs: Get/Post enum matching Web Forms FormMethod
- RequestShim.cs: cached FormShim for interactive mode, SetFormData method
- WebFormsPageBase.cs: lazy-cached Request property, SetRequestFormData
  overloads (Dictionary and FormSubmitEventArgs)
- bwfc-webformsform.js: ES module reading FormData from DOM elements

Closes FritzAndFriends#533

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Session: 2026-04-11-webformsform-533
Requested by: Orchestrator (Scribe)

Changes:
- Logged orchestration events: Forge (architecture), Cyclops (component build), Rogue (test suite), Coordinator (integration)
- Merged decision inbox (11 files): WebFormsForm architecture, PostBack shim strategy, ES module interop, @inherits fix, ClientScript transform consolidation, Strangler Fig pattern docs
- Deleted inbox files after merge (6 exact-match deduplicates removed)
- Updated Cyclops/Rogue history.md with cross-agent team updates
- Created session log: 2026-04-11-webformsform-533.md

Wave 1 (Forge/Cyclops/Rogue/Coordinator) completed.
Wave 2 (Jubilee/Beast/Colossus/Playwright) ready to launch.

All 4 agents synchronized. FormSubmitEventArgs created. WebFormsForm + tests delivered.
39 bUnit tests passing. RequestShim dual-mode support enabled (IFormCollection + Dictionary).
RequestShim.SetRequestFormData() accepts FormSubmitEventArgs. JS interop via ES module.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ritzAndFriends#533)

- WebFormsFormDemo.razor: interactive sample page at /migration/webforms-form
  demonstrating WebFormsForm + SetRequestFormData + Request.Form pattern
- WebFormsForm.md: component documentation with parameters, before/after
  comparison, dual-mode explanation, and migration path
- WebFormsFormTests.cs: 4 Playwright tests (smoke, render, interaction,
  navigation-stays-put) + 1 smoke InlineData in ControlSampleTests
- RequestShim.md: cross-reference to WebFormsForm for interactive mode
- mkdocs.yml: nav entry under Utility Features
- ComponentCatalog.cs: sidebar entry under Migration Helpers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
{
await _jsModule.DisposeAsync();
}
catch (JSDisconnectedException) { }
await _jsModule.DisposeAsync();
}
catch (JSDisconnectedException) { }
catch (ObjectDisposedException) { }
csharpfritz and others added 12 commits April 12, 2026 19:00
- Expand shim tables across bwfc-migration, migration-standards, and
  copilot-instructions to cover all 10 shims (FormShim, ClientScriptShim,
  ScriptManagerShim, RequestShim, ResponseShim, SessionShim, CacheShim,
  ServerShim, ViewStateDictionary, WebFormsPageBase)
- Add WebFormsForm, ClientScript Migration, and PostBack Event Handling
  sections to bwfc-migration skill
- Fix SelectMethod contradiction in CONTROL-COVERAGE.md (Items -> delegate)
- Fix IsPostBack from 'always false' to correct SSR/Interactive behavior
- Remove incorrect AddSessionShim() references (auto-registered)
- Update blazor-form-submission squad skill with WebFormsForm component
- Expand copilot-instructions-template code-behind table (6->12 entries)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…figurationManager

- Add ConfigurationManagerTransform (Order 110): strips System.Configuration using,
  detects AppSettings/ConnectionStrings usage, emits BWFC shim guidance
- Add RequestFormTransform (Order 320): detects Request.Form["key"] patterns,
  emits FormShim + WebFormsForm guidance
- Add ServerShimTransform (Order 330): detects Server.MapPath/HtmlEncode/UrlEncode,
  emits ServerShim guidance
- Update TodoHeaderTransform with all 14 shim references
- Register new transforms in Program.cs DI and TestHelpers pipeline
- Update bwfc-migrate.ps1 with BWFC015-018 scan patterns
- Regenerate all 13 expected .razor.cs test files
- All 373 tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Session: 2026-04-12-migration-toolkit-enhancement
Requested by: Scribe (autonomous)

Changes:
- Added 3 agent orchestration logs (Psylocke, Forge, Bishop)
- Added session log for migration toolkit enhancement
- Merged 3 inbox decisions into decisions.md (deleted inbox files)
- Updated agent history.md files with cross-team notifications
- All .squad/ files reconciled and deduplicated

Agents:
- Psylocke: Updated 11 skills, fixed SelectMethod/IsPostBack/PostBack docs
- Forge: WingtipToys gap analysis, SessionShim as P0 blocker identified
- Bishop: 3 CLI transforms added, 373/373 tests passing
- Forge: Added Core Context section summarizing milestones M1-M17+, architecture patterns, deployment, recent milestones (multi-targeting, ViewState, git workflow)
- Bishop: Added Core Historical Context section (2025-01-26 to 2026-03-29) covering theme migration, CLI pipeline, transforms
- Both: Reduced detail in early sections, preserved recent work
- Session: 2026-04-12-migration-toolkit-enhancement
Update all 5 migration-toolkit docs to reflect that BWFC shims now
handle ~20% of work previously requiring manual Layer 2 conversion:

- METHODOLOGY.md: Add Shim Infrastructure subsection, update pipeline
  percentages (L1 60%, L2 30%, L3 10%), add shim vs native comparison
- CHECKLIST.md: Add L1 shim setup items, mark shim-handled APIs as
  auto, add Optional Refactor to Native Blazor section
- QUICKSTART.md: Add shim callout, update transform table, add
  WebFormsForm guidance
- README.md: Update percentages, time estimates, add shim bullet
- CONTROL-COVERAGE.md: Add Infrastructure & Shim Components section,
  update component counts (154 total)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The CLI tool (37 compiled transforms, 373 unit tests) is now featured
as the primary Layer 1 tool in README, METHODOLOGY, QUICKSTART, and
CHECKLIST. The PowerShell script is positioned as a lightweight
alternative for quick starts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… CLI updates

Session: 2026-04-12-migration-toolkit-updates
Orchestration: Bishop (73c8efe) + Coordinator (e504d01)

Changes:
- Orchestration logs: Bishop shim-first update, Coordinator CLI tool references
- Session log: Migration toolkit updates summary
- Decisions merged: Bishop shim-first migration paradigm decision
- Cross-agent update: Coordinator CLI additions logged to Bishop history
- Inbox cleaned: bishop-shim-first-docs.md merged and deleted
… all skills

Rewrote all 5 skills and 4 docs to prevent agents from manually
implementing session, redirect, and cookie logic when shims exist.

Key changes:
- Added MANDATORY RULES and ANTI-PATTERNS sections
- SessionShim is now THE primary session strategy (not Minimal API)
- Response.Redirect/Request.QueryString preserved via shims
- Added migration decision tree for common patterns
- Demoted shim-to-native conversion to optional L3 optimization
- Added DbContext materialization pattern for SelectMethod

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The test locators were matching the always-visible migration guidance card
instead of the actual results card. Updated to use the exact
data-audit-control attribute 'webforms-form-results'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The WebFormsForm Playwright tests were racing against Blazor Server
circuit establishment. During prerendering, the form renders without
@onsubmit:preventDefault, so clicking submit before the circuit is
ready causes a full-page POST that resets component state.

Changes:
- Add data-interactive attribute to WebFormsForm when in interactive mode
- Wait for form[data-interactive] in tests before filling/submitting
- Tighten input locators to match actual field names (username, email)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
HttpContextAccessor.HttpContext is never null in Blazor Server (even
during SignalR circuits, it returns the connection's HTTP context).
Replace with OnAfterRender-based detection which only fires on
interactive circuits, never during prerendering or static SSR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
In Blazor Server interactive circuits, HttpContext is available (from
the SignalR WebSocket connection), but its Request.Form contains the
WebSocket upgrade request data, not the interactive form submission.
When SetFormData() has been called (WebFormsForm submit), the cached
interop-backed FormShim must take priority.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@csharpfritz csharpfritz merged commit 5088de9 into FritzAndFriends:dev Apr 13, 2026
4 checks passed
@csharpfritz csharpfritz deleted the feature/webformsform-533 branch April 13, 2026 14:46
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.

Add WebFormsForm component for interactive-mode Request.Form support

2 participants