Skip to content

UI: Centralize alerts, field errors, and status dots - #233

Open
Ayush4958 wants to merge 1 commit into
stratum-mining:mainfrom
Ayush4958:fix/issue-178-ui-refactoring
Open

UI: Centralize alerts, field errors, and status dots #233
Ayush4958 wants to merge 1 commit into
stratum-mining:mainfrom
Ayush4958:fix/issue-178-ui-refactoring

Conversation

@Ayush4958

@Ayush4958 Ayush4958 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

It solves the issue by centralizing the duplicated UI components scattered across the setup wizard, settings & dashboard. It introduces a unified, scalable design system using class-variance (CV) to eliminate raw Tailwind class duplication.

Closes :- #178

Changes Made

  • New Components :-
    • <Alert>: Replaces 15+ duplicated warning/success/error banners. Supports neutral, info, warning, destructive & success variants with automatic ARIA roles.
    • <FieldError>: Replaces 20+ inline <p className="text-destructive"> form validation error messages across the setup forms.
    • <StatusDot>: Unifies the connection status indicators in the Shell, ConfigurationTab, and ConnectionStatus components.
  • Refactoring: Migrated all Setup Wizard steps, Configuration Tab, and the Unified Dashboard to use the new component suite.

Validation

  • npm run typecheck passes with no unused imports.
  • npm run lint passes with 0 warnings.
  • Tested locally.

@Ayush4958

Copy link
Copy Markdown
Contributor Author

@pavlenex @lucasbalieiro

I had refactored it and check it manually and it works fine
I had not touch any functionality / working function
I purely focused on refactoring the ui component and tried to make them re-usable

PR is ready for review, take time for it
Thanks ....

@lucasbalieiro

Copy link
Copy Markdown
Collaborator

@Ayush4958, thanks. I'll start reviewing it today.

In the meantime, could you rebase the PR and solve the conflicts to avoid adding this merge commits: Merge branch 'main' of https://github.com/stratum-mining/sv2-ui

Because they are polluting the diff that I want to review.

@Ayush4958
Ayush4958 force-pushed the fix/issue-178-ui-refactoring branch from 732219b to 91bb24f Compare August 4, 2026 18:24
@Ayush4958

Copy link
Copy Markdown
Contributor Author

sorry @lucasbalieiro for late reply
I had rebased the PR, Its ready for review
thanks ..

) : (
<Play className="h-4 w-4 shrink-0 text-primary" />
)}
<Alert

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the icon in this Start Mining alert got misaligned:

Image

const [currentStep, setCurrentStep] = useState<SetupStep>('mining-mode');
const [data, setData] = useState<SetupData>(initialSetupData);
const [isReconfiguring, setIsReconfiguring] = useState(false);
const [isSetupReview, setIsSetupReview] = useState(false);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason to delete this state?

<div className="mb-6 p-3 rounded-xl bg-warning/[0.08] text-sm text-warning flex gap-2 items-start">
<AlertCircle className="w-4 h-4 mt-0.5 flex-shrink-0" aria-hidden="true" />
{isSetupReview
? 'Review your setup to continue mining. Your saved settings are prefilled.'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that you dropped this but is not introducing anywhere else in this refactor. Any reason why?

@lucasbalieiro lucasbalieiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going in the right direction. I've left a few comments regarding some changes around the drop of the alert for "Review your setup to continue mining. Your saved settings are prefilled".

This might introduce a regression that was fixed in #234.

Please avoid dropping the error messages even if they seem alike, let's focus only on reorganizing the ui components

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.

2 participants