fix(interface): 修复按钮标识和一个哈希问题
This commit is contained in:
@@ -57,6 +57,7 @@ class HeurAMSApp(App):
|
||||
"radio": RadioScreen,
|
||||
"repo_editor": RepoEditorScreen,
|
||||
"llmchat": LLMChatScreen,
|
||||
# "config": ConfigScreen,
|
||||
}
|
||||
|
||||
def on_mount(self) -> None:
|
||||
|
||||
0
src/heurams/interface/screens/configure.py
Normal file
0
src/heurams/interface/screens/configure.py
Normal file
@@ -70,6 +70,7 @@ class MemScreen(Screen):
|
||||
"""更新状态机"""
|
||||
self.procession: Procession = self.phaser.current_procession() # type: ignore
|
||||
self.atom: pt.Atom = self.procession.current_atom # type: ignore
|
||||
|
||||
|
||||
def on_mount(self):
|
||||
self.fission = self.procession.get_fission()
|
||||
@@ -176,6 +177,7 @@ class MemScreen(Screen):
|
||||
self.forward(new_rating)
|
||||
self.rating = -1
|
||||
|
||||
|
||||
def forward(self, rating):
|
||||
self.update_state()
|
||||
allow_forward = 1 if rating >= 4 else 0
|
||||
|
||||
@@ -29,6 +29,7 @@ class NavigatorScreen(ModalScreen):
|
||||
# ("创建仓库", "repo_creator"),
|
||||
("缓存管理器", "precache_all"),
|
||||
("收藏夹管理器", FavoriteManagerScreen),
|
||||
("配置设置", "config"),
|
||||
("关于此软件", "about"),
|
||||
("调试日志", "logviewer"),
|
||||
# ("同步工具", "synctool"),
|
||||
|
||||
@@ -9,6 +9,7 @@ from textual.widgets import Button, Label
|
||||
|
||||
import heurams.kernel.particles as pt
|
||||
import heurams.kernel.puzzles as pz
|
||||
from heurams.services.hasher import hash
|
||||
from heurams.services.logger import get_logger
|
||||
|
||||
from .base_puzzle_widget import BasePuzzleWidget
|
||||
|
||||
@@ -152,7 +152,7 @@ class MCQPuzzle(BasePuzzleWidget):
|
||||
for option in current_options:
|
||||
button_id = f"sel{str(self.cursor).zfill(3)}-{hash(option)}"
|
||||
if button_id not in self.hashmap:
|
||||
self.hashmap[button_id] = option
|
||||
self.hashmap[button_id[7:]] = option
|
||||
new_button = Button(option, id=button_id)
|
||||
container.mount(new_button)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user