Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/problem-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function ProblemCard({
const Icon = iconMap[problem.categoryIcon] || Hash
const diffStyle = difficultyConfig[problem.difficulty]
const localized = getLocalizedProblemText(problem, language)
const isNew = (problem.tags ?? []).includes("NEW")

return (
<motion.div
Expand Down Expand Up @@ -103,6 +104,14 @@ export function ProblemCard({
<h3 className="truncate text-sm font-semibold text-foreground lg:text-base">
{localized.text.title}
</h3>
{isNew && (
<Badge
variant="secondary"
className="border-0 text-[10px] font-semibold bg-[#fff4e5] text-[#b85a00]"
>
NEW
</Badge>
)}
{localized.isFallback && (
<Badge
variant="secondary"
Expand Down
9 changes: 9 additions & 0 deletions components/problem-description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function ProblemDescription({ problem }: ProblemDescriptionProps) {
const { language, copy } = useAppLanguage()
const diffStyle = difficultyConfig[problem.difficulty]
const localized = getLocalizedProblemText(problem, language)
const isNew = (problem.tags ?? []).includes("NEW")

return (
<ScrollArea className="h-full">
Expand All @@ -85,6 +86,14 @@ export function ProblemDescription({ problem }: ProblemDescriptionProps) {
<h1 className="text-xl font-bold text-foreground lg:text-2xl">
{localized.text.title}
</h1>
{isNew && (
<Badge
variant="secondary"
className="border-0 text-xs font-semibold bg-[#fff4e5] text-[#b85a00]"
>
NEW
</Badge>
)}
{localized.isFallback && (
<Badge
variant="secondary"
Expand Down
7 changes: 2 additions & 5 deletions docs/problem-authoring-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Required fields:
- `category`
- `categoryIcon`
- `difficulty`
- `successRate`
- `description`
- `examples`
- `constraints`
Expand Down Expand Up @@ -67,7 +66,7 @@ Done when:

### Module 3: Difficulty Calibration
Use when:
- Difficulty (`Easy`/`Medium`/`Hard`) or `successRate` is uncertain.
- Difficulty (`Easy`/`Medium`/`Hard`) is uncertain.

Inputs:
- Constraints
Expand All @@ -76,11 +75,9 @@ Inputs:

Outputs:
- Final `difficulty`
- Initial `successRate` estimate

Done when:
- Difficulty and constraints are aligned.
- `successRate` is plausible for the selected difficulty.

### Module 4: Example Crafting
Use when:
Expand Down Expand Up @@ -133,5 +130,5 @@ Stop after the smallest sufficient set of modules is complete.
- [ ] `functionName` matches `starterCode`
- [ ] `examples` and `testCases` are consistent
- [ ] Boundary behavior is explicit
- [ ] Difficulty and `successRate` are coherent
- [ ] Difficulty is coherent
- [ ] EN/KO are semantically aligned (if KO exists)
Loading