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

## 2. Track A — New UI like VS Code / Antigravity (ChatGPT)
Expand Down Expand Up @@ -76,3 +78,13 @@ diagnostics, rename, format, run, debug) before the next:
| 3.5 | Go (GoLand), Rust (RustRover) | gopls, rust-analyzer | delve, codelldb |
| 3.6 | SQL (DataGrip) | sqls + a simple DB browser (SQLite first) | — |
Each server is downloaded on first use (not bundled) to keep the Store package small; everything still works offline after that.

## Track A implementation evidence (2026-11-05)

Implemented on `v2-ui`: Track A steps 1–8, B1 and B2. Required offline/lint
prerequisites B4/B6/B7 are included as separate commits. B8/B9 were discovered
while exercising the UI and are fixed in this branch. B3/B5 remain Track B work.
See [verification details](V2-UI-VERIFICATION.md) and
[before/after screenshots](screenshots/v2/README.md). Linux checks: 106 passed,
1 explicit network skip; pyflakes clean; 20 UI smoke tests passed. Windows/manual
release acceptance remains pending.
59 changes: 59 additions & 0 deletions docs/V2-UI-VERIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Track A verification — 2026-11-05

Branch: `v2-ui`. Base: `92e278b`.

## Implemented

- B1: 48 px activity bar, scrollable sidebar views, editor-first splitters, bottom panel; Ctrl+B/Ctrl+J and QSettings size/visibility persistence.
- B2: escaped literal ampersands in docks, debugger tabs, and dynamically named editor tabs.
- Command centre, command palette, incremental Quick Open, workspace text search, Git view, and File/Edit/Selection/View/Go/Run/Terminal/Help menus.
- Existing menu actions preserved as the same QAction objects; original action names captured in `tests/fixtures/v1_actions.json` and checked after relocation.
- 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.
- Welcome page with new C file, open folder/file, current Recent list, Turbo examples, and DSA entry points.
- Real local branch, document/language/encoding, compiler availability and build diagnostics; optional CPU/RAM sampling.
- B4, B6, B7: prerequisite duplicate-loader, offline-test and lint cleanup in separate commits.
- Newly documented B8/B9: orderly process shutdown and Save/Discard/Cancel protection for edited tabs/windows.

## Checks by step

All counts below are offline. The real registry test is explicitly skipped unless
`MEDHA_NETWORK_TESTS=1`; local fake registry-server tests still run.

| Step | Full pytest | UI smoke |
|---|---|---|
| Baseline | 85 passed, real-network test deselected | baseline screenshots |
| B6 | 86 passed, 1 skipped | window opens |
| B4/B7 | 87 passed, 1 skipped | 1 passed |
| B2/B8 | 88 passed, 1 skipped | 2 passed |
| Workbench/B1 | 91 passed, 1 skipped | 5 passed |
| Navigation | 93 passed, 1 skipped | 7 passed |
| Themes/minimap | 94 passed, 1 skipped | 8 passed |
| Welcome/close guard | 96 passed, 1 skipped | 10 passed |
| Status/actions | 98 passed, 1 skipped | 12 passed |
| Final regression checks | **106 passed, 1 skipped** | **20 passed** |

Pyflakes is clean after B7 and at every subsequent completed step.

```sh
QT_QPA_PLATFORM=offscreen python -m pytest -q
python -m pyflakes medha
QT_QPA_PLATFORM=offscreen python -m pytest tests/test_ui_smoke.py -q
```

UI tests check tool routing, both screen sizes/themes, actual text viewport width,
keyboard toggles, settings restoration into a second window, palette action
preservation, Quick Open, Search, Recent, minimap navigation, real status updates,
unsaved-close cancellation and cancelled Save As. Requests are blocked during UI
startup, and Qt callback exceptions are collected as failures.

The all-action smoke test triggers every menu action from the legitimate Welcome
(no active document) state. Dialogs are cancelled and external CMake build calls
are stubbed. It verifies UI wiring and survival, not every compiler/debugger backend.
Focused tests exercise document operations separately.

## Review limits

- 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.
- B3 (PTY/ConPTY) and B5 (remaining broad exception handlers) remain Track B work.
- Original UI supported only dark; before-light images cannot be captured authentically. Both new themes have full after evidence in `screenshots/v2/`.
- No Store submission, release version change, or merge is included.
34 changes: 34 additions & 0 deletions docs/screenshots/v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Track A visual verification

Captured from the real PySide6 window on Linux with `QT_QPA_PLATFORM=offscreen`.
Images are native 1366×768 and 1920×1080 pixels, without rescaling.

| State | 1366×768 | 1920×1080 |
|---|---|---|
| Before (original dark theme) | [Before](before-dark-1366x768.png) | [Before](before-dark-1920x1080.png) |
| After, Medhā Dark | [Dark](after-dark-1366x768.png) | [Dark](after-dark-1920x1080.png) |
| After, Medhā Light | [Light](after-light-1366x768.png) | [Light](after-light-1920x1080.png) |
| Welcome, dark | [Welcome](after-welcome-dark-1366x768.png) | [Welcome](after-welcome-dark-1920x1080.png) |
| Welcome, light | [Welcome](after-welcome-light-1366x768.png) | [Welcome](after-welcome-light-1920x1080.png) |

The original application has no light-theme switch, so a genuine before-light
capture is unavailable. No synthetic before-light image is supplied.
`step-1` through `step-5` retain intermediate layout/navigation/theme/welcome/status evidence.

The editor tab region increased from **127 → 1044 px** at 1366×768 and
**301 → 1598 px** at 1920×1080. Automated assertions also check the actual text
viewport (excluding the gutter and minimap) remains at least 60% of window width
in both themes at both resolutions.

The red terminal job-control warning is existing **B3**, assigned to Track B.
It remains visible in these unedited screenshots; this PR does not implement a PTY.

Reproduce from the repository root in an environment with the dependencies installed:

```sh
QT_QPA_PLATFORM=offscreen python tools/capture_v2.py --phase after
QT_QPA_PLATFORM=offscreen python tools/capture_v2.py --phase after-welcome --welcome
```

The capture tool uses a temporary project and isolated settings, then shuts down
its processes. It does not change the user's workspace or preferences.
Binary file added docs/screenshots/v2/after-dark-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/after-dark-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/after-light-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/after-light-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/before-dark-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/before-dark-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-1-dark-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-1-dark-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-2-dark-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-2-dark-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-3-dark-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-3-dark-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-3-light-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-3-light-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-5-dark-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-5-dark-1920x1080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-5-light-1366x768.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/v2/step-5-light-1920x1080.png
2 changes: 1 addition & 1 deletion medha/ai_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PySide6.QtWidgets import (
QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QTextEdit, QLabel, QComboBox, QLineEdit
)
from PySide6.QtCore import Qt, QThread, Signal
from PySide6.QtCore import QThread, Signal
from medha.ai import AiAssistant

class AiStreamWorker(QThread):
Expand Down
Loading