-
Notifications
You must be signed in to change notification settings - Fork 1
feat: complete P0/P1 spec compliance roadmap items #539
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
Changes from all commits
38f7996
fd30bbe
9bebb90
506c5c9
2b1f656
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,12 +31,18 @@ export interface DetailSectionProps { | |||||||||||||||||||||||||||||||||||||||||||||||||
| section: DetailViewSectionType; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| data?: any; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| className?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /** Whether inline editing is active */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isEditing?: boolean; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /** Callback when a field value changes during inline editing */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onFieldChange?: (field: string, value: any) => void; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| export const DetailSection: React.FC<DetailSectionProps> = ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| section, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| data, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| className, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isEditing = false, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onFieldChange, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| const [isCollapsed, setIsCollapsed] = React.useState(section.defaultCollapsed ?? false); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| const [copiedField, setCopiedField] = React.useState<string | null>(null); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -75,6 +81,16 @@ export const DetailSection: React.FC<DetailSectionProps> = ({ | |||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="text-xs font-medium text-muted-foreground uppercase tracking-wide"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {field.label || field.name} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {isEditing && !field.readonly ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="min-h-[44px] sm:min-h-0"> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <input | ||||||||||||||||||||||||||||||||||||||||||||||||||
| type={field.type === 'number' ? 'number' : field.type === 'date' ? 'date' : 'text'} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| className="w-full px-2 py-1.5 text-sm border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| value={value != null ? String(value) : ''} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onChange={(e) => onFieldChange?.(field.name, e.target.value)} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| onChange={(e) => onFieldChange?.(field.name, e.target.value)} | |
| aria-label={field.label || field.name} | |
| onChange={(e) => { | |
| if (!onFieldChange) return; | |
| const raw = e.target.value; | |
| let next: any = raw; | |
| if (field.type === 'number' || typeof value === 'number') { | |
| if (raw === '') { | |
| next = null; | |
| } else { | |
| const parsed = Number(raw); | |
| next = Number.isNaN(parsed) ? null : parsed; | |
| } | |
| } else if (field.type === 'date' || value instanceof Date) { | |
| if (raw === '') { | |
| next = null; | |
| } else { | |
| next = new Date(raw); | |
| } | |
| } | |
| onFieldChange(field.name, next); | |
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This roadmap line claims NavigationOverlay “applies
widthandviewproperties”, but current implementation only useswidthfor overlay sizing.navigation.viewis exposed/used for page/new_window navigation, but it doesn’t affect drawer/modal/split/popover content rendering. Consider adjusting the roadmap wording to avoid overstating overlay-levelviewsupport.