MCPcopy Create free account
hub / github.com/error311/FileRise / resolveTargetZoneForExpand

Function resolveTargetZoneForExpand

public/js/dragAndDrop.js:647–675  ·  view source on GitHub ↗
(cardId)

Source from the content-addressed store, hash-verified

645}
646
647function resolveTargetZoneForExpand(cardId) {
648 const layout = readLayout();
649 const saved = layout[cardId];
650 const isUpload = (cardId === 'uploadCard');
651
652 // 🔒 If the user explicitly pinned this card to the HEADER,
653 // it should remain a header-only icon and NEVER fly out.
654 if (saved === ZONES.HEADER) {
655 return null; // caller will skip animation + placement
656 }
657
658 let zone = saved || null;
659
660 // No saved zone yet: mirror applyUserLayoutOrDefault defaults
661 if (!zone) {
662 if (isSmallScreen()) {
663 zone = isUpload ? ZONES.TOP_LEFT : ZONES.TOP_RIGHT;
664 } else {
665 zone = ZONES.SIDEBAR;
666 }
667 }
668
669 // On small screens, anything targeting SIDEBAR gets lifted into the top cols
670 if (isSmallScreen() && zone === ZONES.SIDEBAR) {
671 zone = isUpload ? ZONES.TOP_LEFT : ZONES.TOP_RIGHT;
672 }
673
674 return zone;
675}
676
677function getZoneHost(zoneId) {
678 switch (zoneId) {

Callers 1

Calls 2

readLayoutFunction · 0.85
isSmallScreenFunction · 0.85

Tested by

no test coverage detected