Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- tests/test_myco_core.py +8 -7
- ui/renderers.py +11 -13
- ui/styles.py +0 -73
tests/test_myco_core.py
CHANGED
|
@@ -56,16 +56,17 @@ class MycoCoreTests(unittest.TestCase):
|
|
| 56 |
self.assertIn("forest-scene", scene)
|
| 57 |
self.assertIn(mushroom.name, scene)
|
| 58 |
|
| 59 |
-
def
|
| 60 |
home = home_forest_markdown()
|
| 61 |
|
| 62 |
-
self.assertIn("
|
| 63 |
-
self.assertIn("
|
| 64 |
-
self.assertIn("
|
| 65 |
-
self.assertIn('
|
| 66 |
-
self.assertIn('
|
| 67 |
-
self.assertIn("
|
| 68 |
self.assertIn("✨", home)
|
|
|
|
| 69 |
|
| 70 |
def test_hf_default_model_is_llama_8b(self):
|
| 71 |
self.assertEqual(DEFAULT_HF_MODEL_ID, "meta-llama/Llama-3.1-8B-Instruct")
|
|
|
|
| 56 |
self.assertIn("forest-scene", scene)
|
| 57 |
self.assertIn(mushroom.name, scene)
|
| 58 |
|
| 59 |
+
def test_home_keeps_original_tree_and_mushroom_scene(self):
|
| 60 |
home = home_forest_markdown()
|
| 61 |
|
| 62 |
+
self.assertIn('class="scene-stage"', home)
|
| 63 |
+
self.assertIn('class="forest-map"', home)
|
| 64 |
+
self.assertIn('class="tree tree-left"', home)
|
| 65 |
+
self.assertIn('class="tree tree-right"', home)
|
| 66 |
+
self.assertIn('class="myco-player" title="Myco">🍄</span>', home)
|
| 67 |
+
self.assertIn('class="mushroom-sprite" title="Brown Mushroom">🍄🟫</span>', home)
|
| 68 |
self.assertIn("✨", home)
|
| 69 |
+
self.assertIn("✦", home)
|
| 70 |
|
| 71 |
def test_hf_default_model_is_llama_8b(self):
|
| 72 |
self.assertEqual(DEFAULT_HF_MODEL_ID, "meta-llama/Llama-3.1-8B-Instruct")
|
ui/renderers.py
CHANGED
|
@@ -22,19 +22,17 @@ def hero_markdown() -> str:
|
|
| 22 |
|
| 23 |
|
| 24 |
def home_forest_markdown() -> str:
|
| 25 |
-
"""Render the
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
</div>
|
| 37 |
-
"""
|
| 38 |
|
| 39 |
|
| 40 |
def play_hook_markdown() -> str:
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
def home_forest_markdown() -> str:
|
| 25 |
+
"""Render the same magical forest scene on the Home tab."""
|
| 26 |
+
preview_mushroom = {
|
| 27 |
+
"name": "Brown Mushroom",
|
| 28 |
+
"rarity": "Common",
|
| 29 |
+
"habitat": "Home Clearing",
|
| 30 |
+
"edible": "Unknown",
|
| 31 |
+
"magic": "Unknown",
|
| 32 |
+
"danger": "Unknown",
|
| 33 |
+
"lore": "A cozy brown mushroom waits beside Myco under shining forest stars.",
|
| 34 |
+
}
|
| 35 |
+
return forest_scene(preview_mushroom, [], (1, 1))
|
|
|
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
def play_hook_markdown() -> str:
|
ui/styles.py
CHANGED
|
@@ -145,79 +145,6 @@ APP_CSS = """
|
|
| 145 |
color: #31533f;
|
| 146 |
}
|
| 147 |
|
| 148 |
-
.home-forest-postcard {
|
| 149 |
-
position: relative;
|
| 150 |
-
display: grid;
|
| 151 |
-
grid-template-columns: 1fr auto auto 1fr;
|
| 152 |
-
align-items: end;
|
| 153 |
-
gap: 0.85rem;
|
| 154 |
-
margin: 1rem 0;
|
| 155 |
-
padding: 1.6rem 1.25rem 1.25rem;
|
| 156 |
-
overflow: hidden;
|
| 157 |
-
border-radius: 26px;
|
| 158 |
-
background:
|
| 159 |
-
radial-gradient(circle at 52% 18%, rgba(180, 198, 255, 0.32), transparent 8rem),
|
| 160 |
-
radial-gradient(circle at 50% 64%, rgba(255, 239, 173, 0.34), transparent 8rem),
|
| 161 |
-
linear-gradient(180deg, rgba(20, 32, 78, 0.96), rgba(27, 82, 55, 0.96) 58%, rgba(74, 57, 30, 0.94));
|
| 162 |
-
border: 1px solid rgba(255, 244, 190, 0.34);
|
| 163 |
-
box-shadow: 0 18px 42px rgba(8, 30, 20, 0.18);
|
| 164 |
-
color: #fff9d7 !important;
|
| 165 |
-
text-align: center;
|
| 166 |
-
}
|
| 167 |
-
.home-forest-postcard span {
|
| 168 |
-
color: #fff9d7 !important;
|
| 169 |
-
line-height: 1;
|
| 170 |
-
}
|
| 171 |
-
.home-tree {
|
| 172 |
-
position: relative;
|
| 173 |
-
z-index: 2;
|
| 174 |
-
font-size: clamp(3rem, 8vw, 5.5rem);
|
| 175 |
-
filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
|
| 176 |
-
}
|
| 177 |
-
.home-myco,
|
| 178 |
-
.home-brown-mushroom {
|
| 179 |
-
position: relative;
|
| 180 |
-
z-index: 2;
|
| 181 |
-
font-size: clamp(3.6rem, 9vw, 6.5rem);
|
| 182 |
-
}
|
| 183 |
-
.home-myco {
|
| 184 |
-
filter: drop-shadow(0 14px 24px rgba(255, 92, 92, 0.28));
|
| 185 |
-
}
|
| 186 |
-
.home-brown-mushroom {
|
| 187 |
-
filter: drop-shadow(0 14px 24px rgba(255, 222, 137, 0.28));
|
| 188 |
-
}
|
| 189 |
-
.home-milky-way {
|
| 190 |
-
position: absolute;
|
| 191 |
-
top: 0.9rem;
|
| 192 |
-
left: 50%;
|
| 193 |
-
transform: translateX(-50%);
|
| 194 |
-
z-index: 1;
|
| 195 |
-
font-size: clamp(2.4rem, 7vw, 4.6rem);
|
| 196 |
-
opacity: 0.92;
|
| 197 |
-
}
|
| 198 |
-
.home-star {
|
| 199 |
-
position: absolute;
|
| 200 |
-
z-index: 1;
|
| 201 |
-
font-size: clamp(1.4rem, 4vw, 2.6rem);
|
| 202 |
-
filter: drop-shadow(0 0 12px rgba(255, 251, 198, 0.7));
|
| 203 |
-
}
|
| 204 |
-
.home-star.star-one {
|
| 205 |
-
top: 1.15rem;
|
| 206 |
-
left: 18%;
|
| 207 |
-
}
|
| 208 |
-
.home-star.star-two {
|
| 209 |
-
top: 2.2rem;
|
| 210 |
-
right: 19%;
|
| 211 |
-
}
|
| 212 |
-
.home-forest-postcard p {
|
| 213 |
-
position: relative;
|
| 214 |
-
z-index: 2;
|
| 215 |
-
grid-column: 1 / -1;
|
| 216 |
-
margin: 0.5rem 0 0;
|
| 217 |
-
color: #fff9d7 !important;
|
| 218 |
-
font-weight: 800;
|
| 219 |
-
}
|
| 220 |
-
|
| 221 |
.play-hook {
|
| 222 |
margin-bottom: 1rem;
|
| 223 |
padding: 1.1rem 1.25rem;
|
|
|
|
| 145 |
color: #31533f;
|
| 146 |
}
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
.play-hook {
|
| 149 |
margin-bottom: 1rem;
|
| 150 |
padding: 1.1rem 1.25rem;
|