diff --git a/README.md b/README.md index 8b0df04..788e76e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Three transforms do the work, all of them toggleable in the UI: | Transform | What it does | | --- | --- | -| **Merge duplicates** | Mutually exclusive wargear forces you to take a datasheet twice - one Skatros with a radium jezzail, another with a transuranic arquebus. Copies of the same unit are folded into one card carrying every option. Points are not summed; the card keeps the highest cost of the copies it absorbed. | +| **Merge duplicates** | Mutually exclusive wargear forces you to take a datasheet twice - one Skatros with a radium jezzail, another with a transuranic arquebus. Copies of the same unit are folded into one card carrying every option. | | **Drop Leader/Support** | Removes the attachment rules. Once the army is built they say nothing you need mid-game, and they are long enough to push the rules you *do* need off the card. | | **Split choice abilities** | An ability like *Canticles of the Omnissiah* arrives as one blob of text. This splits it into the intro rule plus one titled row per option, which is how the datasheets print it. | @@ -142,6 +142,21 @@ git merge upstream/main Conflicts should be confined to `src/App.jsx`, `index.html`, `vite.config.js` and `package.json`. `src/transforms/` is entirely new and will never conflict. +The fork also hides three things upstream shows, because a generic datasheet has +nothing to say with them: the roster overview card and its charts, the unit +composition, and the per-unit points cost. Those decisions live in +[`src/fork.js`](src/fork.js) - another file upstream does not have - and +`src/10th/Roster.jsx` reaches for them on as few lines as possible: + +- it imports `ShortSummaryTable` from `../fork` instead of `./ShortSummaryTable`, + a one-line change that leaves the render site untouched. The upstream + component is still in the tree, unused, so its future diffs keep applying. +- `hideModelCount` is pinned to `HIDE_UNIT_COMPOSITION` instead of being a piece + of checkbox state. + +Only the two checkboxes and the `pts` span are deleted outright, so a merge that +touches them will say so rather than quietly bringing them back. + ## Credit All the hard parts - the parsing, the card layout, the print CSS - are diff --git a/src/10th/Roster.jsx b/src/10th/Roster.jsx index 5624848..aba0d12 100644 --- a/src/10th/Roster.jsx +++ b/src/10th/Roster.jsx @@ -20,7 +20,7 @@ import { Weapons, hasDifferentProfiles } from "./Weapons"; import { useIndexedDB } from "../helpers/useIndexedDB"; // New hook for IndexedDB import { ImgEditor } from "./ImgEditor"; import { trySettingLocalStorage } from "../helpers/useLocalStorage"; -import { ShortSummaryTable } from "./ShortSummaryTable"; +import { HIDE_UNIT_COMPOSITION, ShortSummaryTable } from "../fork"; const getShortSummarySubtitle = (force) => { const details = []; @@ -183,7 +183,7 @@ const Force = ({ force, onePerPage, colorUserChoice }) => { const Unit = ({ unit, catalog, onePerPage, forceRules, colorUserChoice }) => { const [hide, setHide] = useState(false); - const [hideModelCount, setHideModelCount] = useState(false); + const hideModelCount = HIDE_UNIT_COMPOSITION; const uploadRef = useRef(); let { name, @@ -315,23 +315,6 @@ const Unit = ({ unit, catalog, onePerPage, forceRules, colorUserChoice }) => { }} >
-
setPrimaryColor(color), 50), ).current; - const toggleHideModelSelections = (hide) => { - const checkboxes = document.querySelectorAll( - 'input[type="checkbox"].hide-model-selection', - ); - checkboxes.forEach((checkbox) => { - if (checkbox.checked !== hide) { - checkbox.click(); - } - }); - }; - async function handleFileSelect(event) { const files = event?.target?.files; @@ -431,30 +419,6 @@ function App() { One Datacard per Page when Printing - { - // only show when 10th or 11th edition - (edition === 10 || edition === 11) && ( - - ) - }