Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam starts fresh from an up-to-date main, then has Claude rewrite the booking error messages and show them as Sonner toasts. He makes the design calls himself, tests the double booking again and commits in the team's style.
What you'll learn
- Start new work from an up-to-date
main:git status,git checkout main,git pull; re-runnpm installnow and then. - Reproduce an error state with two sessions (a normal and an incognito window).
- Brief Claude on UX copy: messages should help people recover, not just describe the state.
- Use
@to name an exact component so dictation doesn't garble it. - An error toast should look different from a success toast and stay until dismissed.
- Keep PRs small: park related improvements as separate issues.
- A change to the shared component beats one-off style overrides: it leaves a reusable pattern.
- Once the team's conventions are saved, Claude proposes commit messages in their style.
Chapters
- 00:00Reproducing a double-booking error
- 01:42Starting fresh from main
- 05:26Briefing Claude on error messages
- 07:47Design calls and a small PR
- 10:19Testing the new error toast
- 12:08Reviewing the change and committing
- 00:00In the previous video, we talked about rules, the written rules, unwritten rules, uh how some of them are enforced strictly and orders is something we just need to keep
- 00:09in the back of our heads or learn teach clogs to remember.
- 00:13So now let's try to see it all in action by making our first contribution to this mature version of the repository.
- 00:21So first uh I'm going to find a way or I'm going to find a thing that I would like to work on and then we're going to discuss how
- 00:28we can get started.
- 00:29So um I'm going to do a test over here.
- 00:32I have this application running locally um and I have actually open in both tabs, one my main browser and the other one is an incognito mode browser and I'm
- 00:42going to make um a new booking here for uh for the place number two on Friday, November 20.
- 00:51Um okay, it's booked and over here I'm going to simulate a situation in which um another user tried to book the exact same spot um in the same time.
- 01:02And um well the good news is that this error is being handled.
- 01:06Uh there is an error state, although the way it's being presented to the user is something we could very much improve.
- 01:12So not only the message is rather short and harsh, the way it's displayed over here might not be the most fortunate.
- 01:18Um in case you leave a longer node, you might not notice this at all.
- 01:22Um so I'm thinking perhaps we could use our toast notifications or sonars as they are actually called over here since in this repository we have migrated our UI components
- 01:32to shadcn. And um and so yeah, this is something I would like us to to work on and create a PR for eventually.
- 01:41So I'm going to head back to my Claude Code desktop application and before I start working or before I before I send my first prompt, I need to make
- 01:49sure we are starting fresh and we are starting clean.
- 01:52So in the previous modules, you know, things were fairly easy because it was only us contributing to these to that code base.
- 01:59Over here we need to be of the fact that there are other people working simultaneously with us, and we need to make sure that every time we begin working
- 02:07on something new, it's important that we, you know, branch off of the most recent version of main and that we do work on main in general.
- 02:16So over here, I'm in Claude.
- 02:18So the first thing I need to make sure is that over here my branch is set on main, not anything else.
- 02:24I really want to start off while being on main because I don't want Claude you know, researching the code base, answering my questions on you know, the an out-of-date
- 02:35version of the code.
- 02:36So let me switch back.
- 02:37Let me switch over to main.
- 02:39And another thing that is just a good habit to have is to is to maybe like see if there is nothing like in our work tree that is not
- 02:50being committed, that is not committed or maybe there are some new files that are untracked.
- 02:55A way to do this would be the by just typing git status.
- 03:00So over here it says we are still on branch my order work, nothing to commit, working tree clean.
- 03:06So this is a good thing, but this is not so over here even though I changed the even though I have changed the the the way this conversation is
- 03:15going to begin, like this terminal is still showing me still showing me the order branch.
- 03:23If I wanted to be extra clear, what I can do is I can type git checkout main, I believe.
- 03:28And yes, now we are switched to main and we are up to date with origin main.
- 03:34So that is the most important thing we need to make sure that we are like this branch the local main is based on the most fresh version of the
- 03:43of the origin main.
- 03:45One way to make sure that is 100% the case would be running git pull command while being on main and then it confirms that we are already up to
- 03:54date. If it's been a while since we last touched this code base or if we know that there has been there have been some some heavy changes happening to
- 04:04the codebase. Another good thing that's nice that we can do every every now and then is running that npm install command to make sure that all of the dependencies
- 04:15required for application to be run and tested locally are indeed installed.
- 04:20And if we have if we have like restarted our computer, we would need to also remember about starting the local database and typing the npm run dev so that
- 04:33we can preview the work that's happening.
- 04:35If we didn't do that, that's okay.
- 04:37Claude is going to do it automatically for us at some point.
- 04:40Now all of the steps that I've just listed over here, yes, this is something that is going to be repetitive after a while, so we might consider actually turning
- 04:49this into a skill eventually at some point so that all it takes at the at the beginning of each conversation is telling Claude, hey, first of all, before doing
- 04:58anything, or maybe that would be like more appropriate as a rule in our local CLAUDE.md file.
- 05:05So something along the lines of before we do anything, make sure we are, you know, starting fresh.
- 05:10We have all the most recent changes from the remote repository.
- 05:14No dependencies are uninstalled.
- 05:16The database, our local database is synced with the remote database.
- 05:21Things along these lines, just a good habit to to to be doing something like this.
- 05:28But now since I've confirmed that since I've confirmed that I have everything that I need and I'll be starting off from main, let's see.
- 05:37Let's go back to this change and let me switch over to an auto mode and let the work begin.
- 05:46Claude, in this session, I would like us to unify error messages that you can get when trying to book a spot and make them more human friendly.
- 05:57Right now they seem to be focusing only on describing the current state, but they don't offer any tips on how you can get out of this situation that you
- 06:09have found yourself in.
- 06:11For example, when you try to book a spot that somebody else has taken a second ago, the only error message you're going to see is spot taken.
- 06:22I would like you to find all error messages, list them, and give me recommendations on how we can reward it.
- 06:31Additionally to this, I would like us to present all error messages using sonar component so that it is consistent with the way we present confirmation messages.
- 06:47Okay, I'm going to leave it at that.
- 06:50One thing we can do is whenever we mention or whenever we call out a name of a component, it's a good thing to double check whether it's been captured
- 07:00right. Over here I can see it's not what I meant.
- 07:03It it picked up sonar, not sonar.
- 07:07So I'm going to just use at and I'm going to do sonar.
- 07:11And I'm just going to mention the name of the component that I had in mind.
- 07:15And the reason I know about this component is because I have previously went through the codebase and I can see and I know what kind of components I have,
- 07:25UI components I have at my disposal.
- 07:28And there it is, the sonar component.
- 07:30Okay, I'm in the plan, so all looking good.
- 07:33I'm just going to hit send.
- 07:35And first I going to let Claude explore our current error messages.
- 07:40I'm going to probably wait for questions from Claude and then let's see what kind of plan we're going to have.
- 07:49Okay, and the questions are in.
- 07:51The first one is whether the toast component or sonar sonar component should have any different styling for errors.
- 07:59I think I'm just going to go with for the identical.
- 08:02Or you know what, no.
- 08:04On a second thought, it would be too easy to confuse um success toast message with an error toast message.
- 08:12So perhaps adding a subtle queue um would be a nice idea.
- 08:17Uh Claude suggests some toast uh same toast plus a small marker, for example a red accent or icon so error stands out.
- 08:26Um I'm actually going to say um how about um red side border on the left and um let's keep uh error toasts uh stay on the screen until dismissed
- 08:51so that um so that you know when there has been an error and it's not that you're going to make a booking, perhaps you're going to get distracted and
- 09:00you'll just miss the fact that there was an error message instead of a confirmation message.
- 09:06Um besides booking um to order screens show inline red error, sign in and profile.
- 09:14Right. Um I'm really glad I'm really glad that Claude is surfacing this because um it's generally considered So basically what Claude is saying is that okay um should we
- 09:28think or talk about uh unifying the way all uh error messages look like including um errors when you're trying to sign in um or errors about editing your profile.
- 09:40So it is a good idea Even though we do want to have that consistency across the entire application when thinking about software development and working with Git um and
- 09:49working with creating PRs, it's a good thing to keep them to keep them small and focused so that PRs are as small as possible.
- 09:56What I would do over here is I would definitely go with uh just you know fixing booking error messages and then I would probably want to save the order
- 10:04errors or park them as linear issues that I'm going to tackle right after that.
- 10:09Um and for now I'm just going to go with the booking only.
- 10:13So with that, I'm going to wait for Claude to come up with a plan and create that first implementation so that we can review it.
- 10:23Okay, Claude presented me with a plan.
- 10:25I have approved it and then it went on to uh carry out the implementation.
- 10:31Uh it was grabbing screenshots and testing as I as we go so I could have a little bit of a sneak peek on you know how it looks like.
- 10:39Uh very nice. So what I would do now is um for each error message um I would probably want to have another look at all of the UX copy
- 10:50that Claude suggested. I want to consider whether it's something I would like to go with or not and I would definitely want to have Claude uh walk me through
- 10:59how I can like literally like test all of these error messages in my browser.
- 11:04Um it's not that we have like like many of them.
- 11:09I would I would I guess feel a little bit more comfortable raising a PR for something that I have uh tested personally in my browser.
- 11:16So one thing I definitely know how to do is I can replicate that um overbooking experiment.
- 11:23Uh I still have the application running in two browsers and I'm sorry in the same browser but like one in in the incognito mode.
- 11:30So I'm going to select uh spot number three.
- 11:33I 'm going to book it and then I 'm going to try to do the same thing in that other browser and I can see uh the error toast
- 11:41message. Uh so I'm going to wait and see if it truly disappears uh so that it doesn't disappear.
- 11:47It seems like that is the case.
- 11:49The copy I really like it.
- 11:50Um I'm not a super fan perhaps of this styling maybe.
- 11:54Maybe I'd like to explore a little bit about that um but I think for the time being it's going to be okay.
- 12:00Uh so I'm just going to close it and um seems like the first implementation is okay.
- 12:06Um wonderful. Uh a couple of things that I can see Claude has changed is um you for example the sonar that TSX component.
- 12:15So in order for Claude to I'm sorry.
- 12:18So in order for Claude to be able to um have that right red strip on the toast component it had to um it had to go and edit the
- 12:30component files itself which is really nice.
- 12:32I would have liked that over applying some manual styling overrides for toast components and if we ever need to grab an error or like use an error toast we
- 12:44now have a pattern that we can latch onto.
- 12:46So let me see how exactly this change had been carried out.
- 12:49I can go into the changes here.
- 12:51I can see all of the files that have been modified.
- 12:54So this is the one that really interests me.
- 12:58Let me resize this.
- 13:00I can see um I can see yes there is an error state and when there is an error state Claude is basically or like the code is going to
- 13:12add this border to this sonar component.
- 13:18Oh it's also going to increase the the padding on the right which is a nice touch just judging from reading these Tailwind classes.
- 13:27Again another another reason for us to get a little bit more comfortable with reading Tailwind is because there later on like reading these visual changes is like becomes much
- 13:38much easier and these classes are really not that hard to to grasp after a while.
- 13:46Okay I think this looks good for the time being.
- 13:49One more thing that I wanted to call out here is how Claude is already suggesting the name for the next commit and it's like sharing with me the name
- 13:58of that commit. Perhaps it's doing this because in one of the previous videos in that local CLAUDE.md file for this project we have like specifically asked Claude to
- 14:10latch onto whatever patterns like commit patterns this team is So it's it's great to see that.
- 14:18Again, if I wanted to confirm whether this commit message is going to match the style of the theme, I could open up the Git graph mode and see what
- 14:28were the older like Git messages.
- 14:31Awesome. So it seems to be matching this convention, so I'm just going to ask it to commit.
- 14:39And I'm not going to ask it to push anything or raise any PRs.
- 14:43We are going to discuss this in the next video.
- 14:48So with that, I'm just going to let Claude commit this work and I'll see you in the next one.