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
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changelog

## 2.0.0 — release preparation (unreleased)

### Added and improved

- VS Code-style workbench with activity bar, collapsible sidebar and bottom panel; layout sizes are remembered.
- Medhā Dark and Medhā Light themes, readable tab controls and a clickable editor minimap.
- Command centre and searchable command palette (Ctrl+Shift+P).
- Quick Open (Ctrl+P), workspace search and reorganized menus preserving existing commands.
- Welcome tab with New C file, Open folder, Recent files, Turbo C examples and Learn DSA visually.
- Real document, Git and compiler status; optional CPU/RAM display.

### Fixed

- **B1:** Right-side tools no longer squeeze the editor; code gets at least 60% width at the target resolutions.
- **B2:** Literal ampersands display correctly in tool titles and file tabs.
- **B4:** Removed the duplicate extension-contribution loader.
- **B6:** Real registry tests require an explicit network opt-in; offline tests remain enabled.
- **B7:** Removed unused bindings while preserving graphics calls and public exports; pyflakes is clean.
- **B8:** Child processes stop before widgets are destroyed, preventing late disassembly callbacks.
- **B9:** Unsaved documents have Save/Discard/Cancel protection, including cancelled Save As.

### Coming in this release

- **B3 — terminal: coming in this release.** Placeholder for Nemotron's PTY/ConPTY work on `v2-bugs`. Not implemented or claimed as fixed by this preparation PR. Replace this entry only after merge and platform verification.

### Release gates

- This branch prepares assets only. Nothing has been published or submitted.
- Main and the public Snap listing reported 2.0.1 before this preparation. The requested 2.0.0 target needs version-order review against existing Store packages before submission.
- Windows package build/install/launch/uninstall, strict Snap runtime verification and the cross-platform manual checklist remain pending.
- B5 remains tracked separately in `docs/MEDHA-v2-PLAN.md`.
59 changes: 51 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,32 @@

# MEDHĀ IDE

**Native PySide6 offline IDE for C/C++/Python — editor, real compiler runs, terminal, problems panel, LSP (clangd/pylsp), GDB/debugpy debugger, Git, CMake build, local Ollama AI panel, Open VSX extensions (themes/snippets/grammar subset).**
**Offline C, C++, Java and Python IDE with a VS Code-style workbench, visual learning tools and Turbo C compatibility.**

![Medhā 2.0 workbench with editor and minimap](store/screenshots-v2/02-editor-minimap.png)

The 2.0.0 workbench release is being prepared here; Store links install the
currently published package. See [CHANGELOG](CHANGELOG.md) for release status.

[Get MEDHĀ IDE from Microsoft Store](https://apps.microsoft.com/detail/9ndcdm1mmh5t) ·
[Install from Snap Store](https://snapcraft.io/medha-ide) ·
[View all seven new UI screenshots](store/screenshots-v2/README.md)

## New workbench

- Activity bar, collapsible sidebar and bottom panel; Ctrl+B/Ctrl+J and remembered sizes.
- Medhā Dark and Light themes, syntax highlighting, editor minimap and grey tab-close buttons.
- Command centre and palette (Ctrl+Shift+P), Quick Open (Ctrl+P) and workspace search.
- Welcome tab with New/Open, Recent files, Turbo C examples and Learn DSA visually.
- DSA, memory, disassembly, debug, AI and extension tools remain accessible in the new layout.
- Real document, branch and compiler status; optional CPU/RAM display.
- Save/Discard/Cancel protection for unsaved documents.

---

## What MEDHA Is

MEDHĀ is a **native desktop IDE** written in Python with PySide6 (Qt 6). It is offline-first: everything works without internet except searching/downloading extensions from Open VSX. No Electron, no web views, no bundled browsers. It integrates your system toolchain (gcc, g++, gdb, python3, clangd, pylsp, cmake, git, ollama) into a single window with dockable panels.
MEDHĀ is a **native desktop IDE** written in Python with PySide6 (Qt 6). Editing and local toolchains work offline. Open VSX downloads need internet, and optional AI needs a reachable Ollama service. No Electron, no web views, no bundled browsers. It integrates your system toolchain (gcc, g++, gdb, python3, clangd, pylsp, cmake, git, ollama) into one editor-first workbench.

**Not a web app.** The `legacy/` folder (archived) was a React/Vite/Monaco prototype — it is not MEDHA.

Expand Down Expand Up @@ -41,9 +60,30 @@ MEDHĀ is a **native desktop IDE** written in Python with PySide6 (Qt 6). It is

## Install

### Windows

Install [MEDHĀ IDE from Microsoft Store](https://apps.microsoft.com/detail/9ndcdm1mmh5t).
The packaged app includes offline GCC/G++, Java and Python toolchains.

### Linux (Snap)

Use the [Snap Store listing](https://snapcraft.io/medha-ide), or:

```sh
sudo snap install medha-ide
# Optional: allow projects on removable drives
sudo snap connect medha-ide:removable-media
```

The strict Snap includes compilers but does not support GDB/ptrace or direct use
of host-installed tools. Git, CMake, cppcheck and external language servers are
not bundled in this Snap. Source builds can use installed system tools.

### From source

```bash
# 1. Clone and enter
git clone <this-repo> medha-ide
git clone https://github.com/Kanak234/medha-ide.git
cd medha-ide

# 2. Create venv and install deps
Expand All @@ -70,8 +110,10 @@ python3 -m venv .venv
## Run Tests & Validators

```bash
# Unit tests
.venv/bin/python -m pytest tests -q
# Offline unit tests (real network tests require MEDHA_NETWORK_TESTS=1)
QT_QPA_PLATFORM=offscreen .venv/bin/python -m pytest -q
.venv/bin/python -m pyflakes medha
QT_QPA_PLATFORM=offscreen .venv/bin/python -m pytest tests/test_ui_smoke.py -q

# Adversarial validator (Phases 1-2): window, runner, terminal, diagnostics
.venv/bin/python verify_medha.py
Expand All @@ -92,15 +134,16 @@ python3 -m venv .venv
- **No VS Code JavaScript extensions** — only Open VSX extensions that are pure data (themes, snippets, TextMate grammars). Node.js-based extensions (language servers, debuggers, formatters) cannot run.
- **LSP requires external binaries** — `clangd` for C/C++, `pylsp` for Python. Install them separately; MEDHA will auto-detect if on PATH.
- **Debugpy for Python** — install via `pip install debugpy` (or `--break-system-packages`).
- **No bundled compilers/runtimes** — uses your system `gcc`, `g++`, `python3`, `cmake`, `git`.
- **Linux-first** — Wayland/X11 via Qt. Windows/macOS untested.
- **Tool availability depends on the package** — Store/Snap builds bundle compilers; source builds use configured or system tools. The strict Snap restrictions are listed above.
- **Release preparation** — these new screenshots were captured on Linux; Windows 2.0.0 build/install/launch/uninstall acceptance remains pending.
- **Interactive terminal (B3)** — PTY/ConPTY improvements are coming in this release on `v2-bugs`; they are not yet part of this preparation branch.
- **No web browser, no Monaco, no LibreOffice, no VLC, no game engine** — those were in the archived `legacy/` prototype.

---

## Logo

The logo mark (`medha/assets/logo-mark.svg`) is shown above. If you don't see it, the file may be at `video-editor/logo-mark.svg` in the parent workspace.
The logo mark is in [`docs/assets/logo-mark.svg`](docs/assets/logo-mark.svg).

---

Expand Down
11 changes: 6 additions & 5 deletions build_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import shutil
import subprocess
from pathlib import Path
from medha import __version__ as VERSION

ROOT = Path(__file__).resolve().parent
RELEASE = ROOT / "release"
Expand Down Expand Up @@ -42,7 +43,7 @@ def main():

# Step 2: Build Debian Package (.deb)
print("[2/4] Constructing Debian Package (.deb)...")
deb_dir = BUILD_DIR / "deb" / "medha-ide_1.1.0_amd64"
deb_dir = BUILD_DIR / "deb" / f"medha-ide_{VERSION}_amd64"
deb_bin = deb_dir / "usr" / "bin"
deb_lib = deb_dir / "usr" / "lib" / "medha-ide"
deb_apps = deb_dir / "usr" / "share" / "applications"
Expand Down Expand Up @@ -103,8 +104,8 @@ def main():
# System tools (gcc, g++, gdb, git, cmake, make) are required at runtime for
# the IDE's core functionality (compilation, debugging, Git, CMake).
control = deb_control / "control"
control.write_text("""Package: medha-ide
Version: 1.1.0
control.write_text(f"""Package: medha-ide
Version: {VERSION}
Architecture: amd64
Maintainer: Kanak Prabhakar <kanakprabhakar72@gmail.com>
Depends: gcc, g++, gdb, git, cmake, make, libc6 (>= 2.34), libstdc++6 (>= 12), libgcc-s1 (>= 12)
Expand All @@ -117,7 +118,7 @@ def main():
""")

# Build .deb
deb_path = RELEASE / "medha-ide_1.1.0_amd64.deb"
deb_path = RELEASE / f"medha-ide_{VERSION}_amd64.deb"
r = subprocess.run(["dpkg-deb", "--build", str(deb_dir), str(deb_path)], capture_output=True, text=True)
if r.returncode == 0:
print(f"Debian package created successfully: {deb_path} ({deb_path.stat().st_size} bytes)")
Expand All @@ -137,7 +138,7 @@ def main():

shutil.copy(desktop, appdir / "medha-ide.desktop")

appimage_path = RELEASE / "MEDHA_IDE-1.1.0-x86_64.AppImage"
appimage_path = RELEASE / f"MEDHA_IDE-{VERSION}-x86_64.AppImage"
# Create self-extracting / executable AppImage wrapper
tar_cmd = ["tar", "-czf", str(appimage_path), "-C", str(appdir), "."]
subprocess.run(tar_cmd, check=True)
Expand Down
54 changes: 54 additions & 0 deletions docs/V2-RELEASE-PREP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 2.0.0 release preparation — 2026-11-05

Prepared on `v2-release` from main `94824a6` (merged Track A, PR #7).
This is preparation only: no package upload, Store submission, tag, release,
Snap promotion or publishing workflow was performed.

## Prepared assets

- App/About, AppStream, Windows manifest/EXE version metadata and Linux package
builders use 2.0.0 (MSIX: 2.0.0.0). Snap derives the app version via adopt-info.
- [Changelog](../CHANGELOG.md) includes B1/B2/B4/B6/B7/B8/B9 and the requested
B3 “coming in this release” placeholder.
- [Partner Center copy](../store/listing.md) contains 633 characters between
WHATS_NEW markers, including newlines; paste those bullets verbatim.
- [Seven screenshots](../store/screenshots-v2/README.md) are native 1920×1080,
generated with `QT_QPA_PLATFORM=offscreen python tools/capture_v2.py --store`.
Scene evidence accompanies the images. README uses the new UI and official
[Microsoft Store](https://apps.microsoft.com/detail/9ndcdm1mmh5t) and
[Snap](https://snapcraft.io/medha-ide) links.

## Offline validation

Linux source checkout, Python virtual environment, Qt offscreen platform,
isolated XDG settings/data directories and default network opt-out:

| Command | Result |
|---|---|
| `python -m pytest -q` | 110 passed, 1 skipped (explicit network opt-in) |
| `python -m pyflakes medha` | Passed, no diagnostics |
| `QT_QPA_PLATFORM=offscreen python -m pytest tests/test_ui_smoke.py -q` | 20 passed |
| `python -m pyflakes tools/capture_v2.py tools/store_scenes.py build_packages.py tests/test_release_metadata.py` | Passed, no diagnostics |
| `git diff --check` | Passed |

New release tests verify package-version agreement, About version, Store-copy
length and screenshot dimensions. Capture validation exercised real GDB, Python
DSA tracing and a compiled Turbo C graphics example; every screenshot was
visually inspected. These checks do not establish Windows package acceptance.

## Remaining release gates

- Resolve version ordering before submission: the base app and public Snap
listing already reported 2.0.1. This branch follows the requested 2.0.0 target;
compatibility with previously uploaded Windows versions is not established.
- Merge and validate B3 from `v2-bugs`, then replace its changelog placeholder.
B5 remains separately tracked in the plan.
- Build the MSIX on Windows using the existing packaging script, and verify
install, launch, uninstall and the plan's Windows/Ubuntu manual checklist.
Build and validate the strict Snap, including its documented debugger limits.
- Verify screenshots against the Windows package before Store submission.
- Publishing requires a separate instruction. The existing Windows workflow
can create a GitHub Release even when manually dispatched, so it was not run.

`medha/terminal.py`, `tests/conftest.py`, runner/project-manager/toolchain/debugger/
Turbo tests, licenses, privacy policy and signing/certificate files are unchanged.
2 changes: 1 addition & 1 deletion medha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
if not IS_WINDOWS:
extend_path([os.path.expanduser("~/.local/bin")])

__version__ = "2.0.1"
__version__ = "2.0.0"
2 changes: 1 addition & 1 deletion medha/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ def show_about_dialog(self):
from medha import __version__
from medha import toolchains
box = QMessageBox(self)
box.setWindowTitle("About MEDHĀ IDE")
box.setWindowTitle(f"About MEDHĀ IDE {__version__}")
# Kanak's KP orbit logo (docs/assets/logo-mark.svg) is the watermark of every project
logo = os.path.join(str(platform_info.app_root()), "docs", "assets", "logo-mark.svg")
if os.path.exists(logo):
Expand Down
12 changes: 12 additions & 0 deletions packaging/io.github.Kanak234.Medha.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
<content_attribute id="sex-themes">none</content_attribute>
</content_rating>
<releases>
<release version="2.0.0" date="2026-11-05" type="development">
<description>
<p>Release preparation: new VS Code-style workbench and safer editing.</p>
<ul>
<li>Activity bar, collapsible sidebar and panel with more space for code</li>
<li>Medhā Dark and Light themes, editor minimap and Welcome tab</li>
<li>Command centre, searchable commands and Quick Open</li>
<li>Correct ampersand titles and Save/Discard/Cancel protection</li>
<li>Offline test defaults, clean lint and safer process shutdown</li>
</ul>
</description>
</release>
<release version="1.1.0" date="2026-10-21">
<description>
<p>First public release for Snap Store.</p>
Expand Down
4 changes: 2 additions & 2 deletions packaging/windows/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
MEDHĀ IDE — MSIX manifest (Microsoft Store, free Individual developer account).
WHAT: describes the packaged Win32 app (MEDHA.exe) to Windows and the Store.
Identity values copied from Partner Center → Product identity (23 Oct 2026).
They are public (every installed MSIX shows them), so they live in the repo. build_msix.ps1 replaces __VERSION__.
They are public (every installed MSIX shows them), so they live in the repo. build_msix.ps1 synchronizes Identity.Version from medha/__init__.py.
runFullTrust: required for a classic desktop (Win32) app; nothing else is requested.
-->
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
Expand All @@ -12,7 +12,7 @@
IgnorableNamespaces="uap rescap">
<Identity Name="KanakPrabhakar.MEDHIDE"
Publisher="CN=D47E0796-ADF8-4726-BE39-DCBB2D6B664D"
Version="__VERSION__"
Version="2.0.0.0"
ProcessorArchitecture="x64" />
<Properties>
<DisplayName>MEDHĀ IDE</DisplayName>
Expand Down
5 changes: 4 additions & 1 deletion packaging/windows/build_msix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ if (-not $gui.WaitForExit(120000)) { $gui.Kill(); throw "GUI startup timed out"
if ($gui.ExitCode -ne 0 -or -not (Test-Path $env:MEDHA_SMOKE_RESULT)) { throw "GUI startup failed (exit $($gui.ExitCode))" }
if ((Get-Content $env:MEDHA_SMOKE_RESULT -Raw | ConvertFrom-Json).status -ne "PASS") { throw "GUI smoke test failed" }
Copy-Item -Recurse dist\MEDHA "$layout\MEDHA"
(Get-Content packaging\windows\AppxManifest.xml -Raw).Replace("__VERSION__", $msixVer) | Set-Content "$layout\AppxManifest.xml" -Encoding utf8
# Keep the checked-in release version readable, while future builds derive it from the app.
[xml]$manifest = Get-Content packaging\windows\AppxManifest.xml -Raw
$manifest.Package.Identity.Version = $msixVer
$manifest.Save("$layout\AppxManifest.xml")
# MSIX rejects some file names (makeappx error 0x8007007b). Drop NSIS/7z leftovers
# whose names start with '$', then report any remaining name outside the safe set.
# '[' and ']' are not allowed in MSIX/OPC part names — 7-Zip leaves "[NSIS].nsi"
Expand Down
23 changes: 22 additions & 1 deletion packaging/windows/medha_windows.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,29 @@
# WHY one-folder (not one-file): MSIX installs a folder anyway, and one-file
# re-extracts ~1 GB of compilers to %TEMP% on every start.
# FLOW: build_msix.ps1 → pyinstaller medha_windows.spec → dist/MEDHA/MEDHA.exe
import ast
import os
from PyInstaller.utils.win32.versioninfo import VSVersionInfo, FixedFileInfo, StringFileInfo, StringTable, StringStruct, VarFileInfo, VarStruct
ROOT = os.path.abspath(os.path.join(SPECPATH, "..", ".."))
# Read the package version without importing GUI code during the Windows build.
with open(os.path.join(ROOT, "medha", "__init__.py"), encoding="utf-8") as source:
version_tree = ast.parse(source.read())
VERSION = next(ast.literal_eval(node.value) for node in version_tree.body
if isinstance(node, ast.Assign) and any(isinstance(target, ast.Name)
and target.id == "__version__" for target in node.targets))
version_tuple = tuple(int(part) for part in VERSION.split(".")) + (0,)
version_info = VSVersionInfo(
ffi=FixedFileInfo(filevers=version_tuple, prodvers=version_tuple, mask=0x3f,
flags=0, OS=0x40004, fileType=1, subtype=0, date=(0, 0)),
kids=[StringFileInfo([StringTable('040904B0', [
StringStruct('CompanyName', 'Kanak Prabhakar'),
StringStruct('FileDescription', 'MEDHĀ IDE'),
StringStruct('FileVersion', VERSION),
StringStruct('ProductName', 'MEDHĀ IDE'),
StringStruct('ProductVersion', VERSION),
StringStruct('OriginalFilename', 'MEDHA.exe'),
])]), VarFileInfo([VarStruct('Translation', [1033, 1200])])])
# Explorer's Details tab and MSIX now agree with About on the release version.
datas = [(os.path.join(ROOT, "medha", "workbench.qss"), "medha"),
(os.path.join(ROOT, "medha", "turbo", "runtime"), "medha/turbo/runtime"),
(os.path.join(ROOT, "medha", "turbo", "modernize_explanations.json"), "medha/turbo"),
Expand All @@ -16,6 +37,6 @@ if os.path.isdir(os.path.join(ROOT, "toolchains")):
a = Analysis([os.path.join(ROOT, "packaging", "windows", "medha_entry.py")], pathex=[ROOT], datas=datas,
hiddenimports=["medha.app", "PySide6.QtSvg"], excludes=["tkinter"])
pyz = PYZ(a.pure)
exe = EXE(pyz, a.scripts, [], exclude_binaries=True, name="MEDHA", console=False,
exe = EXE(pyz, a.scripts, [], exclude_binaries=True, name="MEDHA", console=False, version=version_info,
icon=os.path.join(ROOT, "packaging", "windows", "medha.ico") if os.path.exists(os.path.join(ROOT, "packaging", "windows", "medha.ico")) else None)
coll = COLLECT(exe, a.binaries, a.datas, name="MEDHA")
7 changes: 5 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ summary: Offline IDE for C, C++, Java, Python and Turbo C graphics.h
description: |
MEDHA is a native desktop IDE (Python + PySide6/Qt 6) with bundled GCC/G++,
Eclipse Temurin JDK 25 and Python for offline C, C++, Java and Python programs.
- VS Code-style workbench, dark/light themes and editor minimap
- Command centre, Quick Open and Welcome with recent files
- Multi-tab editor with syntax highlighting and symbol outline
- Compile and run with a Problems panel and integrated terminal
- Turbo C mode: graphics.h/conio.h in a 640x480 panel
Expand All @@ -38,7 +40,7 @@ icon: snap/gui/io.github.Kanak234.Medha.png
base: core24
confinement: strict
grade: stable
# WHY: version comes from medha/__init__.py so the snap and the app never disagree.
# Release preparation: 2.0.0. Version comes from medha/__init__.py.
adopt-info: medha-app

# WHY: amd64 only for the first release (smaller risk, faster build). Add arm64 later.
Expand Down Expand Up @@ -118,7 +120,8 @@ parts:
craftctl default
# WHERE: read __version__ = "x.y.z" from medha/__init__.py -> snap version
VERSION=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' medha/__init__.py)
craftctl set version="${VERSION:-1.1.0}"
: "${VERSION:?Missing app version}"
craftctl set version="$VERSION"

launcher:
plugin: dump
Expand Down
Loading