Skip to content

feat(BA-2555): Set primary flow for EOAs in Web#2615

Merged
amiecorso merged 22 commits intomasterfrom
amiecorso/ba-2555-set-primary-flow-for-eoas-in-web
Sep 12, 2025
Merged

feat(BA-2555): Set primary flow for EOAs in Web#2615
amiecorso merged 22 commits intomasterfrom
amiecorso/ba-2555-set-primary-flow-for-eoas-in-web

Conversation

@amiecorso
Copy link
Contributor

@amiecorso amiecorso commented Sep 10, 2025

What changed? Why?
Adds the "Set primary" name flow for EOAs against new contracts (signature-based).

Notes to reviewers

How has it been tested?

Screen.Recording.2025-09-11.at.3.08.32.PM.mov

Have you tested the following pages?

BaseWeb

  • [] base.org
  • [] base.org/names
  • [] base.org/builders
  • [] base.org/ecosystem
  • [] base.org/name/jesse
  • [] base.org/manage-names
  • [] base.org/resources

@linear
Copy link

linear bot commented Sep 10, 2025

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Sep 10, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link

vercel bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
base-web Ready Ready Preview Comment Sep 12, 2025 4:52pm

@amiecorso amiecorso changed the base branch from master to amiecorso/ba-2133-registration-flow-for-eoas-in-web September 10, 2025 22:19
Base automatically changed from amiecorso/ba-2133-registration-flow-for-eoas-in-web to master September 10, 2025 22:55
@amiecorso amiecorso marked this pull request as ready for review September 11, 2025 21:41
<span className="rounded-full bg-white px-2 py-1 text-sm text-black">Primary</span>
<span className="flex items-center gap-2 rounded-full bg-white px-2 py-1 text-sm text-black">
{isPending || isUpdatingPrimary ? (
<Spinner className="h-3 w-3 animate-spin" aria-hidden={true} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of using this we should use: <Icon name="spinner" color="currentColor" /> from 'apps/web/src/components/Icon/Icon';.

It's what we use elsewhere in the codebase and it doesn't need the type casting done above


const PrimaryUpdateContext = createContext<PrimaryUpdateContextValue | undefined>(undefined);

export function PrimaryUpdateProvider({ children }: { children: React.ReactNode }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This provider feels unnecessary since it's only used in two files that are related to each other. Instead, you can add a useState to useRemoveNameFromUI:

const [isUpdatingPrimary, setIsUpdatingPrimary] = useState(false);

And then return isUpdatingPrimary from there so that NameDisplay can use it. Then you won't need this provider/context

return { setPrimaryUsername };
// Drive the spinner strictly off the on-chain write phase
useEffect(() => {
setIsUpdatingPrimary(isWriting);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the isUpdatingPrimary is derived directly from isWriting, do we even need the state? Could NameDisplay just use isWriting to render the spinner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, managed to get this working using existing pending status

canSetUsernameAsPrimary,
isLoading,
transactionIsSuccess: transactionIsSuccess || batchCallsIsSuccess,
isWriting: transactionIsLoading || batchCallsIsLoading,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need a better name than isWriting. It could be confused with the existing isLoading which also checks these two states

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, will go with transactionPending ?

canSetUsernameAsPrimary,
isLoading,
transactionIsSuccess: transactionIsSuccess || batchCallsIsSuccess,
transactionPending: transactionIsLoading || batchCallsIsLoading,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it's used to set isPending which is returned from useUpdatePrimaryName and then used in the name display to manage the badge

@amiecorso amiecorso merged commit 3df8c01 into master Sep 12, 2025
11 checks passed
@amiecorso amiecorso deleted the amiecorso/ba-2555-set-primary-flow-for-eoas-in-web branch September 12, 2025 20:06
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.

3 participants