refactor(layout): centralise content-area height in contentHeight() - #2680
Open
camielvs wants to merge 1 commit into
Open
refactor(layout): centralise content-area height in contentHeight()#2680camielvs wants to merge 1 commit into
camielvs wants to merge 1 commit into
Conversation
Six full-height layouts each rebuilt the same calc() expression from TOP_NAV_HEIGHT by hand, two of them with a second subtraction for the footer. Give them one helper so the arithmetic lives in a single place. Behaviour is unchanged: every call site resolves to the same height it did before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🎩 PreviewA preview build has been created at: |
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

Why
Six layouts each hardcode the same expression to fill the space under the top nav:
Three of them subtract a second fixed amount on top of it (
BOTTOM_FOOTER_HEIGHT, or a bare48). Adding anything above the content area means finding and editing all six.What
One helper,
contentHeight(subtractPx?), insrc/utils/layout.ts. Every call site now reads what it means rather than restating the arithmetic:Call sites updated:
ComponentDetail,ContextPanel,FlowSidebar,DashboardComponentsView,DashboardComponentsV2View,DashboardLayout.Behaviour is unchanged at every call site — the emitted string is identical to what each one produced before, including the
- 0pxterm that CSScalc()folds away. This is a pure de-duplication; it is not a prerequisite for anything and can be merged or dropped independently.