Skip to content

fix: remove whitespace below hero tabs on mobile#198

Merged
ManukMinasyan merged 2 commits intomainfrom
fix/hero-tabs-mobile-whitespace
Mar 29, 2026
Merged

fix: remove whitespace below hero tabs on mobile#198
ManukMinasyan merged 2 commits intomainfrom
fix/hero-tabs-mobile-whitespace

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

Summary

  • Hidden tab panels used visibility: hidden which preserves layout space
  • The AI Agent chat panel (tallest) forced container height for all tabs, creating large whitespace on Pipeline/Companies/Fields tabs on mobile
  • Switch hidden panels to absolute positioning so only the active panel determines container height

Test plan

  • Mobile: switch between all 4 hero tabs -- no whitespace below shorter panels
  • Desktop: tab switching animations still crossfade smoothly
  • Verify AI Agent tab still renders at full height when active

- Add min:20 validation to contact form message field
- Use API_DOMAIN env var for Scribe docs base URL when set
Hidden tab panels used visibility:hidden which preserves layout space,
causing the tallest panel (AI Agent chat) to force container height for
all tabs. Switch hidden panels to absolute positioning so only the
active panel determines container height.
Copilot AI review requested due to automatic review settings March 29, 2026 13:07
@ManukMinasyan ManukMinasyan merged commit 0b2744e into main Mar 29, 2026
11 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the marketing home hero tab panel behavior to avoid excess vertical whitespace on mobile by changing how inactive panels are hidden. The PR also includes unrelated configuration and validation tweaks.

Changes:

  • Update hero tab panels to use absolute positioning when hidden, aiming to prevent hidden content from contributing to layout height.
  • Update Scribe API docs base_url to prefer app.api_domain when set.
  • Tighten contact form validation by requiring a minimum message length.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
resources/views/home/partials/hero.blade.php Changes tab panel hiding/showing mechanics to reduce mobile whitespace.
config/scribe.php Alters generated API docs base URL selection logic.
app/Http/Requests/ContactRequest.php Adds min:20 validation rule for contact messages.
Comments suppressed due to low confidence (1)

resources/views/home/partials/hero.blade.php:201

  • During the animated tab switch, showPanel(nextPanel) makes the next panel participate in grid layout again, but the previous (currently visible) panel remains in-flow until the animation promise resolves and hidePanel(currentPanel) runs. In a grid, both panels will contribute to the row sizing during that interval, so switching away from the tall AI panel can still keep the container height tall (and whitespace visible) for the duration of the animation. Consider moving currentPanel to absolute inset-0 (without invisible) before starting the animation so only the active panel determines layout height while the outgoing panel crossfades on top.
            showPanel(panel) {
                panel.classList.remove('invisible', 'absolute', 'inset-0');
                panel.style.position = 'relative';
                panel.style.zIndex = '1';
            },

            hidePanel(panel) {
                panel.classList.add('invisible', 'absolute', 'inset-0');
                panel.style.position = '';
                panel.style.opacity = '';
                panel.style.transform = '';
                panel.style.willChange = '';
                panel.style.zIndex = '';
            },

Comment on lines +35 to 36
'base_url' => config('app.api_domain') ? 'https://'.config('app.api_domain') : config('app.url'),

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hardcodes the scheme to https and doesn’t preserve the optional port the way URL::getApiUrl() does. In local/dev (often http) or when app.url includes a port, the generated Scribe base URL can be incorrect. Suggest mirroring the logic in MacroServiceProvider::getApiUrl (derive scheme+port from config('app.url'), then apply api_domain) so docs URLs match the rest of the app.

Suggested change
'base_url' => config('app.api_domain') ? 'https://'.config('app.api_domain') : config('app.url'),
'base_url' => (static function (): string {
$appUrl = config('app.url');
$apiDomain = config('app.api_domain');
if (! is_string($appUrl) || $appUrl === '') {
return '';
}
if (! is_string($apiDomain) || $apiDomain === '') {
return $appUrl;
}
$parsed = parse_url($appUrl);
if ($parsed === false || ! isset($parsed['scheme'], $parsed['host'])) {
return $appUrl;
}
$scheme = $parsed['scheme'];
$port = isset($parsed['port']) ? ':'.$parsed['port'] : '';
return "{$scheme}://{$apiDomain}{$port}";
})(),

Copilot uses AI. Check for mistakes.
// The base URL displayed in the docs.
// If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL.
'base_url' => config('app.url'),
'base_url' => config('app.api_domain') ? 'https://'.config('app.api_domain') : config('app.url'),
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description focuses on removing mobile whitespace in the home hero tabs, but this PR also changes Scribe docs base URL behavior. Please either update the PR description/test plan to cover this change (and why it’s included) or split it into a separate PR so the UI fix can be reviewed/rolled back independently.

Copilot uses AI. Check for mistakes.
Comment on lines 15 to 19
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email:rfc,dns', 'max:255'],
'company' => ['nullable', 'string', 'max:255'],
'message' => ['required', 'string', 'max:5000'],
'message' => ['required', 'string', 'min:20', 'max:5000'],
];
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes validation behavior (message now requires a minimum length). There are Feature tests for public pages, but none appear to cover the contact form submission/validation, so this behavior can regress silently. Add Pest feature tests covering: (1) message < 20 chars fails validation, and (2) a valid submission sends the mail and redirects with success.

Copilot generated this review using guidance from repository custom instructions.
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.

2 participants