-
Notifications
You must be signed in to change notification settings - Fork 62.8k
Repo sync #37991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Repo sync #37991
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
26 changes: 26 additions & 0 deletions
26
...tings-and-features/managing-repository-settings/managing-auto-closing-issues.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Managing the automatic closing of issues in your repository | ||
intro: You can select whether merged linked pull requests will auto-close your issues. | ||
versions: | ||
fpt: '*' | ||
ghes: '*' | ||
ghec: '*' | ||
permissions: Repository administrators and maintainers can configure the automating closing of issues in the repository, once related pull requests are merged. | ||
topics: | ||
- Repositories | ||
- Issues | ||
- Pull requests | ||
shortTitle: Manage auto-closing issues | ||
allowTitleToDifferFromFilename: true | ||
--- | ||
|
||
## About auto-closing issues | ||
|
||
By default, merging a linked pull request automatically closes the associated issue. You can override the default behavior by disabling auto-closing. | ||
|
||
## Enabling or disabling auto-closing of issues | ||
|
||
{% data reusables.repositories.navigate-to-repo %} | ||
{% data reusables.repositories.sidebar-settings %} | ||
1. Under **General**, scroll down to the **Issues** section. | ||
1. Select or deselect **Auto-close issues with merged linked pull requests** to enable or disable auto-closing. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Context to keep track of a call to action (e.g. popover introducing a new feature) | ||
// The state of the CTA will be stored in local storage, so it will persist across page reloads | ||
// If `dismiss` is called, the CTA will not be shown again | ||
import { | ||
createContext, | ||
useCallback, | ||
useContext, | ||
useEffect, | ||
useState, | ||
PropsWithChildren, | ||
} from 'react' | ||
|
||
type CTAPopoverState = { | ||
isOpen: boolean | ||
initializeCTA: () => void // Call to "open" the CTA if it's not already been dismissed by the user | ||
dismiss: () => void // Call to "close" the CTA and store the dismissal in local storage | ||
} | ||
|
||
type StoredValue = { dismissed: true } | ||
|
||
const CTAPopoverContext = createContext<CTAPopoverState | undefined>(undefined) | ||
|
||
const STORAGE_KEY = 'ctaPopoverDismissed' | ||
|
||
const isDismissed = (): boolean => { | ||
if (typeof window === 'undefined') return false // SSR guard | ||
try { | ||
const raw = localStorage.getItem(STORAGE_KEY) | ||
if (!raw) return false | ||
const parsed = JSON.parse(raw) as StoredValue | ||
return parsed?.dismissed | ||
} catch { | ||
return false // corruption / quota / disabled storage | ||
} | ||
} | ||
|
||
export function CTAPopoverProvider({ children }: PropsWithChildren) { | ||
// We start closed because we might only want to "turn on" the CTA if an experiment is active | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
const persistDismissal = useCallback(() => { | ||
setIsOpen(false) | ||
try { | ||
const obj: StoredValue = { dismissed: true } | ||
localStorage.setItem(STORAGE_KEY, JSON.stringify(obj)) | ||
} catch { | ||
/* ignore */ | ||
} | ||
}, []) | ||
|
||
const dismiss = useCallback(() => persistDismissal(), [persistDismissal]) | ||
const initializeCTA = useCallback(() => { | ||
const dismissed = isDismissed() | ||
if (dismissed) { | ||
setIsOpen(false) | ||
} else { | ||
setIsOpen(true) | ||
} | ||
}, [isDismissed]) | ||
|
||
// Wrap in a useEffect to avoid a hydration mismatch (SSR guard) | ||
useEffect(() => { | ||
const stored = isDismissed() | ||
setIsOpen(!stored) | ||
}, []) | ||
|
||
return ( | ||
<CTAPopoverContext.Provider value={{ isOpen, initializeCTA, dismiss }}> | ||
{children} | ||
</CTAPopoverContext.Provider> | ||
) | ||
} | ||
|
||
export const useCTAPopoverContext = () => { | ||
const ctx = useContext(CTAPopoverContext) | ||
if (!ctx) throw new Error('useCTAPopoverContext must be used inside <CTAPopoverProvider>') | ||
return ctx | ||
} |
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling
initializeCTA()
directly during render causes a state update in the render phase. Move this call into auseEffect
that depends onshowNewSearch
to avoid side effects in the render path.Copilot uses AI. Check for mistakes.