Skip to content

Commit f1e6aee

Browse files
authored
Merge pull request #481 from opf/code-maintenance/explicit-controller-names
Define explicit controller names for OP elements
2 parents c55aab0 + 0aabd1a commit f1e6aee

10 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Use Catalyst for component behaviors:
135135
```typescript
136136
import {controller, target} from '@github/catalyst';
137137

138-
@controller
138+
@controller('my-component')
139139
class MyComponentElement extends HTMLElement {
140140
@target button: HTMLElement
141141

app/components/primer/open_project/avatar_fallback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {controller} from '@github/catalyst'
1313
* due to a Catalyst bug where @attr accessors aren't properly initialized
1414
* when elements have pre-existing attribute values.
1515
*/
16-
@controller
16+
@controller('avatar-fallback')
1717
export class AvatarFallbackElement extends HTMLElement {
1818
private img: HTMLImageElement | null = null
1919
private testImage: HTMLImageElement | null = null

app/components/primer/open_project/border_box/collapsible_header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {controller} from '@github/catalyst'
22
import {CollapsibleElement} from '../collapsible'
33

4-
@controller
4+
@controller('collapsible-header')
55
class CollapsibleHeaderElement extends CollapsibleElement {
66
connectedCallback() {
77
if (!this.closest('.Box')) {

app/components/primer/open_project/collapsible_section.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {controller} from '@github/catalyst'
22
import {CollapsibleElement} from './collapsible'
33

4-
@controller
4+
@controller('collapsible-section')
55
class CollapsibleSectionElement extends CollapsibleElement {
66
get baseClass(): string {
77
return 'CollapsibleSection'

app/components/primer/open_project/danger_dialog_form_helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {LiveRegionElement} from '@primer/live-region-element'
33

44
const SUBMIT_BUTTON_SELECTOR = 'input[type=submit],button[type=submit],button[data-submit-dialog-id]'
55

6-
@controller
6+
@controller('danger-dialog-form-helper')
77
class DangerDialogFormHelperElement extends HTMLElement {
88
@target checkbox: HTMLInputElement | undefined
99
@target liveRegion: LiveRegionElement

app/components/primer/open_project/filterable_tree_view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type NodeState = {
1818

1919
const ASYNC_DEBOUNCE_MS = 300
2020

21-
@controller
21+
@controller('filterable-tree-view')
2222
export class FilterableTreeViewElement extends HTMLElement {
2323
@target filterInput: HTMLInputElement
2424
@target filterModeControlList: HTMLElement

app/components/primer/open_project/page_header_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller} from '@github/catalyst'
22

3-
@controller
3+
@controller('page-header')
44
class PageHeaderElement extends HTMLElement {
55
menuItemClick(event: Event) {
66
const currentTarget = event.currentTarget as HTMLButtonElement

app/components/primer/open_project/sub_header_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller, target, targets} from '@github/catalyst'
22

3-
@controller
3+
@controller('sub-header')
44
class SubHeaderElement extends HTMLElement {
55
@target filterInput: HTMLInputElement
66
@targets shownItemsOnExpandedFilter: HTMLElement[]

app/components/primer/open_project/zen_mode_button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller, target} from '@github/catalyst'
22

3-
@controller
3+
@controller('zen-mode-button')
44
class ZenModeButtonElement extends HTMLElement {
55
@target button: HTMLElement
66
inZenMode = false

docs/contributors/adding-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Catalyst has `controller` and `target` decorators which you have to import from
4949
```ts
5050
import {controller, target} from '@github/catalyst';
5151

52-
@controller
52+
@controller('my-component')
5353
class MyComponentNameElement extends HTMLElement {
5454
@target button: HTMLElement
5555
}

0 commit comments

Comments
 (0)