Skip to content

refactor(frontend): clean up component architecture and shared logic #58

Closed

Description

@RentnerKev

Summary

Perform a targeted frontend architecture cleanup.

This is NOT a full rewrite.

Goals

Reduce:

  • business logic inside TSX
  • duplicated code
  • duplicated types
  • huge components
  • unused helpers
  • stale comments
  • dead exports
  • page-specific implementations of reusable behavior

TSX Rule

TSX files should primarily contain:

  • composition
  • rendering
  • small presentation logic
  • direct UI event wiring

Complex logic belongs in:

hooks
services
shared utilities
feature logic
server modules

depending on actual architecture.

Hooks

Extract reusable/stateful UI logic where it improves clarity.

Do NOT create pointless one-use hooks just to reduce line count.

Types

Types should live in the narrowest sensible reusable location.

Examples:

feature-local types
shared domain types
API types

Avoid giant global types.ts dumping grounds.

Duplicate Code

Search for duplicated:

table behavior
filters
menus
modal state
form helpers
query invalidation
formatting
validation wrappers
status mapping

Extract only meaningful duplication.

Comments

Remove comments that merely restate the code.

Keep comments that explain:

  • unusual security decisions
  • non-obvious constraints
  • compatibility behavior
  • why a surprising implementation exists

Do NOT blindly delete valuable comments.

Acceptance Criteria

  • reduced TSX business logic
  • meaningful shared logic extracted
  • duplicate code reduced
  • unused code removed
  • types organized
  • no architecture astronautics
  • behavior unchanged except intended UX fixes
  • tests remain green

Workflow

UI/UX and cleanup only. Implement in a focused PR; merge only after current-head required checks and production smokes succeed. Do not publish Alpha 3.

Dependencies

Depends on #52, #53, #54, #55, #56 and #57.

Activity

  1. added this to the v1.0.0-alpha.3 milestone on Sep 12, 2026
  2. added
    area: ui
    on Sep 12, 2026
  3. RentnerKev commented on Sep 12, 2026

    @RentnerKev
    MemberAuthor

    Implementation is complete and validated in PR #63, following the shared table/filter foundation in PR #62. The work is split into issue-sized commits in the existing follow-up branch. Local full check passed (614 web tests, 119 Rust tests and builds), and CI Web Tests, Rust and Build are green for f4292e1. Production Smokes and final CodeQL are still running.

    The issue remains open until the PR is merged. Repository rules require one approving Code Owner review in addition to all 14 current-head required checks; no bypass or release has been performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ui

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions