Skip to content

[KISS/Clean Code] Extract grid column, change-mapping and enabled-cell rendering policies #119

Description

@KeyffMS

Audit finding

ApplicationAssignmentsGrid is a useful presentation boundary, but one class still owns:

  • DataGridView and column construction;
  • selector option population;
  • row writing and lookup;
  • column-name-to-command translation;
  • recoverable data-error classification and diagnostics;
  • custom enabled-cell painting;
  • selection and empty-state publication.

The result is a large control whose data contract, rendering rules and event decoding change for unrelated reasons.

Target state

Keep ApplicationAssignmentsGrid as the UserControl boundary while extracting only stable focused collaborators, for example:

  • column/selector configuration;
  • typed cell-change mapping;
  • enabled-state cell renderer;
  • selector data-error policy.

Avoid introducing a general UI framework.

Acceptance criteria

  • Column construction and selector option definitions are outside the main control lifecycle code.
  • Mapping a changed cell to ApplicationAssignmentChange is independently testable without raising WinForms events.
  • Enabled-cell painting is isolated and testable through its input state/geometry policy.
  • Recoverable selector-error classification remains explicit and continues to emit structured diagnostics.
  • ApplicationAssignmentsGrid remains the owner of selection, binding, row updates and typed change publication.
  • Existing keyboard, focus, selection, rollback and empty-state behavior remains unchanged.
  • No reflection-based or global DataGridView workaround is introduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions