Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
main
Branches (1)
main
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
main
Branches (1)
main
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
main
Branches (1)
main
MiniCode-Python
/
visual_test.py
MiniCode-Python
/
visual_test.py
visual_test.py 3.93 KB
Copy Edit Raw Blame History
QUSETIONS authored 2026年04月05日 17:37 +08:00 . fix: make agent turn async to eliminate Enter key lag
"""Visual test — render each TUI component to verify the enhanced aesthetics."""
import sys
sys.path.insert(0, ".")
from minicode.tui.chrome import (
render_banner, render_footer_bar, render_panel, render_slash_menu,
render_tool_panel, render_status_line, render_permission_prompt,
)
from minicode.tui.transcript import render_transcript
from minicode.tui.input import render_input_prompt
from minicode.tui.markdown import render_markdownish
from minicode.tui.types import TranscriptEntry
print("=" * 60)
print(" VISUAL TEST — Enhanced TUI Components")
print("=" * 60)
print()
# 1. Banner
print(">>> BANNER:")
banner = render_banner(
{"model": "claude-sonnet-4-20250514", "baseUrl": "https://api.anthropic.com/v1"},
"/home/user/my-project",
["read: cwd only", "write: ask", "exec: ask"],
{"messageCount": 12, "transcriptCount": 8, "skillCount": 5, "mcpCount": 2},
)
print(banner)
print()
# 2. Transcript with entries
print(">>> TRANSCRIPT:")
entries = [
TranscriptEntry(id=1, kind="user", body="Fix the login bug in auth.py"),
TranscriptEntry(id=2, kind="assistant", body="I'll look at the auth module and fix the login issue.\n\n**Key changes:**\n1. Fixed token validation\n2. Added error handling\n\n```python\ndef login(user, pwd):\n token = validate(user, pwd)\n return token\n```"),
TranscriptEntry(id=3, kind="tool", body="File edited successfully", toolName="edit_file", status="success", collapsed=True, collapsedSummary="auth.py +5 -2"),
TranscriptEntry(id=4, kind="tool", body="Running tests...", toolName="run_command", status="running"),
TranscriptEntry(id=5, kind="progress", body="Waiting for test results..."),
]
transcript = render_transcript(entries, 0, 30)
transcript_panel = render_panel("session feed", transcript, right_title="5 events")
print(transcript_panel)
print()
# 3. Input prompt
print(">>> INPUT PROMPT:")
prompt = render_input_prompt("Fix the bug in", 14)
prompt_panel = render_panel("prompt", prompt)
print(prompt_panel)
print()
# 4. Footer
print(">>> FOOTER:")
footer = render_footer_bar("Thinking...", True, True, [{"status": "running", "label": "bg-task"}])
print(footer)
print()
# 5. Tool panel
print(">>> TOOL PANEL:")
tool = render_tool_panel("read_file", [
{"name": "list_files", "status": "success"},
{"name": "grep", "status": "success"},
{"name": "write_file", "status": "error"},
])
activity = render_panel("activity", tool)
print(activity)
print()
# 6. Status line
print(">>> STATUS LINES:")
print(render_status_line(None))
print(render_status_line("Generating response..."))
print()
# 7. Slash menu
print(">>> SLASH MENU:")
class FakeCmd:
def __init__(self, usage, description):
self.usage = usage
self.description = description
cmds = [
FakeCmd("/help", "Show available commands"),
FakeCmd("/clear", "Clear the current session"),
FakeCmd("/save", "Save transcript to file"),
FakeCmd("/exit", "Exit MiniCode"),
]
menu = render_slash_menu(cmds, 1)
print(menu)
print()
# 8. Markdown rendering
print(">>> MARKDOWN:")
md = render_markdownish("""# Main Title
## Subtitle
### Section
This is *italic* and **bold** text with `inline code`.
> This is a blockquote
> with multiple lines
- First bullet
- Second bullet
- Nested bullet
1. First item
2. Second item
```python
def hello():
print("world")
```
---
| Name | Value |
|------|-------|
| foo | bar |
| baz | qux |
""")
print(md)
print()
# 9. Permission prompt
print(">>> PERMISSION PROMPT:")
perm = render_permission_prompt(
{
"summary": "edit_file wants to modify auth.py",
"kind": "edit",
"details": ["--- a/auth.py", "+++ b/auth.py", "@@ -1,3 +1,5 @@"],
"choices": [
{"label": "Allow", "key": "y"},
{"label": "Deny", "key": "n"},
{"label": "Always allow", "key": "a"},
],
},
selected_choice_index=0,
)
print(perm)
print()
print("=" * 60)
print(" ALL VISUAL TESTS RENDERED SUCCESSFULLY")
print("=" * 60)
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yyyac/MiniCode-Python.git
git@gitee.com:yyyac/MiniCode-Python.git
yyyac
MiniCode-Python
MiniCode-Python
main
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /