This is a GitHub-style inline diff comments component. Hover over a line in the diff to reveal the "Add comment" button, then click to open a compact inline thread for discussion—just like reviewing code on GitHub.

src/server.tsmodified
  1. @@ -10,8 +10,10 @@
  2. 1010
    export async function getUserName(id: string) {
  3. 1111
      // Fetch user from cache or database
  4. 12
      const user = cache.get(id)
  5. 12
      let user = cache.get(id)
  6. 1313
      if (!user) {
  7. 14
        user = await db.users.findById(id)
  8. 15
        if (user) cache.set(id, user)
  9. 1416
      }
  10. 15
      return user?.name
  11. 17
      return user?.name ?? '(unknown)'
  12. 1618
    }