Skip to content

chore: refactor fronend code#3

Merged
IvanPartsunev merged 3 commits intomainfrom
develop
Jan 12, 2026
Merged

chore: refactor fronend code#3
IvanPartsunev merged 3 commits intomainfrom
develop

Conversation

@IvanPartsunev
Copy link
Owner


Summary

  • Standardize table styling across all pages with pixel-based column widths to prevent column overlap
  • Migrate admin pages from manual state management to React Query hooks for better caching
  • Add shared style constants and utilities for consistent UI patterns
  • Add comprehensive README documentation for frontend directories

Changes

Table Styling Refactor

  • Replace percentage-based column widths with pixel values to fix column overlap issues
  • Add TABLE_STYLES constants with table size variants (tableSmall, tableMedium, tableLarge, tableXLarge)
  • Add COLUMN_WIDTHS constants for consistent column sizing (rowNumber, name, email, phone, actions, etc.)
  • Update all table components: Board, Control, CooperativeMembers, Proxies, ProductsManagement, DocumentsManagement, NewsManagement, UserManagement

Caching Improvements

  • Migrate admin pages to use React Query hooks instead of manual useState/useEffect
  • Add usePagination hook for consistent table pagination logic
  • Reduce redundant API calls through query caching

Shared Utilities

  • Add lib/tableUtils.ts with table styling constants and pagination helpers
  • Add lib/styles.ts with HERO_STYLES and SECTION_STYLES for consistent page layouts

Documentation

  • Add README files for components/, hooks/, lib/, and pages/ directories
  • Document available utilities, hooks, and component patterns

Bug Fixes

  • Fix uploaded_by_name display in DocumentsManagement (was showing ID instead of name)
  • Fix TypeScript type issues with optional fields in User, FileMetadata, and NewsItem interfaces
  • Add proper null checks for optional date and ID fields

Test plan

  • Verify all tables display without column overlap on different screen sizes
  • Check horizontal scroll works on narrow viewports
  • Verify admin panel caching (navigate away and back - should not refetch)
  • Confirm DocumentsManagement shows uploader name, not ID
  • Run pnpm build - should complete without TypeScript errors

- Replace percentage-based column widths with pixel values in tableUtils.ts
- Add table size variants (tableSmall, tableMedium, tableLarge, tableXLarge)
- Update all table components to use shared TABLE_STYLES and COLUMN_WIDTHS
- Add styles.ts with shared HERO_STYLES and SECTION_STYLES constants
- Migrate admin pages to React Query hooks for caching
- Add usePagination hook for consistent table pagination
- Add README documentation for components, hooks, lib, and pages
…s, Documents, User, and File management with defaults and null checks

- Deleted `.serena/project.yml`, `.claude/settings.json`, and related files.
- Added default values and null checks in `NewsManagement`, `DocumentsManagement`, `FileManagement`, and `UserManagement`.
- Updated table column widths to maintain consistency.
- Refined typing in React Query hooks for improved type safety.
- Switched API base URL to production.
@IvanPartsunev IvanPartsunev changed the title refactor: fronend code chore: refactor fronend code Jan 12, 2026
@IvanPartsunev IvanPartsunev merged commit a7ad51d into main Jan 12, 2026
1 of 2 checks passed
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.

1 participant