Optimise code base with ponytail - #225
Merged
Merged
Conversation
document-view.tsx 1226 → 939 LOC. Extracted: - cells.tsx: DateCell, ObjectIdCell, CellValue, SkeletonRow, getRelativeTime, ISO_DATE_RE, OBJECTID_RE - schema-view.tsx: SchemaView component + SchemaData type Dropped unused Popover import from main file (only used in extracted CellValue now). No behavior change. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
snippet-manager-tool.tsx 1214 → 985 LOC. Extracted: - snippet-list-item.tsx: LangDot, SnippetListItem (memo'd) + LANG_COLORS map - snippet-list-content.tsx: SnippetListContent (mobile sheet + desktop panel) - delete-dialog.tsx: DeleteDialog Dropped unused imports (memo, RefObject, IconPin, IconPinFilled, IconCode, IconLoader2). No behavior change. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
explorer-sidebar.tsx 944 → 835 LOC. Extracted SidebarDialogs component holding all 6 dialogs (rename collection/database + delete connection / drop db / drop collection / bulk delete). Main file now passes state + handlers through to single child. No behavior change. Typecheck clean (pre-existing passkey error unrelated). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
tetris-layout.tsx 1007 → 864 LOC. Extracted engine.ts with: - Constants (COLS, ROWS, CELL, BEST_KEY, SPRINT_LINES, ULTRA_MS) - Types (Board, PieceDef, Piece, GameMode, TSpin) - PIECES table - Pure engine fns: randomPiece, emptyBoard, rotate, collides, place, findFullRows, clearLines, ghostY, detectTSpin, calcScore, formatTime - Bag-randomizer state with resetBag() escape hatch Pure logic separated from React layer. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
master-password-gate.tsx 829 → 719 LOC. Extracted to subdir master-password-gate/: - password-strength.ts: calcStrength + StrengthResult type - backup-codes-file.ts: downloadBackupCodesFile helper - gate-helpers.tsx: Spinner, ErrorBanner Main file keeps gate orchestration + dialog views. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
onboarding-modal.tsx 691 → 237 LOC. Extracted to onboarding-modal/: - welcome-step.tsx: WelcomeStep (already existed, now reused) - tour-step.tsx: TourStep + TOUR_SLIDES constant - tool-selection.tsx: ToolSelectionStep + TagsToolSelection + CheckboxesToolSelection + CheckboxCategoryRow + buildCategories + CATEGORY_ICONS/COLORS/ICON_COLORS maps + Category/ToolEntry/ SelectionProps types Main file now holds gate state, step nav, StepDot indicator, and final modal shell. Dropped unused Badge, ScrollArea, sidebarData, NavLink, NavCollapsible imports + 8 category-icon imports. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dashboard-analytics-panel.tsx 678 → 356 LOC. Extracted: - analytics-helpers.ts: sumTrackedItems, timeAgo, findToolById - analytics-cells.tsx: AnalyticsSkeleton, SectionHeader, MetricChip, KpiCard, EmptyGroupHint, GroupColor type - task-card.tsx: TaskCard - hooks/use-count-up.ts: useCountUp (lifted out of dashboard for reuse) value-editor.tsx 680 → 592 LOC. Extracted: - decoded-view.tsx: DecodedView - rename-or-copy-dialog.tsx: RenameOrCopyDialog + props type Dropped unused useRef, sidebarData imports from dashboard panel. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
sudoku-layout.tsx 700 → 547 LOC. Extracted engine.ts with: - Types (Difficulty, Grid, Notes, GameScore, HistoryEntry) - makeLCG, shuffle, emptyGrid, emptyNotes, isValidPlacement, fillGrid, generatePuzzle, buildConflicts, isSolved, calcScore, removeNoteFromPeers - DIFFICULTIES constant minesweeper-layout.tsx 581 → 478 LOC. Extracted engine.ts with: - Types (CellState, Cell, Difficulty, Status) - PRESET, BEST_KEY/STREAK_KEY/BSTREAK_KEY, NUM_COLOR - makeLCG, buildBoard, floodReveal, checkWin, formatTime, newSeed Pure game logic separated from React. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
NotesSidebar.tsx 703 → 578 LOC. Extracted: - notes-helpers.ts: SortKey/SortDir types, ChildrenMap type, buildChildrenMap, plain-text cache (getCachedPlainText) - emoji-picker.tsx: EmojiPicker + EMOJI_OPTIONS - move-dialog.tsx: MoveDialog + MoveDialogProps Dropped unused Dialog imports from main file. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
NotionEditor.tsx 525 → 484 LOC. Extracted template-picker-dialog.tsx. key-browser.tsx 576 → 531 LOC. Extracted highlighted-key-text.tsx with fuzzy/glob/regex match highlighting. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
snake-layout.tsx 443 → 259 LOC. Extracted engine.ts with: - Types (Point, Dir, Difficulty, PowerUpType, PowerUp) - Constants (COLS, ROWS, CELL, BEST_KEY, FOOD_COUNT, DIFFICULTY_CONFIG, POWERUP_EMOJI, OPPOSITE, INIT_SNAKE) - Pure fns (randomFood, initFoods, randomPowerUpPos) game-2048-layout.tsx 390 → 253 LOC. Extracted engine.ts with: - Types (Board, Dir, BoardSize, HistoryEntry, CellAnim) - BEST_KEY, TILE_STYLE - Pure fns (emptyBoard, addRandomTile, initBoard, applyDir, hasWon, hasMovesLeft, tileStyle, tileFont) All 5 break-room games (tetris/sudoku/minesweeper/snake/2048) now have pure engine modules separated from React. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
global-command-palette.tsx 443 → 311 LOC. Extracted palette-entries.ts with PaletteEntry type, CATEGORY_ORDER, RECENT_STORAGE_KEY, STATIC_ENTRIES (5 site entries), buildSidebarIconMap, buildSearchValue, and cached getToolEntries. environment-set-list.tsx 479 → 469 LOC. Dropped inline useDebounce hook; use-debounce package already shipping in deps. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bulk-actions.tsx 431 → 70 LOC (-84%). Extracted: - bulk-types.ts: DryRunResult, ExportedKey interfaces - bulk-delete-dialog.tsx: BulkDeleteDialog (dry-run + delete pattern flow) - bulk-export-dialog.tsx: BulkExportDialog (download JSON) - bulk-import-dialog.tsx: BulkImportDialog (upload JSON + parse + overwrite) Main file now only holds 3 buttons + dialog state. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
server-dashboard.tsx 413 → 37 LOC (-91%). Extracted server-dashboard-panes.tsx with: - InfoPane: live INFO sections, key fields grid, auto-refresh - SlowLogPane: SLOWLOG GET/RESET, configurable size - ClientsPane: CLIENT LIST + KILL action Main file now only routes tabs → panes. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
color-picker-tool-layout.tsx 431 → 385 LOC. Extracted color-helpers.ts with normalizeHex, parseHex, safeHue, channelsFromHex, DEFAULT_HEX. Lifted useCopyFeedback hook out of color-picker-tool and contrast-checker into shared hooks/use-copy-feedback.ts. Both tools previously had identical id-keyed copy-flash hook reinvented per component. contrast-checker-tool-layout.tsx 360 → 348 LOC. Now imports the shared hook. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
personal-info-card.tsx 449 → 317 LOC. Extracted: - personal-info-types.ts: LANGUAGE_LEVELS, LanguageEntry, PersonalInfo - tag-input.tsx: TagInput (add-by-Enter, removable badges) - language-picker.tsx: LanguagePicker (name + level select) Re-exports types/constants for backward compatibility. Dropped unused Plus + Select imports from main file. Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
encryption-playground-layout.tsx 439 → 394 LOC. Extracted error-mapping.ts with mapEncryptError + mapDecryptError (45 LOC of switch statements). uuid-generator-layout.tsx 493 → 455 LOC. Extracted: - id-row.tsx: IdRow component (copy-to-clipboard row) - error-mapping.ts: errorKeyFromGenerateIdsErrorKey Typecheck clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.