* The map can choose a 1:24,000 quadrangle to export (#971)
The first part of exporting a map as a PDF: a grid of 7.5-minute quadrangles is drawn over the
map, and a click chooses one. The grid is arithmetic, so it needs no data. Exporting itself is
not here yet; the button is disabled.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A quadrangle of the map is exported as a PDF with a layer for each map layer (#972)
* A quadrangle of the map is exported as a PDF with a layer for each map layer
The browser draws the quadrangle off the screen at the size of a 1:24,000 sheet, once for each
layer which is on, and the API puts the images in a PDF, each in a layer of its own which a
reader can show and hide. A layer in which nothing is drawn is left out.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The exported map's canvas keeps what was drawn, and an export's memory is bounded
- The drawing buffer is asked for where this MapLibre reads it (canvasContextAttributes); as an
option of the map it was ignored, so the canvas could be read after it was cleared.
- Each layer's pixels are compressed in the PDF as the layer is added. PyMuPDF kept them
uncompressed until the PDF was written: about 90 MB a layer of a quadrangle, all at once.
- The pixels of all the layers together are limited, before any image is decoded.
- pymupdf is imported when a PDF is made, not when the API starts.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map says where on the Earth it is (#973)
* An exported map says where on the Earth it is
The PDF's page has a geospatial viewport (ISO 32000-2): the page is the map in Web Mercator,
with the latitude and longitude of each corner. The corners are the edges of the picture the
browser drew, read from the map which drew it.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A map whose edge is the antimeridian can be exported
The map's arithmetic puts the east edge of the last quadrangle before the antimeridian a rounding error past
180 degrees, and the export was refused. An edge within 1e-8 of a degree of 180 is at 180 (it is not wrapped
to -180); a map which is really across the antimeridian is still refused.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map is on a sheet: a margin, a grid, scale bars and notes (#974)
* An exported map is on a sheet: a margin, a grid, scale bars and notes
The map is put on a larger page with what a topographic map has around it: a title, the latitude and longitude
of its corners and of ticks between them, scale bars (kilometers, miles, feet), and notes of the projection, the
grid and where the map's data is from. Over the map is a 1,000 meter UTM grid, each line named in the margin.
The grid and the margin are PDF layers of their own. The PDF says where the map is, not where the page is. The
picker has a box to export the map alone.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The scale of a narrow map is written under its name, not over it
A quadrangle near a pole is two inches wide, which is not room for its name and its scale on one line.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map says where a compass points (#975)
* An exported map says where a compass points
The sheet has a diagram of the three norths (true, grid and magnetic) beside its scale bars, and a note of how
far magnetic north is from true north on the day the map was made, and how fast it moves.
The declination is from the World Magnetic Model 2025 (NOAA NCEI and the British Geological Survey; public
domain), whose coefficient file is shipped: nothing is downloaded. The model is good until 2030; outside its
years nothing is said of a compass.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A corner of an exported map is not also a tick
The edges of the picture the browser draws are a hair outside the quadrangle's, so the quadrangle's own edges
were taken for ticks inside the map, and each was written over the coordinate of its corner.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A compass which passes due south has moved a little, not most of the way around
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A map can be exported at 400 DPI (#976)
The picker has a choice of 300 or 400 DPI. A map is drawn less sharp than was asked for, rather than refused,
when it would be more pixels than the API makes a PDF of: a quadrangle near the equator, or one with many layers
on. The picker says so while it draws.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported quadrangle goes by the name the USGS gives it (#977)
* An exported quadrangle goes by the name the USGS gives it
The picker says what the chosen quadrangle is called, and the sheet's title, the PDF's title and the file's
name have it. Where the USGS has no name, which is most of the world, a quadrangle goes by where it is, as
before.
The names are an index of the 65,600 7.5 minute quadrangles of The National Map (U.S. Geological Survey; public
domain), which is shipped: nothing is downloaded. In Alaska a USGS quadrangle is wider than 7.5 minutes, so a
quadrangle of the picker's grid there is "Part of" the one which has its middle.
The places the tests of the map export are of are changed for others.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An area half of which is the last quadrangle of the land is a part of it
The middle of such an area is on the quadrangle's east or north edge, with no quadrangle beyond it, and it was
given no name.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The PDF of a map is made by a Job, which the browser watches (#978)
* The PDF of a map is made by a Job, which the browser watches
A PDF of a quadrangle is a minute or two of work on a Raspberry Pi 4, and the request which waited for it was
cut off after a minute: only the smallest quadrangles could be exported there.
Now the browser describes the map, sends the image of each layer in a request of its own, and starts a Job; it
watches the Job, shows how far along it is, and fetches the PDF when the Job is done. Cancel stops the Job.
The images are kept on disk until the PDF is made of them, and an export is removed when it is an hour old.
The credits on the sheet are no longer cut off: an attribution which names many sources is each of them.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A cancelled map export stops, and is removed
- A cancelled Job is not over until the thread making the PDF has stopped, so the next Job does not start beside
it; the work can also be stopped while the sheet is drawn and the PDF written.
- DELETE /api/map/export/<id> stops an export at any step and removes what was sent; the browser calls it when
the person exporting cancels, while layers are sent as well as while the PDF is made.
- An export whose Job is waiting or running is not removed for being old; one whose Job was cancelled is removed
at once.
- Cancel while the map is drawn stops the drawing between two layers.
- Exports are kept in a directory made for this user alone, which is refused when it is a link or is another
user's; only what is an export there is removed.
- A request for the finished PDF which is lost is made again.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An overlay's areas and lines go under the map's labels, and its own labels over them (#979)
An overlay was drawn whole over the basemap, so an area it filled covered the names of what is in it. Labels are
now always on top: the areas, lines and pictures of every overlay are under the basemap's labels, and the text,
icons and points of every overlay are over them. It is so in the map, the standalone viewer, and an exported PDF,
where an overlay with both is two layers ("Towers" and "Towers (labels)").
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An overlay's ground is over the ground of every basemap file (#980)
* An overlay's ground is over the ground of every basemap file
On a map of several basemap files, the ground of an overlay was put before the first label of the first file,
which is under the land, water and roads of every file after it: an overlay's areas and lines were hidden, and
in an exported PDF its layer was just above the background. It goes where the basemap's labels begin: the first
of the labels which are over all of the basemap's ground.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The labels of every basemap file are over the ground of every file
A map of several basemap files was their layers one file after another, so only the labels of the last file were
on top: the labels of the others were under the land, water and roads of the files after them, and under the
ground of an overlay. Both viewers now draw the ground of every file and then the labels of every file.
The contour lines are drawn after the basemap's labels and are not of the basemap: an overlay's ground goes under
the basemap's labels, not under the contours instead.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* Contours are drawn from as deep as the terrain file goes (#981)
The map read a terrain file to zoom 8, which is how deep the terrain WROLPi offers goes, however deep the file
was. It now reads a file as deep as the file says it goes, in both viewers, and draws finer contour lines from a
deeper file: every 40 feet (or 20 meters) from zoom 11, as a 1:24,000 sheet has. A file which goes to zoom 8 is
drawn as it was.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map names its small roads (#982)
* An exported map names its small roads
A quadrangle is drawn at about zoom 13. The basemap's style names small roads
from zoom 15, and its tiles have no names for them below zoom 14, so the streets
of a town were printed as lines with no names.
Before the map is drawn, the tiles of zoom 14 which the quadrangle is in are
read, and the roads in them which have a name are given to the export map as a
source of its own. The layer which names small roads draws from that source, as
its style says to.
At the scale of a sheet most streets are shorter than their names, and a map
writes a name along a line only where the line is longer. Such a road is named
over its middle, turned as the road goes; a road in pieces is named once.
A source whose tiles can not be read is exported as before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The names of small roads are placed by the export, at every latitude
A quadrangle nearer the equator is drawn at a little over zoom 14, where the
names were not read and the style still kept them for zoom 15: such a map had
no names of small roads. They are now read wherever a layer would not name
roads.
Every name of a small road is now a point: over the middle of its road, turned
as the road goes under it, again every 400 pixels of a long road. Before, a
road long enough was left for the map to name along its line, which the map
often does not (the line bends, or is in pieces), and a short piece beside it
was named too. One place decides where a road is named, so a road in pieces is
named once, and a piece of another kind of road does not take the name.
Reading the names can be cancelled.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet has a bar of meters, its norths in mils, and how far apart its contour lines are (#983)
Under the map are bars of kilometers, meters, miles and feet.
How far the grid's north and a compass's north are from true north is written in
mils as well as in degrees, in the diagram and in the notes: a compass may be
marked in either.
A map which is exported with its contour lines says how far apart they are
(CONTOUR INTERVAL 40 FEET), under the bars. The browser knows: it is the
interval of the tiles the lines are made for at the zoom of the sheet, in the
unit the map measures in. It says so with the sheet, and what is not an
interval is not written.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet says what the quadrangles around it are called (#984)
* A sheet says what the quadrangles around it are called
Under the scale bars is a diagram of nine squares, the map the middle one, and
beside it what the USGS calls each of the eight around it: the sheets to print
to carry on off the edge of this one.
The names are from the index of quadrangles which names the sheet itself. A
quadrangle with no name (out to sea, or over a border) has no number; a map of
where the USGS names nothing, and a map too narrow for the diagram, go without.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet is never beside itself
Where a quadrangle of the USGS is wider than the map (Alaska), the area the
size of the map to its east or west is often more of the quadrangle the map is
in, and the diagram named the sheet as its own neighbor. The quadrangle on a
side is now the next one which is not the map's own.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A sheet has a legend of the lines of its map (#985)
* A sheet has a legend of the lines of its map
Under the scale bars is what each kind of line of the map is: highway, major
road, minor road, path, railway, boundary, contour and index contour, each a
piece of the line as the map draws it, on the color of the map's land.
The map's style says how a line is drawn at each zoom, and a sheet is drawn at
one. The browser, which has the style, says what each line's color, width,
dashes and edges are at that zoom; the API draws them. A line is in the legend
when its layer is exported and draws something at that zoom.
What the browser sends is made into lines before it is kept: what is not a line
is left out, and the map is exported.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A legend has no line too thin to see, and no name longer than its room
A style brings a line in from nothing as the map is zoomed in: a path is a few
hundredths of a point wide on a quadrangle near the equator. It was in the
legend, drawn several times wider than on the map. A line under a tenth of a
point is now left out, by the browser and by the API.
What a line is called is cut to the room beside its line, as the name of an
adjoining quadrangle is.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* Fixes to the map PDF export: wrong neighbors, leftover exports, exports which outlive the map (#989)
* A sheet names what is around it, and its edges, by where they are and not a hair from there
The edges the browser gives of a map are a hair outside its quadrangle. The quadrangles around a map whose
middle is on the edge two share (every other map of Alaska) were those around the map west of it, and one of
them was the map itself. An edge a hair south of the equator was 0 degrees south, a map which ended where the
UTM zones do had no grid, and a sheet dated in the last year there is could not be made.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export is removed when it is over, and its work stops when the API does
The images and the PDF of an export were kept until the next export began, however long that was. The browser
now has the export removed however it ends, and old exports are removed when a PDF is made too. The work of a
Job which ended because the API was stopping went on to the end of the PDF, with the API waiting for it. What
is said of an export, and each image, is written whole. Text which is no text is taken out when an export
begins, not found by the Job.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export stops with its map, and waits for a page which can not be seen
Leaving the map while it was exported left the export going, to fail or to hand a PDF to another page; so did
closing the picker, which is now left open. A PDF which arrives after the export was stopped is not saved.
The time a page is behind another tab is not counted against a map which is drawing. The name of a road is
one line. A photograph which ends a little inside the map is not made a JPEG with a black strip. An accent
in the name of a quadrangle is not a gap in the name of its file.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A PDF is not kept from who made it by a server slow to remove the export
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map has its water over its parks (#990)
* A sheet names what is around it, and its edges, by where they are and not a hair from there
The edges the browser gives of a map are a hair outside its quadrangle. The quadrangles around a map whose
middle is on the edge two share (every other map of Alaska) were those around the map west of it, and one of
them was the map itself. An edge a hair south of the equator was 0 degrees south, a map which ended where the
UTM zones do had no grid, and a sheet dated in the last year there is could not be made.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export is removed when it is over, and its work stops when the API does
The images and the PDF of an export were kept until the next export began, however long that was. The browser
now has the export removed however it ends, and old exports are removed when a PDF is made too. The work of a
Job which ended because the API was stopping went on to the end of the PDF, with the API waiting for it. What
is said of an export, and each image, is written whole. Text which is no text is taken out when an export
begins, not found by the Job.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An export stops with its map, and waits for a page which can not be seen
Leaving the map while it was exported left the export going, to fail or to hand a PDF to another page; so did
closing the picker, which is now left open. A PDF which arrives after the export was stopped is not saved.
The time a page is behind another tab is not counted against a map which is drawing. The name of a road is
one line. A photograph which ends a little inside the map is not made a JPEG with a black strip. An accent
in the name of a quadrangle is not a gap in the name of its file.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map has its water over its parks
A layer of the PDF was one image, drawn where the topmost of its layers is. The parks of Land Cover are under
the water on the map and its piers are over it, so all of Land Cover was drawn over the water: a lake in a
park, or among houses, was not on the PDF. A second basemap file put its water over the first's buildings.
A layer is now as many images as it must be, each where it is on the map, in one layer of the PDF: a part
which fills an area stays where it is, and a part which is only lines is drawn with the next.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A PDF is not kept from who made it by a server slow to remove the export
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A map file which is of somewhere else is not drawn when a map is exported
Each basemap file is several images of an exported map, and most files of a library are of other places: each
was an image of nothing, counted against how many images an export may be and how sharp it may be. A file
whose own edges are outside the quadrangle is now left out before the layers are counted.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map has its streams (#991)
A basemap draws streams from zoom 14, and service roads and taxiways from 13. A quadrangle is drawn a little
short of that (zoom 13.8 at 40 degrees, 13.2 at 61), from tiles which have them: none were on the PDF. What
is drawn from a zoom no deeper than a quadrangle's detail is drawn. Names are left as they are.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An export which is cancelled stops at once, in the middle of a request (#993)
* An export which is cancelled stops at once, in the middle of a request
An export was stopped between two requests. The image of a layer is tens of megabytes, which is a long request
on a slow connection, and a request to a server which has stopped answering never ends: the export said it was
stopping until then. Cancel, and leaving the map, now end the request.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* The requests an export makes after its layers are sent are seen to be stopped too
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A map is exported as it is printed: on white, in dark lines (#996)
* A map is exported as it is printed: on white, in dark lines
The light and dark maps are made for a screen. On paper their roads are white on pale gray and their streams
half a pixel of pale blue. The printed map is a third look, of the map's own: white ground, dark road edges
and names, blue streams wide enough to see, paths drawn, brown contours.
It is what a map is exported in unless Light or Dark is chosen where the quadrangle is, and the choice is
remembered in the browser. While a quadrangle is chosen the map is shown in the look it will be exported in.
The light and dark maps are as they were.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Changing the look of the map does not move it
What is done when a new style is in place was asked for after the style was set. A style which only differs
from the one the map has is in place before that, so it was done at the next change of style instead, with
where the map had been at this one: the map went back there when a quadrangle was chosen, and again when it was
not. It is asked for first, and the map is not moved at all. An export no longer waits for the map to be
still, which it need not and which nothing ended.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The colors of the printed map are chosen where its layers are (#997)
* The colors of the printed map are chosen where its layers are
While a quadrangle is chosen and the map is shown as it is printed, each layer of the layer control has its
color beside it, to be changed: one for most, three for the land (what grows, what was built, sand and ice)
and two for names (the name, and what is around it). A basemap has several colors where one is chosen, which
are shades of it. The edge of a road stays dark. What is chosen is remembered in the browser, and can be put
back. The map on the screen is as it was.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A ramp on a bridge is the color of a major road, as it is off one
A basemap draws a ramp on a bridge in the color of a minor road on a bridge: on the printed map it was white
where the rest of the ramp is yellow, and followed the color chosen for minor roads. What puts the colors
back is a button, which a keyboard reaches.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* A layer with nothing in it does not make an exported map less sharp (#1001)
* A layer with nothing in it does not make an exported map less sharp
How sharp a map may be depends on how many images it is, and every group of layers was counted: a basemap
file with no runway, highway or boundary in the quadrangle was images of nothing, drawn, sent, and counted
against the rest. A map of 23 images asked for at 400 DPI was made at 330. The groups are now looked at
first, on a small map, and only those with something in them are drawn, as sharp as that many may be.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* An image which arrives after its export was removed is not kept, and one mil is a mil
Stopping an export while an image was on its way left the image behind it, in a directory nothing would
remove for an hour. An angle of one mil was "1 mils" on the sheet.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The map which is exported from is made as sharp as it is to be (#1002)
* The map which is exported from is made as sharp as it is to be
The groups of a map are looked at on a small map, which was then made larger to draw them. A browser lets
a canvas be larger when it is made than it lets one be made larger afterwards: a quadrangle asked for at
400 DPI was 33 million pixels, 288 DPI at 40 degrees, less than before the groups were looked at first. The
small map is now removed, and the map which is exported from is made in its place.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* A canvas the browser stopped drawing on is not a layer with nothing in it
A canvas whose drawing was taken away by the browser reads as clear, and a group looked at then was left out
of the PDF without a word: the export fails instead. An export stopped as the last group is looked at does
not make the map it would have been drawn on.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* An exported map says where it is in a projection Adobe Acrobat knows (#1003)
* An exported map says where it is in a projection Adobe Acrobat knows
The page was said to be in Web Mercator, which it is drawn in. Acrobat does not know Web Mercator, in the
words of the standard or in Esri's: it took the page for a map, and put every place on it at 0, 0. The page
is now said to be Mercator on the WGS 84 ellipsoid, which it reads, with the same corners. Between the corners
the two differ by under three centimeters on the ground.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* How well a page is said to be where it is, is measured from what the PDF says
The test of it measured two formulas of its own. It now reads the corners and the projection from the PDF and
does a reader's sum with them. The few centimeters are of a quadrangle: a taller page is less well said, by
the square of how tall it is, which the comment now says and a test measures.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* The help says how a map is exported as a PDF (#1004)
The help of the map is five pages, one of them the PDF export.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
When a MapLibre style (and optionally a sprite sheet) sits beside a PMTiles file, the overlay is drawn with it instead of the generic colors: `<name>.style.json` and `<name>.sprite.json/.png`, or `style.json` and `sprite.json/.png` shared by the files of a directory.
Only the style's layers which draw that file are used; its sources, sprite and glyph URLs never are. Fonts are replaced by the ones the map has, images are pointed at the overlay's own sprite (as strings, expressions or property functions), and each layer is validated so one the map could not draw is skipped instead of stopping the map.
The sprite is served by the API, which falls back to the single resolution sheet when there is no double resolution one.
* STL files preview with three's own STLLoader
react-stl-viewer inlines a copy of three-stdlib 2.17.2's STLLoader, which reads
ASCII STL text with LoaderUtils.decodeText. three removed that in r175, so
every ASCII STL preview failed. The three-stdlib override never reached that
copy, and react-stl-viewer has had no release since January 2024.
The 3MF preview's three.js viewer now previews STL files too, loading each
format with the loader that ships with three, so the loader always matches the
installed three. react-stl-viewer and the three-stdlib override are removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* An e2e spec previews ASCII and binary STL files in a real browser
The STL preview only fails in a browser with WebGL, so the spec opens both
encodings on the live stack and checks the dimensions line appears without a
load error. fb:reset can now write binary files ({base64: ...}).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* STL previews stand Z-up models upright
STLs are Z-up (the 3D printing convention) and three is Y-up, so the
preview rotates STL geometry to stand the model upright, as react-stl-viewer
did. Model Z reads as Height again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* 3MF previews stand Z-up models upright too
3MF is Z-up like STL, so the rotation moves from the STL loader into the
shared viewer and applies to every model. Model Z reads as Height.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* File previews show their buttons without scrolling
.preview-fit reserved a fixed 18.75rem for the rest of the preview modal,
which was short: every framed preview overflowed a little, and a 3D model's
dimensions line pushed the action buttons below the fold. The preview modal
now fills its height as a flex column, and the .preview-fit takes whatever
height is left. Previews without a .preview-fit keep their content's height.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* 3D previews frame the model and light it brightly
- The camera fits the model's bounding sphere into the narrower field of view,
from a raised three-quarter front view, instead of backing off 2.2x along Z.
- A hemisphere light and a headlight that follows the camera (from a little
above and left) replace lights whose intensities were set before three's
r155 lighting change and read dim.
- Geometry without normals (3MF) gets creased normals, so flat faces no longer
shade into their neighbors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
react-stl-viewer pins three-stdlib 2.17.2, whose STLLoader decodes ASCII STL
files with three's LoaderUtils.decodeText. three removed that function, so
every ASCII STL preview failed while binary STLs (which never decode text)
still worked. Override three-stdlib to 2.36.1, which ships its own decodeText.
Jest can now load three: a small transform converts three/three-stdlib ES
modules to CommonJS without babel-preset-react-app, whose class-properties
plugin rejects three's static class blocks at our pinned Babel version.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Distrust compromised eMudhra intermediates in certifi and Deno (#854)
* Distrust compromised eMudhra intermediates in certifi and Deno
The private keys of eight eMudhra intermediate CAs can be recovered from
their certificates, so anyone can mint a trusted certificate for any host.
* Require certifi>=2026.10.19; yt-dlp, requests and curl-cffi use its bundle,
and 2026.10.19 removes the emSign ECC Root CA - G3 root they chain to.
* Set DENO_TLS_CA_STORE=system for the API (systemd + Docker) and the archive
container so Deno follows the apt-patched system store instead of roots
that only change with a Deno upgrade.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep Deno's bundled roots in the archive container
browserless/chrome:1.61.1 is Ubuntu 22.04 whose newest ca-certificates is
from 2023, older than Deno 2.8.3's bundled roots. The system store only
becomes the better choice once the archive base image is upgraded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* build(deps): bump dompurify from 3.4.16 to 3.4.17 in /app
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.16 to 3.4.17.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.4.16...3.4.17)
---
updated-dependencies:
- dependency-name: dompurify
dependency-version: 3.4.17
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: lrnselfreliance <33263708+lrnselfreliance@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Preview markdown files formatted, with a raw toggle
Markdown files are typed text/markdown (libmagic reports them as text/plain, or
as a programming language when they hold code) and keep the text indexer, so
they stay deep-searchable. Existing files switch type on their next refresh.
The file preview renders markdown with markdown-it into the page, so it follows
the theme tokens and the night media filter. A Formatted/Raw toggle shows the
source instead, and the choice is remembered. Relative links and images
resolve against the file's directory; URLs that climb out of /media/ are
dropped. Raw HTML in a file is escaped rather than parsed, and the output is
also sanitized with DOMPurify.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Do not load images from other sites in the markdown preview
An image from another site (http:, https:, or protocol-relative //) loaded as
soon as the preview opened, telling that site who was reading the file and
when. Such an image now becomes a link labeled with its alt text, so the
reader chooses whether to follow it. Inside a link (a README badge) it becomes
the outer link's text, since links cannot nest. Media and embedded data:
images still load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Cypress component testing resolves the top-level webpack-dev-server
and only accepts major 5, so the bump crashed cypress.config.js on
every run ("Unexpected major version of webpack-dev-server"). The
react-scripts dev server was unaffected because it uses its own
nested 4.x, which is what the pre-merge check looked at.
Pin webpack-dev-server below 6 in dependabot.yml until Cypress
supports it.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* test: the component suite has not run since cypress 15, on any machine
Six component spec files -- 334 tests, including the 4,300-line layout suite -- could not
start. Cypress exited before printing anything, and under its default Electron browser it
did not even do that: it hung at 0% CPU until killed. Chrome prints the error in seconds,
which is the only reason this was findable.
Three things broke, all of them from the 13.17.0 -> 15.20.0 bump.
`baseUrl: "src"`. Cypress 15 loads its config with tsx, and tsx honours tsconfig path
resolution. Cypress requires Node's core `events` module; with that baseUrl the bare
specifier resolves against `src`, and on a case-insensitive filesystem it matches
`src/Events.js`. That file imports the app, so the whole component tree was required in
Node: JSX in `.js` files, which esbuild will not parse.
This is why CI stayed green while every local run died. Linux is case-sensitive, `events`
never matched `Events.js`, and it resolved to the built-in. The baseUrl buys nothing --
there is not one absolute import in the codebase -- so it goes.
`framework: "create-react-app"`. Cypress 14 removed that dev server; the handler is in the
13.17.0 binary and absent from 15. The webpack config is handed over explicitly now, taken
from react-scripts so components compile exactly as `npm start` compiles them. Two things
follow from that: `webpack-dev-server` 5 is a devDependency because Cypress requires 5 and
react-scripts pins 4 (npm nests react-scripts' copy, and the production build is unchanged),
and babel-loader is widened to `cypress/`, which react-scripts does not compile -- the
support file is JSX and was reaching babel with no preset.
The suite ran nowhere. `cypress run` means e2e -- its specPattern is `cypress/e2e/**` --
and these specs sit beside the components in `src`, so no job has ever executed them. A
`cypress-component-tests` job runs them now; without it this breaks again in silence.
One test fails the moment the suite can run, and it is mine, from #660: it asserted the URL
column is the widest in the row. It is not, and never was -- at that width the fixed columns
take ~307px of 400, leaving the URL ~93 against Control's 146. It shipped green because
nothing could run it. It asserts a usable remainder instead.
334 component tests pass, 69 suites / 1214 jest tests pass, `npm run build` is clean.
* review: an assertion with a floor, and comments that told the story instead of the rule
The leftover-width test had a lower bound and nothing else, so it passed on any column
wide enough to have padding -- including one that had grown, which is what losing
table-layout: fixed does. It measures the leftover now: the sized columns are held to
the widths they declare, and the truncating column to exactly what they did not take.
Comments in the config, the CI job and the spec cut back to the rule a reader needs. The
version history and the measurements are in the PR.
The pins that fixed the blank React /map were removed as collateral when the
Mantine commit rewrote `overrides` for TypeScript 5. Nothing failed, so nothing
objected: the map kept working only because package-lock.json still happened to
resolve @babel/core to 7.20.12, and devices run `npm install`, not `npm ci`.
Verified on this tree rather than assumed. Raising @babel/core to 7.29.7 and
reinstalling floats the whole pipeline (traverse/generator/types to 7.29.8) and
`npm run build` then fails outright: "'opera_mobile' is not a valid target",
from a helper-compilation-targets that floated away from the browserslist data
it was pinned against. With the pins restored the build compiles, all 141
resolved copies match, and /map renders from the built bundle.
The test walks every path in the lockfile, not just node_modules/<name>: npm
nests a second copy whenever versions conflict, and a nested copy that escaped
the override would put the new pipeline back into the build while the top-level
entry still read correctly.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rebasing onto master brought @testing-library/dom 8.20.0 -> 10.4.1, while
user-event stayed at 13.5.0. v13 targets dom v8 and reaches into internals v10
moved, so its keyboard simulation silently stopped dispatching: two SearchBox
tests failed with `Number of calls: 0` -- the arrow keys and Enter did nothing.
Test-harness only. @testing-library/dom never reaches a build, and no product
code changed in the rebase; the combination was simply never installed together
until master's bump met this branch.
v14's direct API is call-compatible with what the ten suites already do, so no
test needed rewriting -- the calls were already awaited.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`semantic-ui-react`, `react-semantic-toasts-2` and `semantic-ui-offline` are
gone from package.json, the lockfile and node_modules -- 19 MB of dependencies
that nothing had imported since the migration finished.
Four things still referenced them and would have broken on uninstall. None was
caught by a build or by jest:
Four test files still ran `jest.mock('react-semantic-toasts-2', ...)` for
components that no longer use it. A jest.mock of a module that does not exist
throws, so the packages could not have come out without this.
`src/components/Download.cy.js` and `cypress/support/component.js` both
imported semantic.min.css. The support file now loads what the app loads --
index.css, the font and token stylesheets, and Mantine's.
The ratchet changes job rather than being deleted. An import of a missing module
fails loudly now, but three quieter mistakes would not: a `className="ui button"`
that styles nothing, a file reaching back through Theme.tsx, and someone
reinstalling a package to "just use one Semantic component". It asserts all
three, plus that package.json names nothing matching /semantic/i.
Two pre-existing problems in the cypress component harness surfaced while
checking the uninstall had not broken it, both fixed because that file had to be
edited anyway:
It imported `react-router-dom`, which is not installed -- this app is on
react-router v7. Dates to 5621d473, so the component suite has been
un-runnable since well before this migration.
Its mount helper supplied no MantineProvider, so every library component threw
-- the same gap test-utils.js had for jest.
The component specs now load and four pass; eleven assertions are still written
against markup from before they stopped running. Repairing those is its own
piece of work, deliberately not bundled in here. The e2e suite is unaffected:
43/43.
Adds src/components/ui: buttons, messages, labels, progress, status, tables,
form controls, panels, cards, statistics, modals, tooltips, tabs, and icons.
Everything resolves its colors through theme tokens, so no component branches
on the current theme, and Semantic UI keeps rendering the app meanwhile.
Mantine is bridged rather than restyled: its own CSS variables are pointed at
our tokens. Four details were not obvious, and each caused a visible defect
in night mode before being fixed:
- Structural colors must go in the resolver's light/dark blocks. Mantine
emits its values under [data-mantine-color-scheme], which outranks the
:root block that `variables` becomes, so its grays were winning.
- The dark and gray palettes are mapped shade by shade to tokens. Mantine
reads them directly for table borders, zebra stripes and input chrome;
they can be neither flattened nor left alone.
- Mantine writes --button-* as inline styles, which no stylesheet can
outrank, so the dashed danger treatment sets real properties instead.
- Switch colors are written onto inner elements, so they need scoped CSS
rather than a variable on the root. Adds a --knob token for control
handles, because Mantine's default thumb follows theme.white, which is
near-black in the dark-based themes.
An audit of every painted pixel in the /theme-sample gallery now finds no
non-red channel in night mode.
Icons come from @tabler/icons-react with the 102 Semantic names the app uses
mapped to components; they stroke with currentColor, so they follow the theme
without any rule of their own. Toasts keep the react-semantic-toasts-2
signature so those call sites migrate by changing an import.
TypeScript 5 is required: Mantine's declarations use `const` type parameters,
which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape).
That needs two npm overrides to keep clean installs working, both verified
against a Docker build: react-scripts declares peerOptional typescript ^3||^4,
and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5
made getter-only - crashing the dev server's type checker on every rebuild.
semantic-baseline.test.js ratchets the removal: it fails if a file not already
listed imports Semantic UI. An ESLint rule would have printed 75 warnings per
rebuild, and CI unsets CI= for its build step, so it would guard nothing there.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(app): depend on @testing-library/dom directly
jest-dom 7 moved @testing-library/dom from a bundled dependency to a peer
dependency. Nothing else pulls the top-level copy in — @testing-library/react
13 carries its own nested v8 — so it was present only as a peer, and CI
installs with --legacy-peer-deps, which skips peers. Every suite then failed
to load setupTests.js with "Cannot find module '@testing-library/dom'".
Declare it as a devDependency so it installs under either resolution mode.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(app): import mount from cypress/react
Cypress 14 removed the cypress/react18 subpath; cypress/react mounts React
18 itself. The e2e support file loads commands.js, so the stale import broke
bundling for every spec, not just component tests:
Module not found: Package path ./react18 is not exported from package cypress
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* ci: install and cache Cypress the way the bump requires
The Cypress binary lives in ~/.cache/Cypress, outside node_modules, but only
node_modules was cached. A restored cache satisfied npm, so npm skipped the
postinstall download and the 15.x binary was never fetched:
The cypress npm package is installed, but the Cypress binary is missing.
Cache both paths and install the binary explicitly.
Also align the JS toolchain with what actually ships. Debian 13 devices run
nodejs 20.19.2 and install with a plain `npm install`; the Docker app image
does the same. CI pinned older Node and passed --legacy-peer-deps, which
skips peer dependencies -- that is why jest-dom 7's peer requirement passed
review and broke CI. Match the devices instead.
Pin caddy to 2.11.4, the version Debian 13 devices run, rather than latest.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* ci: test on Python 3.13, the version that ships
Debian 13 devices run Python 3.13.5 and the api/controller/help images are
python:3.13-trixie, but CI ran 3.11 (and one job on 3.12), so the runtime
under test was two minors behind the runtime in production.
Verified on 3.13 before switching: backend 1712 passed, 5 skipped; controller
883 passed. The only new warning is SQLAlchemy 1.3.22 reaching Python's
deprecated datetime.utcfromtimestamp(), which is noise rather than a break.
Drop api-tests-3-12: no workflow referenced it, it duplicated api-tests, and
its "Sanic does not yet support 3.12" note is stale now that devices run 3.13.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The React /map page rendered blank (only pins) on fresh builds while the
standalone :8084 viewer worked. maplibre-gl's Web Worker (inlined into the
production main.js) threw `ReferenceError: a is not defined` in its setLayers
handler, so the worker's style-layer index never built and every vector
source's tiles failed to parse ("Cannot read properties of undefined
(reading '<source>')"). The unminified dev build was unaffected — it is a
production minification bug: Terser mangles the inlined worker into broken code.
Root cause: the "npm audit fix" in 62660529 (intended for shell-quote/
form-data/ws) regenerated the lockfile and dragged @babel/core 7.20.12 ->
7.29.7 (whole @babel core pipeline). Babel 7.29 transpiles the maplibre worker
differently; CRA's (unchanged) Terser mangle pass then breaks it. Proven on
10.0.0.8: rebuilding the minified prod bundle with @babel 7.20 renders the map
(0 worker errors); rebuilding back to 7.29 breaks it again with the identical
bundle hash. The transform plugins were never bumped, so pinning @babel/core
alone is insufficient — the core AST pipeline (traverse/generator/types/
helpers) must be pinned too.
Fix: pin the 16 @babel packages that differ from the last-good tree
(6b7bd079) via package.json overrides, keeping the shell-quote/form-data/ws
security fixes. Frontend jest suite passes (810/810).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>