8000 refactor: Codebase improvements by mwoods79 · Pull Request #88 · huddlz-hq/huddlz · GitHub
[go: up one dir, main page]

Skip to content

refactor: Codebase improvements - #88

Merged
mwoods79 merged 9 commits into
mainfrom
refactor/codebase-improvements
Nov 28, 2025
Merged

mwoods79 merged 9 commits into
mainfrom
refactor/codebase-improvements

Conversation

@mwoods79
Copy link
Copy Markdown
Contributor

No description provided.

- Replace raw HTML checkbox with .input component for consistency
- Replace hardcoded gray colors with daisyUI semantic tokens:
  - bg-gray-50 → bg-base-200
  - text-gray-600 → text-base-content/80
  - text-gray-500 → text-base-content/70
- Preserve Privacy section header for visual grouping
- Remove .claude/commands/ slash commands for specify workflow
- Remove .specify/ directory (templates, scripts, memory)
- Remove specs/ directory with feature specifications
Replace hardcoded gray colors with daisyUI semantic tokens across
all LiveView modules for better theme support:

- text-gray-600 → text-base-content/80
- text-gray-500 → text-base-content/70

Files updated:
- auth_live/register.ex, reset_password_confirm.ex
- group_live/edit.ex, show.ex
- huddl_live/new.ex, edit.ex, show.ex

Also fix raw checkbox in group_live/edit.ex to use .input component
Replace hardcoded bg-red-500 with daisyUI btn-error class for
consistent theming support in HuddlLive.Show delete button.
Add documentation to 14 LiveView modules:
- auth_live: sign_in, register, reset_password, reset_password_confirm
- group_live: index, show, new, edit
- huddl_live: show, new, edit, main search page
- admin_live, profile_live
Create docs/ARCHITECTURE.md with:
- Entity relationship diagram (mermaid)
- Group and Huddl permission matrices
- Visibility rules flowchart
- Group member role hierarchy
- Huddl lifecycle state diagram
Create CommunityComponents module with:
- .huddl_list - renders huddl list with empty state handling
- .member_card - renders individual member with owner badge
- .member_list - renders member grid with permission handling

Update GroupLive.Show to use new components, reducing template
code by ~30 lines while improving consistency.
- Remove manual check_group_access from GroupLive.Show (Ash read policies handle this)
- Replace manual auth checks with Ash.can? in GroupLive.Edit, HuddlLive.New/Edit
- Fix HuddlLive.Edit bug where only creator could edit (now owners/organizers can too)
- Refactor all auth flows to use consistent `with` statement pattern
- Extract authorize_* and assign_*_form helpers to reduce nesting

This aligns LiveView authorization with the Ash resource policies defined in
Group and Huddl resources, ensuring consistent permission enforcement.
- Create HuddlzWeb.Live.ErrorHelpers module with:
  - handle_error/3 for consistent flash + redirect patterns
  - authorize/2 wrapper for Ash.can? checks
  - normalize_result/1 for converting Ash errors to standard atoms
- Import ErrorHelpers in live_view macro for automatic availability
- Update LiveViews to use centralized helpers:
  - GroupLive.Show, GroupLive.Edit
  - HuddlLive.New, HuddlLive.Edit, HuddlLive.Show

Reduces boilerplate and ensures consistent error messaging across LiveViews.
@mwoods79
mwoods79 merged commit 076c933 into main Nov 28, 2025
1 check passed
@mwoods79
mwoods79 deleted the refactor/codebase-improvements branch November 28, 2025 15:14
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

0