Skip to content

Clarify file section layout helper names#148

Merged
benvinegar merged 1 commit intomainfrom
pi/clarify-file-section-layout
Mar 31, 2026
Merged

Clarify file section layout helper names#148
benvinegar merged 1 commit intomainfrom
pi/clarify-file-section-layout

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Summary

  • rename the section layout helper module to make its file-specific scope explicit
  • rename the exported layout helpers and local DiffPane variables to match that scope
  • keep the sticky-header and viewport-anchor behavior unchanged while making the geometry code easier to follow

Testing

  • bun run typecheck
  • bun test test/app-interactions.test.tsx test/ui-components.test.tsx test/ui-lib.test.ts test/section-heights.test.ts

This PR description was generated by Pi using OpenAI o3

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR is a pure renaming refactor: src/ui/lib/sectionLayout.ts is renamed to fileSectionLayout.ts, all three exported functions and the exported interface gain a File/FileSection prefix to make their file-specific scope explicit, and every call site and local variable in DiffPane.tsx is updated consistently. No logic, algorithm, or behavioral changes are made.

  • SectionLayoutMetricFileSectionLayoutMetric
  • buildSectionLayoutMetricsbuildFileSectionLayoutMetrics
  • findHeaderOwningSectionfindHeaderOwningFileSection
  • resolveFileHeaderTopresolveFileSectionHeaderTop
  • All four corresponding local variables in DiffPane.tsx renamed to match
  • No other files in the codebase imported the old module, so the rename is complete and self-contained

Confidence Score: 5/5

Safe to merge — purely a naming refactor with no functional changes.

All renamed symbols are updated consistently in every consumer. No other file imported the old module, no barrel re-exports exist, and no test files reference the old names. The function implementations and all call-site logic are byte-for-byte identical to the pre-rename code.

No files require special attention.

Important Files Changed

Filename Overview
src/ui/lib/fileSectionLayout.ts Renamed from sectionLayout.ts; exports renamed to FileSectionLayoutMetric, buildFileSectionLayoutMetrics, findHeaderOwningFileSection, and resolveFileSectionHeaderTop — no logic changes.
src/ui/components/panes/DiffPane.tsx Import path and all symbol usages updated to match the renamed module; local variables renamed from sectionLayoutMetrics/baseSectionLayoutMetrics/selectedSectionLayout to their file-scoped equivalents — no behavioral changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[DiffPane.tsx] -->|imports| B[fileSectionLayout.ts\n renamed from sectionLayout.ts]
    B --> C[buildFileSectionLayoutMetrics\n was buildSectionLayoutMetrics]
    B --> D[findHeaderOwningFileSection\n was findHeaderOwningSection]
    B --> E[resolveFileSectionHeaderTop\n was resolveFileHeaderTop]
    B --> F[FileSectionLayoutMetric\n was SectionLayoutMetric]
    A --> G[baseFileSectionLayoutMetrics\n was baseSectionLayoutMetrics]
    A --> H[fileSectionLayoutMetrics\n was sectionLayoutMetrics]
    A --> I[selectedFileSectionLayout\n was selectedSectionLayout]
Loading

Reviews (1): Last reviewed commit: "Clarify file section layout helper names" | Re-trigger Greptile

@benvinegar benvinegar merged commit f72d1b9 into main Mar 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant