Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 16 additions & 29 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
about: Report a bug in Canopy
title: "[Bug]: "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.
**Description**
Briefly describe the bug.

**Screenshots**
If applicable, add screenshots to help explain your problem.
**Steps to Reproduce**
1.
2.
3.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Expected Behavior**
What should happen instead?

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Environment**
- Canopy version:
- OS:
- JVM / Kotlin version (if relevant):

**Additional context**
Add any other context about the problem here.
**Additional Context**
Logs, stack traces, or screenshots if applicable.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature proposal
about: Propose a new feature or improvement
title: "[Proposal]: "
labels: enhancement, proposal
---

**Summary**
Describe the feature or improvement you would like.

**Motivation**
What problem does this solve? Why is it useful?

**Proposed Solution**
Describe how you think this could work.

**Alternatives**
Any alternative approaches or solutions considered.

**Additional Context**
Links, examples, or related discussions.
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

48 changes: 18 additions & 30 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
**What does this PR do, and why**
<!-- Briefly describe what this PR does and why. -->
**Summary**
Briefly describe what this PR changes and why.

**What changes were made**
<!-- List all the changes made -->

- Example change 1
- Example change 2
**Changes**
-
-
-

**Related Issues**
<!-- List all closed issues -->

Closes #

**Type of Change**

- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Feature
- [ ] Refactor
- [ ] Documentation update
- [ ] Test update
- [ ] Documentation
- [ ] Tests
- [ ] Chore
- [ ] Breaking change

**How to Test**
<!-- List all the needed steps to test it -->

1.
2.
3.
Steps to verify the change:

**Screenshots / Recordings**
<!-- Add screenshots, GIFs, or videos if applicable -->
1.
2.
3.

**Checklist**

- [ ] My code follows the project style guidelines
- [ ] I have self-reviewed my code
- [ ] I have added or updated tests where needed
- [ ] I have updated documentation where needed
- [ ] This PR is ready for review

**Notes for Reviewers**
<!-- Anything specific reviewers should pay attention to -->
- [ ] Code follows project style
- [ ] Self-reviewed
- [ ] Tests added/updated (if applicable)
- [ ] Docs updated (if applicable)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.canopy.engine.core.reactive
package io.canopy.engine.core.flow

import io.canopy.engine.core.nodes.Node

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.canopy.engine.core.reactive
package io.canopy.engine.core.flow

import java.lang.ref.WeakReference
import java.util.concurrent.CopyOnWriteArrayList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.canopy.engine.core.reactive
package io.canopy.engine.core.flow

import kotlin.properties.Delegates
import kotlinx.coroutines.flow.MutableSharedFlow
Expand Down Expand Up @@ -73,6 +73,13 @@ class Signal<T>(initial: T) {

/** Removes all listeners registered via [connect]. */
fun clear() = valueChanged.clear()

/**
* Allows value updates based on previous value
*/
fun update(handler: (T) -> T) {
value = handler(value)
}
}

/* ------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package io.canopy.engine.core.managers

import kotlin.reflect.KClass
import com.badlogic.gdx.math.Vector2
import io.canopy.engine.core.flow.asSignal
import io.canopy.engine.core.flow.event
import io.canopy.engine.core.nodes.Node
import io.canopy.engine.core.nodes.TreeSystem
import io.canopy.engine.core.reactive.asSignal
import io.canopy.engine.core.reactive.event
import io.canopy.engine.logging.EngineLogs
import io.canopy.engine.logging.LogContext

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.canopy.engine.core.nodes

import kotlin.reflect.KClass
import io.canopy.engine.core.flow.Context
import io.canopy.engine.core.managers.SceneManager
import io.canopy.engine.core.managers.lazyManager
import io.canopy.engine.core.managers.manager
import io.canopy.engine.core.reactive.Context
import io.canopy.engine.logging.EngineLogs
import io.canopy.engine.logging.LogContext

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.canopy.engine.core.reactive
package io.canopy.engine.core.flow

import io.canopy.engine.core.managers.ManagersRegistry
import io.canopy.engine.core.managers.SceneManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.canopy.engine.core.reactive
package io.canopy.engine.core.flow

import kotlin.concurrent.atomics.AtomicInt
import kotlin.concurrent.atomics.ExperimentalAtomicApi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.canopy.engine.core.reactive
package io.canopy.engine.core.flow

import kotlin.test.Test
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -28,7 +28,7 @@ class SignalTests {
signal connect callback

// Mutate the signal
signal.value = 42
signal.value += 42

// Listener should receive the new value
assert(receivedValue == 42) { "Listener should have received the emitted value." }
Expand Down Expand Up @@ -107,9 +107,9 @@ class SignalTests {
}

// Update values
signal.value = 42
signal.update { 42 }
signal.value = 100
signal.value = 100 // duplicate -> should not be collected (distinctUntilChanged)
signal.update { 100 } // duplicate -> should not be collected (distinctUntilChanged)

// Give collector a chance to run
yield()
Expand All @@ -120,13 +120,13 @@ class SignalTests {

@Test
fun `asSignal should wrap a value and allow updates`() {
val signalVal = 10.asSignal()
val signal = 10.asSignal()

// Initial value should be preserved
assertEquals(10, signalVal.value) { "Wrapped value should match the initial value." }
assertEquals(10, signal.value) { "Wrapped value should match the initial value." }

// Updating the signal should update its stored value
signalVal.value = 20
assertEquals(20, signalVal.value) { "Wrapped value should update when assigned." }
signal.update { 20 }
assertEquals(20, signal.value) { "Wrapped value should update when assigned." }
}
}
Loading
Loading