Step 187: in-editor help panel
This commit is contained in:
@@ -534,4 +534,5 @@ Sprint 5 in progress. Step 141 (Emacs daemon with user config) done. Next: Step
|
||||
| 2026-02-10 | Codex | Step 184: First-run wizard (layout/theme/keybindings + get-started actions) wired on missing session. 2/2 tests pass (step184_test, step184_integration_test). |
|
||||
| 2026-02-10 | Codex | Step 185: Contextual feature hints with persistence + dismiss/disable. 2/2 tests pass (step185_test, step185_integration_test). |
|
||||
| 2026-02-10 | Codex | Step 186: Keyboard shortcut reference panel with filter and live bindings. 2/2 tests pass (step186_test, step186_integration_test). |
|
||||
| 2026-02-10 | Codex | Step 187: In-editor help panel window wired from menu with Markdown renderer reuse. 2/2 tests pass (step187_test, step187_integration_test). |
|
||||
| 2026-02-10 | Codex | Step 166: Extract main.cpp into panel headers marked complete (already implemented). step166_test passes; file_limits_test 4/4 passes. |
|
||||
|
||||
@@ -1093,6 +1093,13 @@ add_executable(step186_integration_test tests/step186_integration_test.cpp)
|
||||
target_include_directories(step186_integration_test PRIVATE src)
|
||||
target_link_libraries(step186_integration_test PRIVATE nlohmann_json::nlohmann_json)
|
||||
|
||||
add_executable(step187_test tests/step187_test.cpp)
|
||||
target_include_directories(step187_test PRIVATE src)
|
||||
|
||||
add_executable(step187_integration_test tests/step187_integration_test.cpp)
|
||||
target_include_directories(step187_integration_test PRIVATE src)
|
||||
target_link_libraries(step187_integration_test PRIVATE nlohmann_json::nlohmann_json)
|
||||
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(glad CONFIG REQUIRED)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "panels/EditorPanel.h"
|
||||
#include "panels/BottomPanel.h"
|
||||
#include "panels/StatusBarPanel.h"
|
||||
#include "panels/HelpPanelWindow.h"
|
||||
|
||||
static std::string emacsChordForEvent(SDL_Keycode sym, Uint16 mods) {
|
||||
std::string base;
|
||||
@@ -383,6 +384,7 @@ int main(int, char**) {
|
||||
renderFeatureHintBar(state.featureHints, state.workspaceRoot);
|
||||
static ShortcutReferenceState shortcutPanel;
|
||||
renderShortcutReference(state, shortcutPanel);
|
||||
renderHelpPanelWindow(state);
|
||||
state.notifications.renderHistoryWindow([&](const Notification& note) {
|
||||
if (note.hasTarget) state.navigateToTarget(note.target);
|
||||
});
|
||||
|
||||
12
editor/src/panels/HelpPanelWindow.h
Normal file
12
editor/src/panels/HelpPanelWindow.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "../EditorState.h"
|
||||
|
||||
static void renderHelpPanelWindow(EditorState& state) {
|
||||
if (!state.ui.showHelpPanel) return;
|
||||
ImGui::Begin("Documentation", &state.ui.showHelpPanel);
|
||||
ImGui::PushFont(state.uiFont);
|
||||
renderHelpPanel(state.helpPanel, state.workspaceRoot, state.monoFont);
|
||||
ImGui::PopFont();
|
||||
ImGui::End();
|
||||
}
|
||||
@@ -210,6 +210,10 @@ static void renderMenuBar(EditorState& state) {
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
if (ImGui::BeginMenu("Help")) {
|
||||
ImGui::MenuItem("Documentation", nullptr, &state.ui.showHelpPanel);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
const bool canProject = state.activeAST() != nullptr;
|
||||
ImGui::SameLine();
|
||||
|
||||
@@ -11,6 +11,7 @@ struct UIFlags {
|
||||
bool showSettingsPanel = false;
|
||||
bool showFirstRunWizard = false;
|
||||
bool showShortcutReference = false;
|
||||
bool showHelpPanel = false;
|
||||
int bottomTab = 0; // 0=Output,1=AST,2=Highlighted
|
||||
LayoutPreset layoutPreset = LayoutPreset::VSCode;
|
||||
};
|
||||
|
||||
14
editor/tests/step187_integration_test.cpp
Normal file
14
editor/tests/step187_integration_test.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
// Step 187: Help panel flag integration checks.
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "state/UIFlags.h"
|
||||
|
||||
int main() {
|
||||
UIFlags flags;
|
||||
flags.showHelpPanel = true;
|
||||
assert(flags.showHelpPanel == true);
|
||||
|
||||
printf("step187_integration_test: all assertions passed\n");
|
||||
return 0;
|
||||
}
|
||||
25
editor/tests/step187_test.cpp
Normal file
25
editor/tests/step187_test.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Step 187: In-editor help panel checks.
|
||||
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
static std::string readFile(const std::string& path) {
|
||||
std::ifstream f(path);
|
||||
if (!f.is_open()) return {};
|
||||
return std::string((std::istreambuf_iterator<char>(f)),
|
||||
std::istreambuf_iterator<char>());
|
||||
}
|
||||
|
||||
static void assertContains(const std::string& text, const std::string& needle) {
|
||||
assert(text.find(needle) != std::string::npos);
|
||||
}
|
||||
|
||||
int main() {
|
||||
const std::string help = readFile("src/panels/HelpPanelWindow.h");
|
||||
assertContains(help, "Documentation");
|
||||
assertContains(help, "renderHelpPanel");
|
||||
|
||||
printf("step187_test: all assertions passed\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -272,7 +272,7 @@ without being annoying.
|
||||
- Export to printable HTML/PDF
|
||||
*New:* `ShortcutReference.h`
|
||||
|
||||
- [ ] **Step 187: In-editor help system**
|
||||
- [x] **Step 187: In-editor help system**
|
||||
Help > Documentation opens a dockable panel:
|
||||
- Searchable documentation browser
|
||||
- Sections: Getting Started, Annotation Reference, Language Support,
|
||||
|
||||
Reference in New Issue
Block a user