Runtime button overflow detection for record detail header#593
Draft
Runtime button overflow detection for record detail header#593
Conversation
…etail header - CSS: Add overflow protection to prevent header from exceeding 65px height - CSS: Add styles for "more" dropdown button and menu - TS: Add addButtonContainerClasses() to inject CSS class names into button flex container schema - TS: Inject amis `custom` component with ResizeObserver + MutationObserver - TS: Runtime overflow detection hides overflowing buttons right-to-left - TS: Creates "more" dropdown with proxy menu items that click original hidden buttons - TS: Responsive recovery - shows buttons when space becomes available - TS: Proper cleanup via onUnmount to prevent memory leaks Co-authored-by: yinlianghui <6219465+yinlianghui@users.noreply.github.com> Agent-Logs-Url: https://github.com/steedos/steedos-widgets/sessions/14188118-9466-483c-a5ce-7936f84073a4
Co-authored-by: yinlianghui <6219465+yinlianghui@users.noreply.github.com> Agent-Logs-Url: https://github.com/steedos/steedos-widgets/sessions/14188118-9466-483c-a5ce-7936f84073a4
Copilot
AI
changed the title
[WIP] Fix button overflow issue on approval detail page
Runtime button overflow detection for record detail header
Mar 25, 2026
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.
Header buttons overflow horizontally at small resolutions (1280×800), breaking the hardcoded
calc(100% - 65px)body height inflow.js. Previous schema-timemaxButtonsapproach failed fundamentally—DOM doesn't exist yet,visibleOnisn't evaluated, i18n label widths are unknown.This moves all overflow handling to runtime using actual DOM measurements.
CSS (
AmisRecordDetailHeader.less)overflow: hidden; min-width: 0on button column — hard guarantee header never exceeds 65pxflex-wrap: nowrap !importanton button flex containerRuntime overflow handler (
AmisRecordDetailHeader.tsx)addButtonContainerClasses()traverses the schema JSON post-generation to inject.steedos-header-buttons/.steedos-header-buttons-colclass names for CSS targetingcustomcomponent withonMount/onUnmountscripts:visibleOntoggling buttons post-renderscrollWidth > clientWidth: hides buttons right-to-left, populates a "more" dropdownNot modified
buttons.js,header.js— schema generation unchangedKey difference from reverted approach
Previous: estimate button widths from schema labels → greedy pack →
maxButtons. Fails on i18n,visibleOn, DOM-less context.This: render everything → measure real DOM → collapse what doesn't fit. Zero estimation error, works with any language/permission/resolution.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /usr/local/bin/yarn install --frozen-lockfile dos-��(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /usr/local/bin/yarn install 53 -j ACCEPT(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.