Skip to content

Conversation

@ywzheng1
Copy link
Member

@ywzheng1 ywzheng1 commented Nov 4, 2025

What is this feature?

ConfigFormGithubCollapse: Hide whole collapse section if none of feature is available to avoid user confusion.

Tested in ephemeral:
image

Local should still show:
image

Why do we need this feature?

Avoid user confusion.

Who is this feature for?

Git sync user

Which issue(s) does this PR fix?:

Fixes https://github.com/grafana/git-ui-sync-project/issues/641

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@ywzheng1 ywzheng1 self-assigned this Nov 4, 2025
@ywzheng1 ywzheng1 added area/frontend no-changelog Skip including change in changelog/release notes labels Nov 4, 2025
@ywzheng1 ywzheng1 marked this pull request as ready for review November 4, 2025 16:07
@github-actions github-actions bot added this to the 12.3.x milestone Nov 4, 2025
@ywzheng1
Copy link
Member Author

ywzheng1 commented Nov 4, 2025

/deploy-to-hg

@ephemeral-instances-bot
Copy link

  • Preparing your instance. A comment containing your instance's url will be added to this PR when the instance is ready.
    - Grafana branch: ywzheng1/git-sync-hide-empty-github-features-section
    - Grafana Enterprise branch: main
  • Your instance will be ready in ~10 minutes. Follow the workflow progress
  • Slack channel: #proj-ephemeral-hg-instances
  • Building instance with ywzheng1/git-sync-hide-empty-github-features-section oss branch and main enterprise branch. How to choose a branch

</Field>
)}
<Stack direction="column" gap={2}>
{imageRenderingAllowed && (
Copy link
Member Author

@ywzheng1 ywzheng1 Nov 4, 2025

Choose a reason for hiding this comment

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

no logic changes from here to the end, things changes:

  • code moved inside Stack component
  • added noMargin props to Field

@ephemeral-instances-bot
Copy link

Copy link
Contributor

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

This PR refactors the ConfigFormGithubCollapse component to improve its conditional rendering logic and layout structure. The changes introduce early returns for cases where no content should be displayed and wrap fields in a Stack component for consistent spacing.

Key changes:

  • Added early return when neither GitHub feature is applicable (image rendering disabled on public instances)
  • Wrapped field elements in a Stack component with consistent vertical spacing
  • Added comprehensive test coverage for different rendering scenarios

Reviewed Changes

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

File Description
ConfigFormGithubCollapse.tsx Adds early return logic and wraps fields in Stack component with noMargin props for consistent spacing
ConfigFormGithubCollapse.test.tsx Adds comprehensive test suite covering all rendering scenarios and conditional logic
eslint-suppressions.json Removes no-restricted-syntax suppressions that are no longer needed after refactoring

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend no-changelog Skip including change in changelog/release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant