-
Notifications
You must be signed in to change notification settings - Fork 0
#706 Show Position Deadlines On Draft Applications #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cielbellerose
merged 10 commits into
dev
from
706-show-position-deadlines-on-draft-applications
Sep 21, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3e3b513
#706 show position deadlines on draft applications
cielbellerose 3f0f2b9
#706 address review feedback
cielbellerose 970dd03
#706 address review feedback
cielbellerose ba80b02
#706 address review feedback
cielbellerose 0e32017
#706 drop deadline label, unify countdown to compact form
cielbellerose fb868cf
#706 address operator direction and scope addendum
cielbellerose 09bfcb8
#706 compress leftover long comments per engineering §7
cielbellerose 49a8d4f
#706 address review feedback
cielbellerose 6a8caf7
#706 treat withdrawn like draft for deadline urgency
cielbellerose e7bea94
#706 flatten deadline urgency to red-or-muted, drop amber
cielbellerose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| import { DEADLINE_TIER_ICONS, STATE_ICONS } from '@/lib/icons'; | ||
| import type { PositionWindow } from '@/lib/types'; | ||
| import { cn, getDeadlineInfo } from '@/lib/utils'; | ||
|
|
||
| import { LocalTime } from '@/components/ui/local-time'; | ||
|
|
||
| interface DeadlineIndicatorProps { | ||
| position: PositionWindow; | ||
| now: Date; | ||
| // Red line fires for distant/soon/urgent only when true; upcoming/past always muted. | ||
| emphasizeUrgency: boolean; | ||
| variant?: 'full' | 'compact'; | ||
| } | ||
|
|
||
| // No 'use client' — LocalTime is the only client leaf this renders. | ||
| export function DeadlineIndicator({ | ||
| position, | ||
| now, | ||
| emphasizeUrgency, | ||
| variant = 'full', | ||
| }: DeadlineIndicatorProps) { | ||
| const info = getDeadlineInfo(position, now); | ||
| if (!info) return <span className="text-muted-foreground">—</span>; | ||
|
|
||
| const isPast = info.tier === 'past'; | ||
| const Icon = DEADLINE_TIER_ICONS[info.tier]; | ||
|
|
||
| // Deadline column header already says what the date is — the label would | ||
| // be redundant, except "Opens" which reads as the deadline without it. | ||
| const mutedLine = ( | ||
| <span | ||
| className={cn( | ||
| 'text-muted-foreground flex items-center gap-1.5', | ||
| variant === 'full' ? 'text-sm' : 'text-xs', | ||
| isPast && 'opacity-70', | ||
| )} | ||
| > | ||
| {variant === 'full' && <Icon className="size-4 shrink-0" />} | ||
| {info.tier === 'upcoming' && `${info.label} `} | ||
| <LocalTime date={info.date} precision="date" /> | ||
| </span> | ||
| ); | ||
|
|
||
| // Text, not Badge — a filled pill reads heavier than a metadata line; text-destructive-text passes AA at this weight. | ||
| const emphasizedLine = (children: ReactNode) => ( | ||
| <span | ||
| className={cn( | ||
| 'text-destructive-text flex items-center gap-1.5 font-semibold', | ||
| variant === 'full' ? 'text-sm' : 'text-xs', | ||
| )} | ||
| > | ||
| <STATE_ICONS.warning className="size-4 shrink-0" /> | ||
| {children} | ||
| </span> | ||
| ); | ||
|
|
||
| switch (info.tier) { | ||
| case 'upcoming': | ||
| return mutedLine; | ||
|
|
||
| case 'distant': | ||
| case 'soon': | ||
| if (!emphasizeUrgency) return mutedLine; | ||
| return emphasizedLine(<LocalTime date={info.date} precision="date" />); | ||
|
|
||
| case 'urgent': | ||
| if (!emphasizeUrgency) return mutedLine; | ||
| return emphasizedLine( | ||
| <LocalTime date={info.date} precision="date"> | ||
| {`${info.compactCountdown} left`} | ||
| </LocalTime>, | ||
| ); | ||
|
|
||
| case 'past': | ||
| return mutedLine; | ||
|
|
||
| default: { | ||
| const exhaustive: never = info.tier; | ||
| return exhaustive; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.