Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

fix: remove unnecessary capitalization from select items and form controls

Khuram Niaz72d1e9c21d0b
diff --git a/__tests__/ComboBox.spec.tsx b/__tests__/ComboBox.spec.tsx
index adbbd7b..3a3d347 100644
--- a/__tests__/ComboBox.spec.tsx
+++ b/__tests__/ComboBox.spec.tsx
@@ -229,6 +229,43 @@ describe("Combobox Enter key", () => {
});
});
+ // Tailwind's `capitalize` renders a stored "eBay" as "EBay". jsdom applies
+ // no stylesheet, so assert on the class chain around the label instead.
+ describe("label casing", () => {
+ const trademark = [{ id: "ebay-id", value: "ebay", label: "eBay" }];
+
+ function expectNoCapitalize(el: HTMLElement | null) {
+ for (let node = el; node; node = node.parentElement) {
+ expect(node.className).not.toMatch(/(^|\s|:)capitalize(\s|$)/);
+ }
+ }
+
+ it("does not capitalize an option label in the list", async () => {
+ await openCombobox({ options: trademark });
+
+ expectNoCapitalize(screen.getByText("eBay"));
+ });
+
+ it("does not capitalize the create prompt", async () => {
+ const { user, input } = await openCombobox({ options: [] });
+
+ await user.type(input, "eBay");
+
+ expectNoCapitalize(screen.getByText("eBay"));
+ });
+
+ it("does not capitalize the selected label on the trigger", async () => {
+ const { user } = await openCombobox({ options: trademark });
+
+ await user.click(screen.getByText("eBay"));
+
+ await waitFor(() =>
+ expect(screen.queryByPlaceholderText(/Search company/i)).toBeNull()
+ );
+ expectNoCapitalize(screen.getByText("eBay"));
+ });
+ });
+
describe("preserving cmdk defaults", () => {
it("still selects an arrow-key highlighted option on Enter", async () => {
const { user, input, onChange } = await openCombobox();
diff --git a/src/components/ComboBox.tsx b/src/components/ComboBox.tsx
index 5fb4bce..c3de3b9 100644
--- a/src/components/ComboBox.tsx
+++ b/src/components/ComboBox.tsx
@@ -115,7 +115,7 @@ export function Combobox({ options, field, creatable }: ComboboxProps) {
variant="outline"
role="combobox"
className={cn(
- "md:w-[240px] lg:w-[280px] justify-between capitalize",
+ "md:w-[240px] lg:w-[280px] justify-between",
!field.value && "text-muted-foreground"
)}
>
@@ -145,7 +145,7 @@ export function Combobox({ options, field, creatable }: ComboboxProps) {
placeholder={`${creatable ? "Create or " : ""}Search ${field.name}`}
onKeyDown={(e) => handleEnterKey(e)}
/>
- <CommandList className="capitalize">
+ <CommandList>
<CommandEmpty
onClick={() => {
onCreateOption(newOption);
diff --git a/src/components/Select.tsx b/src/components/Select.tsx
index 695a547..a53ba12 100644
--- a/src/components/Select.tsx
+++ b/src/components/Select.tsx
@@ -34,11 +34,7 @@ function SelectFormCtrl({ label, options, field }: SelectProps) {
{options &&
options.map((option) => {
return (
- <SelectItem
- key={option.id}
- value={option.id}
- className="capitalize"
- >
+ <SelectItem key={option.id} value={option.id}>
{option.label ?? option.value ?? option.title}
</SelectItem>
);
diff --git a/src/components/myjobs/AddJob.tsx b/src/components/myjobs/AddJob.tsx
index 605f5d2..ca6ab83 100644
--- a/src/components/myjobs/AddJob.tsx
+++ b/src/components/myjobs/AddJob.tsx
@@ -460,7 +460,7 @@ export function AddJob({
control={form.control}
name="status"
render={({ field }) => (
- <FormItem className="flex flex-col [&>button]:capitalize">
+ <FormItem className="flex flex-col">
<FormLabel>Status</FormLabel>
<SelectFormCtrl
label="Job Status"
@@ -538,7 +538,7 @@ export function AddJob({
control={form.control}
name="resume"
render={({ field }) => (
- <FormItem className="flex flex-col [&>button]:capitalize">
+ <FormItem className="flex flex-col">
<FormLabel>Resume</FormLabel>
<SelectFormCtrl
label="Resume"
@@ -566,7 +566,7 @@ export function AddJob({
control={form.control}
name="coverLetter"
render={({ field }) => (
- <FormItem className="flex flex-col [&>button]:capitalize">
+ <FormItem className="flex flex-col">
<FormLabel>Cover Letter</FormLabel>
<SelectFormCtrl
label="Cover Letter"
diff --git a/src/components/myjobs/GenerateCoverLetterSection.tsx b/src/components/myjobs/GenerateCoverLetterSection.tsx
index 4d4e239..f32224a 100644
--- a/src/components/myjobs/GenerateCoverLetterSection.tsx
+++ b/src/components/myjobs/GenerateCoverLetterSection.tsx
@@ -294,11 +294,7 @@ export const GenerateCoverLetterSection = ({
<SelectContent>
<SelectGroup>
{(resumes ?? []).map((resume) => (
- <SelectItem
- key={resume.id}
- value={resume.id!}
- className="capitalize"
- >
+ <SelectItem key={resume.id} value={resume.id!}>
{resume.title}
</SelectItem>
))}
diff --git a/src/components/profile/AiJobMatchSection.tsx b/src/components/profile/AiJobMatchSection.tsx
index cafc8da..5cec5ed 100644
--- a/src/components/profile/AiJobMatchSection.tsx
+++ b/src/components/profile/AiJobMatchSection.tsx
@@ -311,11 +311,7 @@ export const AiJobMatchSection = ({
<SelectContent>
<SelectGroup>
{resumesRef.current.map((resume) => (
- <SelectItem
- key={resume.id}
- value={resume.id!}
- className="capitalize"
- >
+ <SelectItem key={resume.id} value={resume.id!}>
{resume.title}
</SelectItem>
))}
diff --git a/src/components/settings/AiSettings.tsx b/src/components/settings/AiSettings.tsx
index 576cf23..d5366df 100644
--- a/src/components/settings/AiSettings.tsx
+++ b/src/components/settings/AiSettings.tsx
@@ -256,7 +256,7 @@ function AiSettings() {
{AI_PROVIDERS.map((id) => {
const entry = PROVIDER_REGISTRY[id];
return (
- <SelectItem key={id} value={id} className="capitalize">
+ <SelectItem key={id} value={id}>
{entry.displayName}
</SelectItem>
);
@@ -289,7 +289,7 @@ function AiSettings() {
<SelectContent>
<SelectGroup>
{fetchedModels.map((model) => (
- <SelectItem key={model} value={model} className="capitalize">
+ <SelectItem key={model} value={model}>
{model}
</SelectItem>
))}
diff --git a/src/components/tasks/TaskForm.tsx b/src/components/tasks/TaskForm.tsx
index 31a204c..5808152 100644
--- a/src/components/tasks/TaskForm.tsx
+++ b/src/components/tasks/TaskForm.tsx
@@ -204,7 +204,7 @@ export function TaskForm({
control={form.control}
name="status"
render={({ field }) => (
- <FormItem className="flex flex-col [&>button]:capitalize">
+ <FormItem className="flex flex-col">
<FormLabel>Status</FormLabel>
<SelectFormCtrl
label="Task Status"