Skip to content

Commit 94824a6

Browse files
authored
Merge v2-ui: VS Code-style workbench (Track A), B1 B2 B4 B6 B7 B8 B9
Track A: VS Code-style workbench, B1/B2 fixes and UI regression coverage
2 parents 92e278b + bbb19bd commit 94824a6

68 files changed

Lines changed: 1546 additions & 434 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/MEDHA-v2-PLAN.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Release rule: fix and push all month, publish to the Store **once** at the end (
2222
| B5 | Low | 8 `except Exception: pass` hide real errors. | `grep -rn "except Exception" medha` | Log with `logging.exception` and show a status-bar message. |
2323
| B6 | Low | Test suite fails offline (real network call). | `tests/test_extensions_registry.py` | `@pytest.mark.network`, skipped unless `MEDHA_NETWORK_TESTS=1`. |
2424
| B7 | Low | 16 unused variables (pyflakes). | dsa_engine, panel.py, renderers | Remove. CI runs `pyflakes medha` and must be clean. |
25+
| B8 | Medium | Closing a window with active disassembly can call a deleted QTextEdit. | `app.py` closeEvent | Stop child QProcesses before widget teardown. |
26+
| B9 | High | Closing an edited tab discarded unsaved work without confirmation. | `app.py` close_tab/closeEvent | Save/Discard/Cancel guard, including cancelled Save As. |
2527
More bugs come from Track B (section 3) — append them to this table with the same columns.
2628

2729
## 2. Track A — New UI like VS Code / Antigravity (ChatGPT)
@@ -76,3 +78,13 @@ diagnostics, rename, format, run, debug) before the next:
7678
| 3.5 | Go (GoLand), Rust (RustRover) | gopls, rust-analyzer | delve, codelldb |
7779
| 3.6 | SQL (DataGrip) | sqls + a simple DB browser (SQLite first) | — |
7880
Each server is downloaded on first use (not bundled) to keep the Store package small; everything still works offline after that.
81+
82+
## Track A implementation evidence (2026-11-05)
83+
84+
Implemented on `v2-ui`: Track A steps 1–8, B1 and B2. Required offline/lint
85+
prerequisites B4/B6/B7 are included as separate commits. B8/B9 were discovered
86+
while exercising the UI and are fixed in this branch. B3/B5 remain Track B work.
87+
See [verification details](V2-UI-VERIFICATION.md) and
88+
[before/after screenshots](screenshots/v2/README.md). Linux checks: 106 passed,
89+
1 explicit network skip; pyflakes clean; 20 UI smoke tests passed. Windows/manual
90+
release acceptance remains pending.

‎docs/V2-UI-VERIFICATION.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Track A verification — 2026-11-05
2+
3+
Branch: `v2-ui`. Base: `92e278b`.
4+
5+
## Implemented
6+
7+
- B1: 48 px activity bar, scrollable sidebar views, editor-first splitters, bottom panel; Ctrl+B/Ctrl+J and QSettings size/visibility persistence.
8+
- B2: escaped literal ampersands in docks, debugger tabs, and dynamically named editor tabs.
9+
- Command centre, command palette, incremental Quick Open, workspace text search, Git view, and File/Edit/Selection/View/Go/Run/Terminal/Help menus.
10+
- Existing menu actions preserved as the same QAction objects; original action names captured in `tests/fixtures/v1_actions.json` and checked after relocation.
11+
- Medhā Dark/Light with shared QSS and central color tokens, readable activity icons, grey close buttons, editor gutter and clickable minimap. Windows PyInstaller spec includes the QSS resource.
12+
- Welcome page with new C file, open folder/file, current Recent list, Turbo examples, and DSA entry points.
13+
- Real local branch, document/language/encoding, compiler availability and build diagnostics; optional CPU/RAM sampling.
14+
- B4, B6, B7: prerequisite duplicate-loader, offline-test and lint cleanup in separate commits.
15+
- Newly documented B8/B9: orderly process shutdown and Save/Discard/Cancel protection for edited tabs/windows.
16+
17+
## Checks by step
18+
19+
All counts below are offline. The real registry test is explicitly skipped unless
20+
`MEDHA_NETWORK_TESTS=1`; local fake registry-server tests still run.
21+
22+
| Step | Full pytest | UI smoke |
23+
|---|---|---|
24+
| Baseline | 85 passed, real-network test deselected | baseline screenshots |
25+
| B6 | 86 passed, 1 skipped | window opens |
26+
| B4/B7 | 87 passed, 1 skipped | 1 passed |
27+
| B2/B8 | 88 passed, 1 skipped | 2 passed |
28+
| Workbench/B1 | 91 passed, 1 skipped | 5 passed |
29+
| Navigation | 93 passed, 1 skipped | 7 passed |
30+
| Themes/minimap | 94 passed, 1 skipped | 8 passed |
31+
| Welcome/close guard | 96 passed, 1 skipped | 10 passed |
32+
| Status/actions | 98 passed, 1 skipped | 12 passed |
33+
| Final regression checks | **106 passed, 1 skipped** | **20 passed** |
34+
35+
Pyflakes is clean after B7 and at every subsequent completed step.
36+
37+
```sh
38+
QT_QPA_PLATFORM=offscreen python -m pytest -q
39+
python -m pyflakes medha
40+
QT_QPA_PLATFORM=offscreen python -m pytest tests/test_ui_smoke.py -q
41+
```
42+
43+
UI tests check tool routing, both screen sizes/themes, actual text viewport width,
44+
keyboard toggles, settings restoration into a second window, palette action
45+
preservation, Quick Open, Search, Recent, minimap navigation, real status updates,
46+
unsaved-close cancellation and cancelled Save As. Requests are blocked during UI
47+
startup, and Qt callback exceptions are collected as failures.
48+
49+
The all-action smoke test triggers every menu action from the legitimate Welcome
50+
(no active document) state. Dialogs are cancelled and external CMake build calls
51+
are stubbed. It verifies UI wiring and survival, not every compiler/debugger backend.
52+
Focused tests exercise document operations separately.
53+
54+
## Review limits
55+
56+
- Screenshots and tests ran on Linux/PySide6 6.12. Windows install/launch/uninstall and the full cross-platform release checklist are still required before release.
57+
- B3 (PTY/ConPTY) and B5 (remaining broad exception handlers) remain Track B work.
58+
- Original UI supported only dark; before-light images cannot be captured authentically. Both new themes have full after evidence in `screenshots/v2/`.
59+
- No Store submission, release version change, or merge is included.

‎docs/screenshots/v2/README.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Track A visual verification
2+
3+
Captured from the real PySide6 window on Linux with `QT_QPA_PLATFORM=offscreen`.
4+
Images are native 1366×768 and 1920×1080 pixels, without rescaling.
5+
6+
| State | 1366×768 | 1920×1080 |
7+
|---|---|---|
8+
| Before (original dark theme) | [Before](before-dark-1366x768.png) | [Before](before-dark-1920x1080.png) |
9+
| After, Medhā Dark | [Dark](after-dark-1366x768.png) | [Dark](after-dark-1920x1080.png) |
10+
| After, Medhā Light | [Light](after-light-1366x768.png) | [Light](after-light-1920x1080.png) |
11+
| Welcome, dark | [Welcome](after-welcome-dark-1366x768.png) | [Welcome](after-welcome-dark-1920x1080.png) |
12+
| Welcome, light | [Welcome](after-welcome-light-1366x768.png) | [Welcome](after-welcome-light-1920x1080.png) |
13+
14+
The original application has no light-theme switch, so a genuine before-light
15+
capture is unavailable. No synthetic before-light image is supplied.
16+
`step-1` through `step-5` retain intermediate layout/navigation/theme/welcome/status evidence.
17+
18+
The editor tab region increased from **127 → 1044 px** at 1366×768 and
19+
**301 → 1598 px** at 1920×1080. Automated assertions also check the actual text
20+
viewport (excluding the gutter and minimap) remains at least 60% of window width
21+
in both themes at both resolutions.
22+
23+
The red terminal job-control warning is existing **B3**, assigned to Track B.
24+
It remains visible in these unedited screenshots; this PR does not implement a PTY.
25+
26+
Reproduce from the repository root in an environment with the dependencies installed:
27+
28+
```sh
29+
QT_QPA_PLATFORM=offscreen python tools/capture_v2.py --phase after
30+
QT_QPA_PLATFORM=offscreen python tools/capture_v2.py --phase after-welcome --welcome
31+
```
32+
33+
The capture tool uses a temporary project and isolated settings, then shuts down
34+
its processes. It does not change the user's workspace or preferences.
108 KB
Loading
114 KB
Loading
109 KB
Loading
115 KB
Loading
95.1 KB
Loading
100 KB
Loading
95.3 KB
Loading

0 commit comments

Comments
 (0)