Skip to content

Fixed issues and updated styles#12

Merged
velitchko merged 1 commit intomainfrom
feat/edit-functions
Jan 12, 2026
Merged

Fixed issues and updated styles#12
velitchko merged 1 commit intomainfrom
feat/edit-functions

Conversation

@velitchko
Copy link
Copy Markdown
Contributor

This pull request implements the edit functionality (check if existing registration exists, load, and update) for the registration form.

Closes the following issues:

Copilot AI review requested due to automatic review settings January 12, 2026 13:31
@velitchko velitchko merged commit a92c579 into main Jan 12, 2026
4 checks passed
This was referenced Jan 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds edit functionality and a warn state for duplicate registrations to the registration form. The changes allow users to check if a registration exists, load it for editing, and update it. Additionally, an "isPresenting" checkbox field is introduced to allow attendees to register without presenting a talk.

Changes:

  • Added isPresenting checkbox field to differentiate between presenters and attendees
  • Implemented duplicate detection with warning state and edit prompt
  • Added registration edit functionality (load existing registration by name and update)
  • Applied comprehensive dark mode styling across all form elements and states
Comments suppressed due to low confidence (1)

app/register/page.tsx:59

  • The "isDuplicate" state is not reset when successfully loading an existing registration. After a duplicate error triggers the warning state and then a user successfully loads their registration, the warning styling remains active unnecessarily. Add "setIsDuplicate(false)" after successfully loading the registration data at line 56 to clear the warning state.
      if (result.success && result.data) {
        // Load the data into the form
        setFormData({
          name: result.data.name || '',
          isPresenting: result.data.isPresenting === 'Yes',
          talkTitle: result.data.talkTitle || '',
          description: result.data.description || '',
          expectations: result.data.expectations || '',
        });
        setIsEditing(true);
        setShowLoadForm(false);
        setLoadName('');
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/register/page.tsx
<div className="mb-6">
<label htmlFor="name" className="block text-sm font-semibold text-black mb-2">
<label htmlFor="name" className="block text-sm font-semibold text-black dark:text-white darkest:text-white mb-2">
Name (Presenter) <span className="text-red-500">*</span>
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The label "Name (Presenter)" assumes all registrants are presenters, but the form now includes an "I'm presenting a talk" checkbox indicating that not all attendees need to be presenters. This creates inconsistency in the user interface. Consider changing the label to just "Name" or "Full Name" to accurately reflect that attendees can register without presenting.

Suggested change
Name (Presenter) <span className="text-red-500">*</span>
Full Name <span className="text-red-500">*</span>

Copilot uses AI. Check for mistakes.
Comment thread app/register/page.tsx
className="w-5 h-5 cursor-pointer"
/>
<span className="text-sm font-semibold text-black dark:text-white darkest:text-white">
I'm presenting a talk <span className="text-red-500">*</span>
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The required asterisk on the "I'm presenting a talk" checkbox is misleading. The form allows submission without presenting (when unchecked), so this shouldn't be marked as required. Only the name field and conditionally the talk fields (when presenting) should be marked as required.

Suggested change
I'm presenting a talk <span className="text-red-500">*</span>
I'm presenting a talk

Copilot uses AI. Check for mistakes.
Comment thread app/register/page.tsx
type="text"
id="talkTitle"
name="talkTitle"
required
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

When the "talkTitle" and "description" fields have the "required" attribute and are conditionally rendered based on "isPresenting", this creates a form validation issue. If a user loads an existing registration where they were presenting, then unchecks the checkbox (clearing the fields), and tries to submit, the hidden required fields may still trigger validation errors in some browsers. Consider adding explicit validation logic in the handleSubmit function to ensure consistency across browsers.

Copilot uses AI. Check for mistakes.
Comment thread app/register/page.tsx
<textarea
id="description"
name="description"
required
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The same validation issue applies to the "description" textarea field. When conditionally rendered with a "required" attribute, it may cause form validation issues in some browsers if the field is hidden. This needs to be handled consistently with the "talkTitle" field.

Copilot uses AI. Check for mistakes.
Comment thread app/register/page.tsx
description: isChecked ? formData.description : ''
});
}}
className="w-5 h-5 cursor-pointer"
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The checkbox input lacks styling for keyboard focus states needed for accessibility. While dark mode colors are applied throughout the form, the checkbox should also include focus ring styles to provide visual feedback for keyboard users navigating the form. Consider adding focus styling classes like "focus:ring-2 focus:ring-black dark:focus:ring-white" to match other form inputs.

Suggested change
className="w-5 h-5 cursor-pointer"
className="w-5 h-5 cursor-pointer focus:ring-2 focus:ring-black dark:focus:ring-white darkest:focus:ring-white focus:border-black dark:focus:border-white darkest:focus:border-white outline-none transition"

Copilot uses AI. Check for mistakes.
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