Conversation
0a21f64 to
2573b0b
Compare
c652c83 to
96e791e
Compare
|
CI note: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #549 +/- ##
==========================================
+ Coverage 25.06% 27.11% +2.05%
==========================================
Files 528 557 +29
Lines 44259 45812 +1553
Branches 4794 4876 +82
==========================================
+ Hits 11092 12421 +1329
- Misses 33167 33391 +224 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3e67bdf to
20a2434
Compare
7f2f574 to
7617d22
Compare
c5aeda5 to
d82e6c4
Compare
Splits the logic that does not need QWidget out of several UI classes so it can be unit tested on its own and has a single owner, following the layout the group/, timers/ and adventure/ directories already use: domain logic, an optional Qt item model, and a thin view. The Widgets UI is unchanged in behavior and now sits on top of these pieces. Map canvas - MapCanvas is the rendering/input logic (a QObject); MapCanvasWindow is the QOpenGLWindow that hosts it through the MapCanvasHost interface (repaint scheduling, size, device pixel ratio, cursor). - MapScroller: MapWindow's scroll math and continuous-scroll timer. Main window - ProxyHost: the interface Proxy/ConnectionListener use to reach the object that owns them; MainWindow implements it. - MapLoadHelper: map format detection and loading, in mapstorage/. Models backing the widget panels/dialogs - TimerModel roles (TimerWidget), RoomModel (RoomWidget), GroupModel (GroupWidget, which also reads its anyMana state for the mana column), AdventureLogModel (AdventureWidget is a QTextEdit view of it). - UpdateChecker (UpdateDialog), ClockStrings (MumeClockWidget), InputHistory/TabHistory (InputWidget), RemoteEditDocumentOps and RemoteEditHighlighter (RemoteEditWidget), StackBlur (DescriptionWidget), AnsiColorTables (AnsiCombo), AnsiHtml's AnsiTextToDocument (DisplayWidget). Small windows - CompactLayout.h holds the policy (720x480 breakpoint, the client's 55% share of the height). - A screen below that size starts MainWindow in the compact layout; Window > "Compact Layout" toggles it by hand (it does not follow resizes, since flipping the whole window layout under the user is worse than a briefly cramped one). While compact the menu bar is hidden and a row of large buttons in the status bar holds a "\u2630" button with the top-level menus as submenus (the QMenu objects are shared), layer up/down and center-on-player (operations touch has no wheel or keyboard for; zoom is a pinch); every dock is tabified into one group below the map so one panel shows at a time (the client tab in front), the toolbars are hidden, and the map's scroll bars are suppressed (drag pans); dock title bars are replaced by the tab strip, which uses a larger font so the tabs are finger-sized. The startup choice is judged by the screen (CompactLayout::probeSize()), since the expanded layout's minimum size can push the window past a phone's edge, and the window is pulled back onto the screen once the compact minimums apply. The expanded and compact layouts each persist their own window state (Window State / Window State Compact), so switching never overwrites the other; switching is gated until the first show has restored settings. - ClientWidget reports the configured 80x24 terminal size as its sizeHint() rather than its minimum, so the main window can shrink in the first place; the default expanded layout (first run, "Reset Window Layout") still sizes the client dock to it when the window has room for that and the map. - Kinetic scrolling (QScroller) on every panel's scroll area: from touch events when expanded, and from the (synthesized) left button while compact, since a browser can deliver a finger as pointer events rather than touch events; a held press still selects text. Touch - Map (all in MapCanvas, so any host forwarding events gets them): a long-press opens the context menu (and the finger's release is then ignored, so it does not double as a tap); a flick after a touch drag keeps the view moving with decaying velocity; two fingers pan while pinching; a tap on a room does not raise the hover tooltip. - When neither the menu bar nor the compact layout's status-bar menu button is on screen, the map's context menu offers a "Menu" submenu holding the top-level menus, so a touch user can always reach them by a long-press (there is no hover to "peek" a hidden menu bar with). - View > "Center on Player" action (also in the compact button row). - Menus follow the usual cross-platform layout: Edit starts with Undo/Redo and keeps the object submenus (Markers, Rooms, Connections) and Find Rooms; View holds the map view (a "Mouse Mode" submenu with every mode, zoom, layers, center, rebuild meshes); a new "Window" menu takes Toolbars, Side Panels and the status bar / scroll bars / menu bar / always-on-top toggles, plus "Compact Layout" and "Reset Window Layout" (the constructor's arrangement for the expanded layout, the default tabbed group for the compact one); Tools takes Mode (Play/Map/Offline) and Preferences. Quit, Preferences, About and Check for Update carry QAction menu roles so macOS places them in the application menu regardless of wording. - Client: in the compact layout, Up/Down/Tab buttons beside the input drive command history and completion; a long-press on the output opens its standard context menu (copy, select all). - Select Rooms mode on touch: a tap on a room that is not yet selected adds it (a drag from there rubber-bands additively), like Ctrl+click, since touch has no Ctrl; a selected room still moves and empty space still clears. Mouse input is unchanged. Input - Input-method hints on the client input (no auto-capitalization or prediction) and the password fields (additionally ImhSensitiveData), so on-screen keyboards behave for MUD commands and credentials. Dialogs - Dialogs whose preferred size does not fit the screen open maximized (mmqt::showFittedToScreen()); while compact the Preferences dialog stacks its page list above the pages, can shrink below the pages' natural width (they scroll), and its pages and page list scroll by touch. Graphics - "Render scale" (Graphics page; Configuration::canvas.renderScale, default 100%): the map's offscreen framebuffer is rendered at 50/75/100% of the display resolution and presented at full size, cutting its GPU memory for tablets. Legacy::Functions distinguishes the render-target pixel ratio (glyph atlases, line widths, the FBO) from the host's ratio (the present viewport). MSAA is off below 100% since it multiplies the same memory. - wasm: the performance overlay shows the wasm heap and the FBO's footprint. Preferences - General page: "UI font scale" spin box for Configuration::general .uiFontScale (applied at startup). - Game Client page (was "Integrated Client"): "How do you play?" -- ask each time / play in MMapper / use my own MUD client (Configuration::general.gameClient; the web build has only the built-in client). First run and the Client Panel - The Client Panel's welcome page is a card: "Play MUME", "Play music and sound effects", "Play in MMapper", "I use my own MUD client" with the port to point it at, "Don't ask again" (writes the preference above for the button pressed), and a link to docs.mume.org/newcomers. With the preference set the panel connects at once or shows "Waiting for your MUD client on localhost, port N" with a "Play here instead" button. Tools > "Play MUME" connects the built-in client; Help gets a "Newcomer's Guide". - Sound is off for new profiles (volumes default to 0) and is turned on from the card or Preferences > Audio; the "Enable game audio?" bar over the map is gone. On the web build, where the browser needs a user gesture before audio may play, the first key press or tap anywhere unlocks it. - Client output on touch: a finger scrolls (fed to the viewport's QScroller from DisplayWidget's own mouse handlers, since touch is delivered as synthesized mouse events) and never selects; the long-press context menu offers Copy / Select All. The peek preview pane is not used while compact. - Wording: "Integrated mud client" is gone from menus and the panel. Fixes - MapCanvas takes its MapCanvasHost by reference in the constructor (like FrameManager takes its window) instead of a QObject parent plus setHost(): the parent's ChildAdded event reached MapCanvasWindow::event() before the member was constructed (UBSan). Tests - New TestClient (InputHistory/TabHistory, RemoteEditDocumentOps) and TestMedia (StackBlur); TestMainWindow covers MapScroller and the CompactLayout policy; TestCTimers, TestGroup, TestAdventure, TestRoomManager, and TestClock cover the new models and helpers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFncyBYH55KbWPdvzvxXQw
d82e6c4 to
2f43316
Compare
Summary
Splits the logic that does not need
QWidgetout of several UI classes so it can be unit tested on its own and has a single owner, following the layoutgroup/,timers/andadventure/already use: domain logic → optional Qt item model → thin view. The Widgets UI is unchanged in behavior and now sits on top of these pieces. Plus small-window/touch support, a few fixes, and a CI change.Map canvas
MapCanvasis the rendering/input logic (aQObject);MapCanvasWindowis theQOpenGLWindowthat hosts it through theMapCanvasHostinterface (repaint scheduling, size, device pixel ratio, cursor).MapScroller:MapWindow's scroll math and continuous-scroll timer.Main window
ProxyHost: the interfaceProxy/ConnectionListeneruse to reach the object that owns them;MainWindowimplements it.MapLoadHelper: map format detection and loading, inmapstorage/.Models backing the widget panels/dialogs
TimerModelroles (TimerWidget),RoomModel(RoomWidget),GroupModel(GroupWidget, which also reads itsanyManastate for the mana column),AdventureLogModel(AdventureWidgetis aQTextEditview of it).UpdateChecker(UpdateDialog),ClockStrings(MumeClockWidget),InputHistory/TabHistory(InputWidget),RemoteEditDocumentOpsandRemoteEditHighlighter(RemoteEditWidget),StackBlur(DescriptionWidget),AnsiColorTables(AnsiCombo),AnsiHtml'sAnsiTextToDocument(DisplayWidget).Small windows
CompactLayout.hholds the policy (720×480 breakpoint, the client's 55% share of the height).MainWindowin the compact layout; Window → "Compact Layout" toggles it by hand (it does not follow resizes, since flipping the whole window layout under the user is worse than a briefly cramped one). While compact the menu bar is hidden and a row of large buttons in the status bar holds a ☰ button with the top-level menus as submenus (theQMenuobjects are shared), layer ▲/▼ and center-on-player (operations touch has no wheel or keyboard for; zoom is a pinch); every dock is tabified into one group below the map so one panel shows at a time (the client tab in front), the toolbars are hidden, and the map's scroll bars are suppressed (drag pans); dock title bars are replaced by the tab strip, which uses a larger font so the tabs are finger-sized. The startup choice is judged by the screen (CompactLayout::probeSize()), since the expanded layout's minimum size can push the window past a phone's edge, and the window is pulled back onto the screen once the compact minimums apply. The expanded and compact layouts each persist their own window state (Window State/Window State Compact), so switching never overwrites the other; switching is gated until the first show has restored settings.ClientWidgetreports the configured 80×24 terminal size as itssizeHint()rather than its minimum, so the main window can shrink in the first place; the default expanded layout (first run, "Reset Window Layout") still sizes the client dock to it when the window has room for that and the map.QScroller) on every panel's scroll area: from touch events when expanded, and from the (synthesized) left button while compact, since a browser can deliver a finger as pointer events rather than touch events; a held press still selects text.Touch
MapCanvas, so any host forwarding events gets them): a long-press opens the context menu (and the finger's release is then ignored, so it does not double as a tap); a flick after a touch drag keeps the view moving with decaying velocity; two fingers pan while pinching; a tap on a room does not raise the hover tooltip.QActionmenu roles so macOS places them in the application menu regardless of wording.Input
ImhSensitiveData), so on-screen keyboards behave for MUD commands and credentials.Dialogs
mmqt::showFittedToScreen()); while compact the Preferences dialog stacks its page list above the pages, can shrink below the pages' natural width (they scroll), and its pages and page list scroll by touch.Graphics / wasm memory
Configuration::canvas.renderScale, default 100%): the map's offscreen framebuffer is rendered at 50/75/100% of the display resolution and presented at full size, cutting its GPU memory for tablets.Legacy::Functionsdistinguishes the render-target pixel ratio (glyph atlases, line widths, the FBO) from the host's ratio (the present viewport). MSAA is off below 100% since it multiplies the same memory.Preferences
Configuration::general.uiFontScale(applied at startup).Configuration::general.gameClient; the web build has only the built-in client).First run and the Client Panel
QScrollerfromDisplayWidget's own mouse handlers, since touch arrives as synthesized mouse events) and never selects; the long-press context menu offers Copy / Select All. The peek preview pane is not used while compact.Fixes
MapCanvastakes itsMapCanvasHostby reference in the constructor (likeFrameManagertakes its window) instead of a QObject parent plussetHost(): the parent'sChildAddedevent reachedMapCanvasWindow::event()before the member was constructed (UBSan).Tests
TestClient(InputHistory/TabHistory,RemoteEditDocumentOps) andTestMedia(StackBlur);TestMainWindowcoversMapScrollerand theCompactLayoutpolicy;TestCTimers,TestGroup,TestAdventure,TestRoomManager, andTestClockcover the new models and helpers.CI
build-appimageinstalls Qt 6.8.3 viainstall-qt-action(like the AppX/macOS/Windows jobs) instead of the KDE Neon apt repo, whose single host was returning 502s.external/qtkeychain's build-from-source fallback is now allowed on Linux so QtKeychain is built against that Qt.Test plan
CHECK_ODR+ ASan/UBSan: 16/16 tests passWITH_AUDIO=OFF🤖 Generated with Claude Code
https://claude.ai/code/session_01QFncyBYH55KbWPdvzvxXQw