meshmonitor icon indicating copy to clipboard operation
meshmonitor copied to clipboard

[FEAT] scope-override and conversation-toolbar in one horizontal line

Open cyfra80 opened this issue 3 months ago • 1 comments

I'd like to make a visual correction to the "scope" and "conversation" buttons.

Currently, there are three div blocks in the "meshcore-main-pane," one below the other:

  1. "mc-scope-override"
  2. "meshcore-conversation-toolbar"
  3. "meshcore-message-stream"

I would like to have two div blocks "mc-scope-override" and "meshcore-conversation-toolbar" moved into one div block with the setting "display: flex; flex-direction: row; justify-content: space-between".

Currently, these buttons are justified, one on the left and one on the right, and it looks strange that they're not on the same horizontal line.

This change will improve the aesthetics and increase the message area, especially on the phone screen.

cyfra80 avatar Aug 23 '26 14:08 cyfra80

Triage

Not a duplicate — checked existing open/closed issues (nearest related: #4473, mobile nav unification, and #3981, which introduced the conversation toolbar; neither covers this specific layout).

Classification: Feature Request (UI polish). Aligned with the project's ongoing mobile-UX cleanup direction (see #4473, and the CSS-containment/mobile-@media guidance in CLAUDE.md), and the change is small and well-specified. Posting a plan per our feature-request process — no code changes yet.

Where this lives

Both elements are siblings inside meshcore-main-pane, but only in src/components/MeshCore/MeshCoreChannelsView.tsx (lines ~697–767). The DM view (MeshCoreDirectMessagesView.tsx) renders meshcore-conversation-toolbar too, but has no scope-override control (region scoping is a channel/flood concept, not applicable to DMs), so this is a channels-view-only change.

  • mc-scope-override (MeshCoreChannelsView.tsx:698, styled MeshCorePage.css:1716): rendered when canSend && connected. Two states — a compact toggle button, or an expanded row (label + text input + "Unscoped" button + close button) once the operator opens it.
  • meshcore-conversation-toolbar (MeshCoreChannelsView.tsx:757, styled MeshCorePage.css:697): rendered when canSend && filtered.length > 0. Currently right-aligned via justify-content: flex-end on its own line.

Plan

  1. JSX — wrap both existing <div>s in a new container, e.g. <div className="meshcore-toolbar-row">, rendered only when at least one of the two conditions is true ((canSend && connected) || (canSend && filtered.length > 0)), so the row collapses entirely when neither is shown. Keep each inner div's own conditional as-is.
  2. CSS (MeshCorePage.css):
    • Add .meshcore-toolbar-row { display: flex; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.35rem 0.75rem 0; } and drop the now-redundant padding from .mc-scope-override and .meshcore-conversation-toolbar.
    • .meshcore-conversation-toolbar currently uses justify-content: flex-end to right-align itself when it's the only row present. Inside the new flex row that no longer applies (a lone flex child sits at the start under space-between), so give it margin-left: auto instead — that keeps it right-aligned whether the scope control is showing or not.
    • When the scope-override row is expanded (label + input + two buttons), it's wide — add flex-wrap: wrap on the container (above) so the "Clear channel messages" button drops to its own line on narrow/phone widths rather than overflowing, and give .mc-scope-override-row (or the row wrapper) flex: 1 1 auto; min-width: 0 so the text input can still shrink.
  3. Verify manually at phone width (existing mobile breakpoints in MeshCorePage.css) with the scope override both collapsed and expanded, and with 0 vs >0 messages in the channel (toolbar hidden vs shown), to confirm no overlap/overflow.
  4. No test coverage currently asserts on this DOM structure (checked MeshCoreChannelsView specs); a lightweight snapshot/class-presence assertion could be added if desired, but isn't required for a pure layout change.

This is scoped to two files (MeshCoreChannelsView.tsx, MeshCorePage.css), no backend/protocol/state changes, so no mesh-impact concerns apply.

Holding here per our process for feature requests — let me know if this looks right and I'll pick it up.

-- Authored by Roger 🤓


Generated by Claude Code

Yeraze avatar Aug 23 '26 14:08 Yeraze