Skip to content

refactor(map): split layout.rs into a layout module (#3069) - #3072

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:refactor/3069-split-map-layout
Nov 27, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:refactor/3069-split-map-layout

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

crates/map/src/layout.rs (5,516 lines) is now a module: layout.rs (750 lines) keeps the page (Layout, Element, guides, series) and the helpers several families share, and layout/ holds one file per family (elements, frame, grid, text, legend, lines, north, scale_bar, colorbar, chart, stats) and the existing tests, as they were, in tests.rs. Changes to different layout elements no longer have to edit the same file.

This is a move with no change in behaviour: desktop, browser, CLI, Python, ribbon, assistant, undo and the project format are unchanged. No file outside the module changes.

  • Items move whole. The only edits inside them are private items, fields and inherent methods becoming pub(super), which keeps them visible to the same code as before, and what cargo fmt rewraps after that and after the tests lose one level of indentation.
  • layout.rs re-exports each file with a glob, so every rustgis_map::layout::… and crate::layout::… path stays the same.
  • ElementKind is one enum and moves as one: splitting it by variant would be a refactor.

Review with git diff --color-moved=dimmed-zebra.

The move was generated by the script below, which stops on an item it does not know and checks, before formatting, that every moved segment is byte-identical to the original.

partir_map_layout.py
#!/usr/bin/env python3
"""Split crates/map/src/layout.rs into a `layout` module, moving whole items.

Usage, from the root of a RustGIS checkout whose layout.rs is unsplit:

    python3 -I partir_map_layout.py

An item missing from MAP stops the script: add it to the right list, never move it by hand.
The only edit inside moved code is private items, fields and inherent methods becoming
`pub(super)`; the tests lose one level of indentation (never inside a string literal).
Both edits are undone and compared byte for byte with the original before anything is written.
`cargo fmt` runs last and rewraps the lines whose width the two edits changed.
"""

import re
import subprocess
import sys
from pathlib import Path

SRC = Path("crates/map/src/layout.rs")
DIR = Path("crates/map/src/layout")

ROOT = """PT_PER_MM PAPER_M_PER_PT PAGE_TOKENS MIN_ELEMENT_MM MAX_ID PAGES is_false is_default is_zero INK ink
    white yes finite_or Orientation Arrange Element Background MAX_BACKGROUND_WIDTH MAX_BACKGROUND_RADIUS
    MAX_BACKGROUND_PADDING rotation MapSeries series_page_name margin MAX_GUIDES Guides Layout Instance
    LayoutRepairs"""

MAP = {
    "frame": """FrameShape MIN_FRAME_SCALE MAX_FRAME_SCALE INDICATOR_COLOR INDICATOR_WIDTH MIN_INDICATOR_WIDTH
        MAX_INDICATOR_WIDTH FRAME_BORDER_COLOR FRAME_BORDER_WIDTH MAX_FRAME_BORDER_WIDTH frame_border_color
        is_frame_border_color frame_border_width is_frame_border_width indicator_color is_indicator_color
        indicator_width is_indicator_width frame_camera frame_center_placed fit_scale""",
    "grid": """Grid GridKind MAX_MEASURED_STEP MIN_MEASURED_STEP MAX_GRID_CRS MAX_GRATICULE_STEP utm_epsg
        utm_zone_of MAX_TICK_MM MAX_GRID_WIDTH tick_length grid_width decimal dms GridStyle CoordFormat
        GridEdges""",
    "text": """TextAlign FontFamily is_sans MAX_LETTER_SPACING MIN_LETTER_SPACING is_left TextVAlign is_top
        TextCase is_no_case LINE_SPACING MIN_LINE_SPACING MAX_LINE_SPACING line_spacing is_line_spacing
        line_spacing_in_range de_line_spacing LEGEND_TEXT_PT SCALE_BAR_TEXT_PT GRID_LABEL_PT LAYOUT_TEXT_SIZE
        layout_text_in_range layout_text_scale legend_text_pt is_legend_text_pt scale_bar_text_pt
        is_scale_bar_text_pt grid_label_pt is_grid_label_pt MAX_TEXT_CHARS""",
    "legend": """MAX_LEGEND_EXCLUDED MAX_LEGEND_LABELS MAX_LEGEND_LABEL_CHARS MAX_LEGEND_COLUMNS one_column
        is_one_column""",
    "lines": "LineDir LineHead LINE_BOX_MM line_angle line_length line_at_angle",
    "north": "ArrowStyle",
    "scale_bar": """ScaleUnits ScaleBarStyle MAX_SCALE_DIVISIONS divisions MAX_SCALE_SUBDIVISIONS
        MAX_SCALE_BEFORE_ZERO MAX_SCALE_DECIMALS MAX_UNIT_LABEL_CHARS ScaleLabelPosition UnitLabelPosition
        ScaleBarFit SCALE_DECIMALS_INVALID de_scale_decimals""",
    "colorbar": """TickSide MAX_COLORBAR_TICKS ticks ColorScale MAX_COLORBAR_VALUES RAMP_SAMPLES colorbar_layer
        color_scale""",
    "elements": "ElementKind rows",
    "chart": """CHART_BARS MAX_CHART_BARS chart_bars is_chart_bars ChartOrder MAX_CHART_DECIMALS CHART_BAR
        ChartLook ChartOutline chart_outline_color chart_outline_width CHART_OUTLINE MAX_CHART_OUTLINE_WIDTH
        chart_outline chart_max chart_value_text CHART_BLANK CHART_OTHER ChartData CHART_STACKS Shade
        ValueIndex chart_stack_refusal add_cell stack_bars GroupKey""",
    "stats": """StatToken stat_tokens stat_tokens_and_gaps scan_stat_tokens rename_stat_layers StatMissing
        layer_statistic layer_statistics Tally""",
}

# Files whose items name nothing from the rest of the module.
NEEDS_NOTHING = {"legend"}

HEADERS = {
    "frame": "Map frames: their shape, border, extent indicator, camera and scale.",
    "grid": "A map frame's grid: its kinds, steps, styles and coordinate labels.",
    "text": "Text options: alignment, font, case, spacing and the usual sizes.",
    "legend": "The legend's limits and columns.",
    "lines": "Lines: direction, ends and angle.",
    "north": "The north arrow's look.",
    "scale_bar": "The scale bar's options: units, style, divisions and labels.",
    "colorbar": "The colorbar's ticks and the colour scale it shows.",
    "elements": "The kinds of element a layout holds, and what each one takes.",
    "chart": "The chart element's data: bars, order, look and stacks.",
    "stats": "A layer's statistics in a layout's text: the tokens and their figures.",
}

HEADER_RE = re.compile(
    r"^(?P<vis>pub(?:\([a-z]+\))? )?(?:(?:const|async) (?=fn ))?"
    r"(?P<kind>fn|struct|enum|const|static|type|trait|mod) (?P<name>[A-Za-z_][A-Za-z0-9_]*)"
)
THREAD_LOCAL = "thread_local! {"
IMPL_RE = re.compile(r"^impl(?:<[^>]*>)? (?:(?P<trait>[A-Za-z_:]+(?:<[^>]*>)?) for )?(?P<name>[A-Za-z_][A-Za-z0-9_]*)")


def die(msg):
    sys.exit(f"STOP: {msg}")


def scan(text):
    """For each line: (starts inside a string, brace depth after it, its code without strings and comments)."""
    out = []
    i, n = 0, len(text)
    depth, comment, string = 0, 0, None  # string: None, '"', or the closing text of a raw string
    code, starts_in_string = [], False
    while i < n:
        c = text[i]
        if c == "\n":
            out.append((starts_in_string, depth, "".join(code).rstrip()))
            code, starts_in_string = [], string is not None
            i += 1
            continue
        if comment:
            if text.startswith("*/", i):
                comment -= 1
                i += 2
            elif text.startswith("/*", i):
                comment += 1
                i += 2
            else:
                i += 1
            continue
        if string is not None:
            if string == '"' and c == "\\":
                i += 1 if text[i + 1] == "\n" else 2
            elif text.startswith(string, i):
                i += len(string)
                string = None
            else:
                i += 1
            continue
        if text.startswith("//", i):
            i = text.index("\n", i)
            continue
        if text.startswith("/*", i):
            comment, i = 1, i + 2
            continue
        raw = re.compile(r'(?<![A-Za-z0-9_])(?:b|c)?r(#*)"').match(text, i)
        if raw:
            string, i = '"' + raw.group(1), raw.end()
            continue
        if c == '"':
            string, i = '"', i + 1
            continue
        if c == "'":
            ch = re.compile(r"'(?:\\u\{[0-9a-fA-F]+\}|\\x[0-9a-fA-F]{2}|\\.|[^\\'\n])'").match(text, i)
            i = ch.end() if ch else i + 1  # else a lifetime or a label
            continue
        if c == "{":
            depth += 1
        elif c == "}":
            depth -= 1
        code.append(c)
        i += 1
    if depth or comment or string is not None:
        die("the lexer ended unbalanced")
    return out


def split_items(lines, info):
    """Segments covering the code before the tests: (name, kind, is_trait_impl, lines)."""
    items, start, i = [], None, 0
    first = next(k for k, l in enumerate(lines) if HEADER_RE.match(l) or IMPL_RE.match(l) or l.startswith("#["))
    while first and lines[first - 1].startswith(("//", "#[")):
        first -= 1
    preamble, i = lines[:first], first
    start = first
    while i < len(lines):
        head = HEADER_RE.match(lines[i])
        impl = IMPL_RE.match(lines[i])
        local = lines[i] == THREAD_LOCAL
        if not head and not impl and not local:
            s = lines[i]
            if s and not s.startswith(("//", "#[", " ", ")]")):
                die(f"unreadable top-level line {i + 1}: {s!r}")
            i += 1
            continue
        end = i
        while not (info[end][1] == 0 and info[end][2].endswith(("}", ";"))):
            end += 1
        if local:
            items.append(("thread_local", "thread_local", False, lines[start : end + 1]))
        elif impl:
            items.append((impl["name"], "impl", bool(impl["trait"]), lines[start : end + 1]))
        else:
            items.append((head["name"], head["kind"], False, lines[start : end + 1]))
        start = i = end + 1
    return preamble, items, lines[start:]


def widen(seg, kind, is_trait):
    """`pub(super)` on what was private to the file. Returns the new lines and the edited indices."""
    info = scan("\n".join(seg) + "\n")
    out, edited, depth_before, inside = list(seg), [], 0, False
    for k, line in enumerate(seg):
        in_string, depth, code = info[k]
        new = line
        if not in_string:
            head = HEADER_RE.match(line)
            if depth_before == 0 and (head or IMPL_RE.match(line) or line == THREAD_LOCAL):
                inside = True
                if head and not head["vis"]:
                    new = "pub(super) " + line
            elif inside and depth_before == 1:
                if kind == "struct":
                    new = re.sub(r"^    (?=[a-z_][A-Za-z0-9_]*\s*:(?!:))", "    pub(super) ", line)
                elif kind == "impl" and not is_trait:
                    new = re.sub(r"^    (?=(?:(?:const|async) )?fn |const [A-Z])", "    pub(super) ", line)
                elif kind == "thread_local":
                    new = re.sub(r"^    (?=static )", "    pub(super) ", line)
        if new != line:
            out[k] = new
            edited.append(k)
        depth_before = depth
    return out, edited


def main():
    if not SRC.is_file() or DIR.exists():
        die(f"run at the root of a checkout with {SRC} and no {DIR}/")
    text = SRC.read_text(encoding="utf-8")
    if not text.endswith("\n"):
        die("no final newline")
    lines = text[:-1].split("\n")
    info = scan(text)
    marks = [k for k in range(len(lines) - 1) if lines[k] == "#[cfg(test)]" and lines[k + 1] == "mod tests {"]
    if len(marks) != 1 or lines[-1] != "}":
        die("expected one trailing `mod tests`")
    cut = marks[0]

    owner = {name: file for file, names in MAP.items() for name in names.split()}
    for name in ROOT.split():
        if name in owner:
            die(f"{name} is listed twice")
        owner[name] = "root"
    if len(owner) != len(ROOT.split()) + sum(len(v.split()) for v in MAP.values()):
        die("a name is listed twice")

    preamble, items, tail = split_items(lines[:cut], info[:cut])
    unknown = sorted({name for name, *_ in items if name not in owner})
    if unknown:
        die(f"items not in MAP: {' '.join(unknown)}")
    rebuilt = preamble + [l for *_, seg in items for l in seg] + tail
    if rebuilt != lines[:cut]:
        die("the segments do not cover the file")

    files = {file: [] for file in MAP}
    root = list(preamble)
    visibility = {file: set() for file in MAP}
    for name, kind, is_trait, seg in items:
        file = owner[name]
        if file == "root":
            root += seg
            continue
        new, edited = widen(seg, kind, is_trait)
        undone = [l.replace("pub(super) ", "", 1) if k in edited else l for k, l in enumerate(new)]
        if undone != seg:
            die(f"{name} changed beyond pub(super)")
        files[file] += new
        for l in new:
            head = HEADER_RE.match(l)
            if head:
                visibility[file].add((head["vis"] or "").strip())

    # The tests, one indentation level less, except inside string literals.
    body = list(range(cut + 2, len(lines) - 1))
    tests, dedented = [], []
    for k in body:
        line = lines[k]
        if not info[k][0] and line:
            if not line.startswith("    "):
                die(f"test line {k + 1} is not indented: {line!r}")
            tests.append(line[4:])
            dedented.append(True)
        else:
            tests.append(line)
            dedented.append(False)
    if ["    " + l if d else l for l, d in zip(tests, dedented)] != [lines[k] for k in body]:
        die("the tests do not rebuild")

    decls = []
    for file in MAP:
        if not files[file]:
            die(f"{file} is empty")
        # A glob re-exports no more than its widest item; a wider `use` is a warning.
        vis = "pub " if "pub" in visibility[file] else "pub(crate) " if "pub(crate)" in visibility[file] else ""
        decls.append((file, vis))
    last_use = max(k for k, l in enumerate(root) if l.startswith("use "))
    mods = [""] + [f"mod {f};" for f, _ in sorted(decls)] + [""] + [f"{v}use {f}::*;" for f, v in sorted(decls)]
    root[last_use + 1 : last_use + 1] = mods
    while tail and not tail[-1]:
        tail.pop()
    root += tail + ["", "#[cfg(test)]", "mod tests;"]

    DIR.mkdir()
    for file, seg in files.items():
        while seg and not seg[0]:
            seg = seg[1:]
        use = [] if file in NEEDS_NOTHING else ["use super::*;", ""]
        out = [f"//! {HEADERS[file]}", ""] + use + seg
        (DIR / f"{file}.rs").write_text("\n".join(out) + "\n", encoding="utf-8")
    (DIR / "tests.rs").write_text("\n".join(tests) + "\n", encoding="utf-8")
    SRC.write_text("\n".join(root) + "\n", encoding="utf-8")

    subprocess.run(["cargo", "fmt", "-p", "rustgis-map"], check=True)
    for path in [SRC, *sorted(DIR.glob("*.rs"))]:
        print(f"{len(path.read_text(encoding='utf-8').splitlines()):6d}  {path}")
    print(f"OK: {len(items)} items, every segment identical to the original before formatting")


if __name__ == "__main__":
    main()

Testing

  • The script: 210 items moved, every segment identical to the original before formatting.
  • The same 241 pub and pub(crate) declarations before and after, and the same 52 tests in the module.
  • cargo fmt --all -- --check, cargo clippy -p rustgis-map --all-targets -- -D warnings, cargo nextest run --workspace leaving out two DuckDB tests that fail on this machine (9,879 passed, 29 skipped), doctests, cargo xtask layers, cargo xtask schema --check.
  • cargo check -p rustgis-web --target wasm32-unknown-unknown.

UI evidence

No visible UI change.

Related issue

Closes #3069

Summary by CodeRabbit

  • New Features
    • Expanded map-layout options with configurable charts, colorbars, grids, legends, scale bars, north arrows, text, and lines.
    • Added chart sorting, stacking, value labels, and color options, plus support for deriving color scales from raster styles.
    • Added map-frame fitting and projection handling, coordinate-grid labels, and additional controls for text alignment, styling, and formatting.
  • Refactor
    • Organized layout components into focused modules without changing their intended behavior.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The layout code is split into component modules, with component definitions re-exported through layout.rs. The modules contain layout element options, chart and statistic helpers, frame and grid utilities, and tests for these areas.

Changes: Layout module split

Layer / File(s) Summary
Module structure and element model
crates/map/src/layout.rs, crates/map/src/layout/elements.rs, crates/map/src/layout/tests.rs
layout.rs declares and re-exports component modules. ElementKind and shared element helpers are defined in the element module. Tests cover element ordering, hit selection, repair, and persistence.
Chart and statistic data
crates/map/src/layout/chart.rs, crates/map/src/layout/stats.rs, crates/map/src/layout/elements.rs, crates/map/src/layout/tests.rs
Statistic parsing and tallying support chart data generation. Chart helpers handle ordering, colors, limits, and stacks. Tests cover chart and statistic calculations and edge cases.
Frame geometry and grid labels
crates/map/src/layout/frame.rs, crates/map/src/layout/grid.rs, crates/map/src/layout/tests.rs
Frame helpers calculate cameras and fitted scales. Grid types and helpers support UTM zones and graticule and measured-coordinate labels. Tests cover frame and grid behavior.
Element-specific options and helpers
crates/map/src/layout/colorbar.rs, crates/map/src/layout/legend.rs, crates/map/src/layout/lines.rs, crates/map/src/layout/north.rs, crates/map/src/layout/scale_bar.rs, crates/map/src/layout/text.rs, crates/map/src/layout/tests.rs
These modules define colorbar, legend, line, north-arrow, scale-bar, and text options and helpers. Tests cover their calculations, serialization, and option handling.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Suggested reviewers: giswqs, m-hollis-1

Merge Risk: Minimal · up to 87e23

This PR reorganizes the layout module into per-family files without intended behavior changes, and public module paths are preserved through re-exports. No concrete merge-blocking risk was found. Normal CI should confirm the move compiles and the tests pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "refactor(map): split layout.rs into a layout module (#3069)" matches the main change. The PR moves items from crates/map/src/layout.rs into a layout/ module with one file per element family…
Description check Passed The description follows the repository template. It has Summary, Testing, UI evidence, and Related issue sections. The Summary explains the split, the behaviour-preserving intent, the re-export strate…
Linked Issues check Passed Issue #3069 asks for a behaviour-preserving split of crates/map/src/layout.rs into a layout/ module. Evidence at head: layout.rs declares mod chart, colorbar, elements, frame, grid, legend, lines, nor…
Out of Scope Changes check Passed All changed paths in the change summary are inside crates/map/src/layout.rs and crates/map/src/layout/. The PR description states that no file outside the module changes, and the ignored_files list is…
Full details: Title check

Explanation

The title "refactor(map): split layout.rs into a layout module (#3069)" matches the main change. The PR moves items from crates/map/src/layout.rs into a layout/ module with one file per element family and moves the tests to layout/tests.rs. The title is short, specific, and uses conventional commit form. It has the issue number, which is acceptable.

Full details: Description check

Explanation

The description follows the repository template. It has Summary, Testing, UI evidence, and Related issue sections. The Summary explains the split, the behaviour-preserving intent, the re-export strategy, and why ElementKind stays whole. Testing lists commands and item counts. UI evidence states 'No visible UI change.', which the template allows. Related issue reads 'Closes #3069'. The embedded script is long but relevant. Minor gap: the Testing section does not state an explicit pass/fail result for the two DuckDB tests beyond the excluded count, which is already described.

Full details: Linked Issues check

Explanation

Issue #3069 asks for a behaviour-preserving split of crates/map/src/layout.rs into a layout/ module. Evidence at head: layout.rs declares mod chart, colorbar, elements, frame, grid, legend, lines, north, scale_bar, stats and text, and re-exports each with pub use &lt;file&gt;::*;. The root keeps Layout, Element, Background, MapSeries, Guides, Arrange, PAGES, INK and the shared helpers (for example is_default, ink, white, yes), as the issue requires. The change summary lists the 11 family files, layout/tests.rs and the root layout.rs, all under crates/map/src/layout. Items are moved whole, and the only reported edits are pub(super) visibility and rewrapping. ElementKind stays in one file (elements.rs), as the issue excludes splitting it. The PR description reports byte-identical segment checks, unchanged declaration and test counts, and the listed checks. I did not re-run the script or the tests. The byte-identity claim rests on the PR's reported script output, not on my own comparison.

Full details: Out of Scope Changes check

Explanation

All changed paths in the change summary are inside crates/map/src/layout.rs and crates/map/src/layout/. The PR description states that no file outside the module changes, and the ignored_files list is empty. Every new file corresponds to a family named in issue #3069. The tests file is the existing test module moved as the issue requests. The new pub(super) visibility and the glob re-exports are needed so the moved items keep their previous access and the existing rustgis_map::layout paths keep working. No unrelated behaviour change appears in the summary. The out-of-scope judgement relies on the reported file list; I did not run a full diff of every path.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

I’m a rabbit with a map in my paws,
I hop through modules and pause,
Chart stacks sort into rows,
Grid labels find where north goes,
Scale bars and text now have homes,
And tests keep watch as the code roams.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4fa4c339-1a75-451c-9902-9adcd2896cfc
Commits

Reviewing files that changed from the base of the PR and between 3c39bbc and 87e239f.

Files selected for processing: 13

  • crates/map/src/layout.rs
  • crates/map/src/layout/chart.rs
  • crates/map/src/layout/colorbar.rs
  • crates/map/src/layout/elements.rs
  • crates/map/src/layout/frame.rs
  • crates/map/src/layout/grid.rs
  • crates/map/src/layout/legend.rs
  • crates/map/src/layout/lines.rs
  • crates/map/src/layout/north.rs
  • crates/map/src/layout/scale_bar.rs
  • crates/map/src/layout/stats.rs
  • crates/map/src/layout/tests.rs
  • crates/map/src/layout/text.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Pure file split of crates/map/src/layout.rs into a layout/ module. I found no bugs, security issues, performance problems or AGENTS.md breaks. I did not post inline comments because nothing rose to the bar for one. I could not compile or run tests here (no shell), so the build, clippy and test results rest on the PR's own claims.

Bugs: None found.

  • Each moved item is read through use super::* in its new file, so private helpers and serde default/skip_serializing_if paths still resolve.
  • Visibility widening is limited to pub(super) on items, fields and inherent methods that were private, so nothing outside layout can newly see them. Existing pub and pub(crate) items keep their visibility through the pub use x::* re-exports.
  • Line counts reconcile: 4,814 added lines in the new files plus 34 in layout.rs gives the 4,848 additions, and the 4,800 deletions match the moved block.
  • I spot-checked legend.rs and frame.rs; they show only the expected pub(super) edits.
  • No file outside crates/map references layout.rs by path, and xtask/row-uses.txt and the memory limits do not name crates/map/src/layout, so the path move should not trip those ratchets.
  • Not checked line by line: the roughly 4,800 moved lines. I relied on the script's byte-identity check described in the PR.

Security: None.

Performance: None. Runtime code is unchanged.

Quality (non-blocking, for the release quality pass):

  • layout/tests.rs has no //! header line, unlike the other split files. Trivial.
  • The pub use x::* globs put every moved item into one flat layout namespace. Two sibling files that later define the same name would only fail where the name is used. Worth knowing for future edits, not a change request.
  • The PR says two DuckDB tests fail on the author's machine, but it does not show they also fail on the base branch. I cannot verify that from here.

AGENTS.md: None. The PR states "No visible UI change", and nothing here stores or copies layer data, so no memory multiple is needed. It also says the command surface, schema and wasm builds are unaffected; I could not run those checks.

Prior reviews: There were no existing review threads, so no earlier concerns were left alone.

Change size

Compared with the base branch (merge base 3fc52bc to PR head 87e239f). The whole PR, not the latest push.

Measure Value
Files changed 13 (12 added, 1 modified, 0 removed, 0 renamed)
Size before 258.0 KB
Size after 253.0 KB
Total size change -5.0 KB
Path Before After Change
crates/map/src/layout.rs 258.0 KB 32.1 KB -225.9 KB
crates/map/src/layout/tests.rs 0 B 97.6 KB +97.6 KB
crates/map/src/layout/elements.rs 0 B 44.8 KB +44.8 KB
crates/map/src/layout/chart.rs 0 B 17.6 KB +17.6 KB
crates/map/src/layout/text.rs 0 B 11.8 KB +11.8 KB
crates/map/src/layout/grid.rs 0 B 11.8 KB +11.8 KB
crates/map/src/layout/stats.rs 0 B 9.5 KB +9.5 KB
crates/map/src/layout/scale_bar.rs 0 B 9.2 KB +9.2 KB
crates/map/src/layout/colorbar.rs 0 B 6.0 KB +6.0 KB
crates/map/src/layout/frame.rs 0 B 5.9 KB +5.9 KB
crates/map/src/layout/lines.rs 0 B 5.0 KB +5.0 KB
crates/map/src/layout/north.rs 0 B 1.2 KB +1.2 KB
crates/map/src/layout/legend.rs 0 B 523 B +523 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3072/
Web app https://preview.rustgis.app/pr-3072/app/
Commit 87e239f

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 27, 2026
@jgregoriorincon

Copy link
Copy Markdown
Contributor Author

On the three quality notes; no change in this PR:

  • layout/tests.rs has no //! line because it holds the former mod tests as it was, which had none.
  • The glob re-exports are what keeps every rustgis_map::layout::… path as it was. Two sibling files exporting the same name are reported at the re-export, not only where the name is used: rustc's ambiguous_glob_reexports lint warns by default, and -D warnings makes it an error.
  • The two DuckDB tests are left out by the checks script on this machine for every branch, so the exclusion is not specific to this change.

Merged via the queue into opengeos:main with commit 2f5a618 Nov 27, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the refactor/3069-split-map-layout branch November 27, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Split crates/map/src/layout.rs into a layout module, with no change in behaviour

1 participant