Skip to content
  • Categories
  • Recent
  • Popular
  • World
Skins
  • Light
  • Dark

Collapse

NodeBB

MTO- NodeBB on Elestio

Scheduled Pinned Locked Moved Website Maintenance
83 Posts 1 Posters 338 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Grant LamontagneG
    Grant LamontagneG
    Grant Lamontagne
    administrators
    wrote on last edited by
    #31

    Found a bit of a clustersmurf this morning, but it explains a lot of why I have been trying to make fixes that won't fix. :bnghd:

    Originally I was making changes in the Custom CSS, Custom JS and Custom Header in the Admin Control Panel (ACP) but then determined that creating an MTO Theme would be a better choice over modifying an existing one, so I started working on the code itself to develop a new theme.... while forgetting to turn off the theme modifications in the ACP.

    So all the theme changes I have been making I have had to fight to get them to work because they are trying to override the things I'd already built to override things like the original, generic theme. :facepalm:

    Anyways, I have other smurf to do right now so I am going to go and do that, but when I get back I am going to clean up my mess and re-evaluate what actually needs doing now that I am done fighting with myself over it.

    For now though, the edit box should be fully visible and functional, so there's that at least.

    Def
    Def


    1 Reply Last reply
    0
    • SteveCS
      SteveCS
      SteveC
      Global Moderators
      wrote on last edited by
      #32

      First spam on new site ?

      https://nodebb-vklpj-u73921.vm.elestio.app/post-queue/topic-1787568190680

      1 Reply Last reply
      0
      • Grant LamontagneG
        Grant LamontagneG
        Grant Lamontagne
        administrators
        wrote on last edited by
        #33

        I saw that and deleted it and the spammer.

        It feels real now, doesn't it? πŸ˜„

        Def


        1 Reply Last reply
        0
        • SteveCS
          SteveCS
          SteveC
          Global Moderators
          wrote on last edited by
          #34

          @Grant Lamontagne said:
          I saw that and deleted it and the spammer.

          It feels real now, doesn't it? πŸ˜„

          Def

          I thought I'd leave the inaugural ban to you πŸ˜„

          1 Reply Last reply
          0
          • Grant LamontagneG
            Grant LamontagneG
            Grant Lamontagne
            administrators
            wrote on last edited by
            #35

            I've been keeping these daily logs of the work I have been doing but it occurred to me that I should probably be keeping them here so they are easy for Micah to find, and proof for the rest of you that I am not just sitting on my ass. πŸ˜›

            25-08-2026 Daily Log

            MTO / NodeBB β€” Daily Migration Report

            Date: 2026-08-25
            Environment: app-nodebb-1 / NodeBB / nodebb-theme-mto
            Session: ACP Custom CSS β†’ Theme ownership migration
            Status: Successful β€” stable stopping point


            1. Session objective

            Continued the migration of MTO-specific CSS out of NodeBB's ACP customCSS and into the MTO-owned theme:

            /usr/src/app/nodebb-theme-mto/theme.scss
            

            The goal is to eliminate duplicate/legacy ACP styling where the theme already provides the authoritative implementation, while preserving rollback checkpoints and validating each migration independently.


            2. Header CSS migration β€” completed

            Theme change

            Added the MTO global header implementation to:

            /usr/src/app/nodebb-theme-mto/theme.scss
            

            Inserted immediately before:

            General cards and surfaces
            

            Theme header section:

            MTO β€” Global Header
            

            It owns:

            • #mtorg-header
            • .mtorg-logo
            • .mtorg-nav
            • logo sizing
            • navigation layout
            • navigation hover/focus state
            • MTO sand/green presentation

            Theme checkpoint

            Before migration:

            8a5279b079aad34257b3ae96aaa273e88259dce3fcc27f42b88c4d2be1931b56
            

            After migration:

            f516664233cdf3be1a839d43195508fd855fd2b59b3afa846eace9df08851b02
            

            Rollback

            Created inside the theme:

            theme.scss.before-header-css-migration-20260825
            

            Original checksum:

            8a5279b079aad34257b3ae96aaa273e88259dce3fcc27f42b88c4d2be1931b56
            

            Build

            Successful:

            Asset compilation successful. Completed in 6.72sec.
            

            3. ACP header CSS removal β€” completed

            Created a rollback copy:

            ~/nodebb-backups/acp-legacy-20260824/customCSS-before-header-removal-20260825.txt
            

            Original:

            704 lines
            15930 bytes
            b23b51e4b694eae95fbce8477f69f13f416451033cab2b9d476fdb964726f705
            

            Removed the legacy:

            #mtorg-header
            .mtorg-logo
            .mtorg-nav
            

            rules, including responsive rules.

            Validated result:

            629 lines
            14182 bytes
            

            Confirmed:

            Header selectors remaining: 0
            

            Applied to Redis config customCSS.

            Live post-removal:

            627 lines
            14180 bytes
            8638ac923e1b18683683ffb2fec9f56bee38ae4d4157f7d7897a8a7a87d83d02
            

            Confirmed:

            NONE β€” clean
            

            for the former header selectors.

            Build successful.

            Restart successful.


            4. Cards / sidebars migration β€” completed

            Audited existing theme implementation.

            Theme already owned:

            .card
            .card-header
            .card-body
            

            and sidebar styling through:

            body.template-category [component="sidebar"]
            body.template-topic [data-widget-area="sidebar"]
            

            Therefore the following ACP block was determined to be legacy/duplicate:

            Cards / sidebars
            

            Removed:

            .card
            .sidebar .card
            [data-widget-area="sidebar"] .card
            .sidebar .card-header
            [data-widget-area="sidebar"] .card-header
            .sidebar .card-body
            [data-widget-area="sidebar"] .card-body
            

            Validation:

            627 β†’ 595 lines
            14180 β†’ 13358 bytes
            

            Validated SHA:

            8aa5b25a239ebe7980ab2c6857f90f14172faffa3dcb1f027b1d0fbb1f692fe6
            

            Applied to Redis.

            Live result:

            595 lines
            13358 bytes
            8aa5b25a239ebe7980ab2c6857f90f14172faffa3dcb1f027b1d0fbb1f692fe6
            

            Legacy selectors:

            NONE β€” clean
            

            Build successful.

            Restart successful.

            Browser smoke test indicated everything remained where expected.


            5. Categories / topic lists migration β€” completed

            Audited ACP rules against the theme.

            ACP legacy block included:

            .categories .category
            .categories .category-header
            .categories .category-title
            .categories .category-description
            .topic-list-item
            .topic-list-item:hover
            .topic-list-item:last-child
            .topic-list-item .title
            .topic-list-item .timeago
            .category-stat
            .topic-stats
            .lastpost
            .topic-list-item.unread
            .category .unread
            

            Theme already had equivalent category/topic ownership using:

            [component="category"]
            [component="category/list"]
            [component="topic"]
            [component="category/topic"]
            .category-header
            

            Removed the legacy category/topic block.

            Preserved intentionally for a later pass:

            .badge
            .pagination
            .page-item .page-link
            

            Validation:

            627 β†’ 568 lines
            14180 β†’ 12877 bytes
            

            Validated proposed checksum:

            c9ff7d622374ad42ce286517abacc22d2be6d2308d56f20d4da1ee1ed48d0814
            

            Applied to Redis.

            Live result:

            568 lines
            12877 bytes
            c9ff7d622374ad42ce286517abacc22d2be6d2308d56f20d4da1ee1ed48d0814
            

            Former selectors:

            NONE β€” clean
            

            Preserved rules verified:

            .badge
            .pagination
            .page-item .page-link
            

            Build successful:

            Asset compilation successful. Completed in 6.565sec.
            

            Restart successful.

            Browser check: everything appeared to be working normally.


            6. Bottom topic bar migration β€” completed

            This was the final migration of the day.

            Audited ACP:

            #mto-bottom-topic-bar
            .mto-bottom-topic-bar
            .mto-bottom-topic-row
            .mto-bottom-topic-title
            .mto-bottom-topic-reply
            

            Compared against the theme.

            The theme already owns a newer/more complete bottom topic bar implementation, including:

            • normal document flow
            • breadcrumb trail
            • reply/action area
            • responsive/mobile behavior
            • overflow handling
            • Watch dropdown stacking
            • dark mode
            • native NodeBB Watch behavior

            Important theme implementation:

            .mto-bottom-topic-bar
            .mto-bottom-topic-breadcrumbs
            .mto-bottom-topic-actions
            

            and associated responsive/dark-mode rules.

            Therefore the older ACP block was determined to be obsolete.

            Validation

            Removed only:

            Existing bottom topic bar
            

            block.

            Validation:

            568 β†’ 530 lines
            12877 β†’ 11979 bytes
            

            Validated checksum:

            f63b8e5ef859eaf1937bd21f00770882754e3271be97a3d26f86d3e5ea0fd9de
            

            Applied to Redis.

            Live result:

            530 lines
            11979 bytes
            f63b8e5ef859eaf1937bd21f00770882754e3271be97a3d26f86d3e5ea0fd9de
            

            Former selectors:

            NONE β€” clean
            

            7. Final build/restart β€” successful

            After the bottom-topic-bar migration:

            ./nodebb build
            

            completed successfully:

            Asset compilation successful. Completed in 6.625sec.
            

            Then:

            docker restart app-nodebb-1
            

            successful.

            Current containers at the checkpoint:

            elestio-nginx     Up 2 days
            app-nodebb-1      Up Less than a second
            app-redis-1       Up 2 days
            elestio-postfix   Up 2 days
            

            app-nodebb-1 came back successfully.


            8. Functional smoke test

            After the final restart, browser testing was performed.

            Confirmed:

            Topics can be watched and unwatched successfully.

            This is particularly important because the bottom-topic-bar migration involved the native NodeBB Watch control and its dropdown positioning.

            User report:

            β€œThat seems to be working. I can watch/unwatch topics”

            Therefore the critical Watch/Unwatch functionality survived the CSS ownership migration.


            9. Known build warnings

            Every build continues to report these existing warnings:

            [nodebb-plugin-blog-comments] is active but not installed.
            [nodebb-plugin-calendar] is active but not installed.
            

            These were present throughout today's builds and did not prevent successful asset compilation.

            No new build errors were introduced by today's migrations.


            10. Current theme checksum

            Current:

            f516664233cdf3be1a839d43195508fd855fd2b59b3afa846eace9df08851b02
            

            Theme:

            /usr/src/app/nodebb-theme-mto/theme.scss
            

            11. Current ACP CSS state

            The last validated/live ACP CSS is:

            530 lines
            11979 bytes
            f63b8e5ef859eaf1937bd21f00770882754e3271be97a3d26f86d3e5ea0fd9de
            

            The following legacy areas have now been removed from ACP customCSS:

            1. MTO global header
            2. Cards / sidebars
            3. Categories / topic lists
            4. Bottom topic bar
            

            12. Remaining ACP CSS

            The remaining ACP CSS is primarily the more complicated/custom structural layer.

            The last inventory showed these major areas remaining:

            Global
            Navigation
            Badge
            Pagination
            Topic/post layout
            MTO author/post structure
            Breadcrumbs
            Bottom topic controls
            Composer / smileys
            YouTube/media fallback
            Responsive rules
            Utilities
            

            The remaining ACP file was:

            530 lines
            11979 bytes
            

            after the bottom-topic-bar removal.

            Important: do NOT blindly remove the remaining CSS.

            Today's audits showed that some of the remaining ACP rules have only partial or structurally different counterparts in the theme.

            The next session should continue with ownership audits, not bulk deletion.


            13. Recommended next step tomorrow

            The most logical next investigation is:

            Composer / smileys

            The ACP still contains:

            .composer
            .composer textarea
            .mto-smiley-bar
            .mto-smiley
            .mto-smiley:hover
            .mto-smiley:focus
            topic/post smiley image sizing
            

            The theme already contains some .mto-smiley-bar and composer-related rules, so there may be another migration opportunity.

            However, this should be audited carefully because the ACP contains actual behavioral/presentation rules that may not yet have a complete theme equivalent.

            Do not remove anything until the exact ownership comparison is done.

            The YouTube fallback should probably remain untouched until separately audited because today's theme search did not establish a corresponding theme implementation.


            14. Rollback/checkpoint files created today

            Important files under:

            ~/nodebb-backups/acp-legacy-20260824/
            

            include:

            customCSS-before-header-removal-20260825.txt
            customCSS-live-before-header-removal-20260825.txt
            customCSS-live-after-header-removal-20260825.txt
            
            customCSS-live-before-card-removal-20260825.txt
            customCSS-live-after-card-removal-20260825.txt
            
            customCSS-live-before-category-topic-removal-20260825.txt
            customCSS-live-after-category-topic-removal-20260825.txt
            
            customCSS-live-before-bottom-topic-bar-removal-20260825.txt
            customCSS-live-after-bottom-topic-bar-removal-20260825.txt
            

            Theme rollback:

            /usr/src/app/nodebb-theme-mto/theme.scss.before-header-css-migration-20260825
            

            15. End-of-day status

            Overall: GREEN / stable.

            Today's work successfully moved several major pieces of MTO presentation into the theme and removed their duplicate ACP implementations.

            No known functional regression.

            The final functional test confirmed:

            Watch topic  β†’ works
            Unwatch topic β†’ works


            1 Reply Last reply
            0
            • Grant LamontagneG
              Grant LamontagneG
              Grant Lamontagne
              administrators
              wrote on last edited by
              #36

              MTO Theme Cleanup β€” Daily Log

              Date: August 26, 2026
              NodeBB: 4.15.1
              Container: app-nodebb-1
              Theme: nodebb-theme-mto
              Working directory: /usr/src/app/nodebb-theme-mto

              Objective

              Continue migrating the remaining MTO presentation/functionality into the custom Harmony-based theme, remove redundant/legacy CSS, restore native Harmony behavior where appropriate, and move toward eliminating the old NodeBB ACP Custom CSS/Header/JS layer.

              Work completed

              1. Dead quick-smiley CSS removed

              Audited all MTO references to:

              smiley
              emoji
              quick-smiley
              .mto-smiley
              .mto-smiley-bar

              Found only two obsolete CSS blocks in theme.scss and no corresponding MTO template, JS, or library implementation.

              Removed:

              .mto-smiley-bar .mto-smiley { ... }

              .mto-smiley-bar {
              display: none !important;
              }

              Result: 245 bytes / 15 lines removed.

              Final checksum after this stage:

              36f124f6ce7e6085dabb5d7ef6f641b2293b055c93985d900c4d6805f64390c0
              2. Harmony post-number behavior audited and restored

              Compared MTO's topic.tpl against the installed Harmony theme.

              Harmony provides:

              <a href="{config.relative_path}/post/{encodeURIComponent(./pid)}"
              class="post-index text-muted d-none d-md-inline">
              #{increment(./index, "1")}
              </a>

              MTO retained the native post anchor:

              <a component="post/anchor" data-index="{./index}" id="{increment(./index, "1")}"></a>

              but had lost the visible post-index link.

              Restored the post-index into:

              templates/partials/topic/post.tpl

              Then corrected the numbering behavior.

              Final desired behavior
              Original topic post (./index == 0) β†’ no visible number
              First reply (./index == 1) β†’ #1
              Subsequent replies β†’ native ./index

              Final implementation uses:

              {{{ if (./index != 0) }}}
              <a href="{config.relative_path}/post/{encodeURIComponent(./pid)}"
              class="post-index text-muted d-none d-md-inline">#{./index}</a>
              {{{ end }}}

              This was tested in the browser and confirmed to produce the desired result.

              Final post.tpl checksum:

              7f33bc6aaaf0abc33cbf096f0eb781d99488443dd60194796f6092fe0706d4e8
              3. Bottom topic bar CSS consolidated

              Audited the entire .mto-bottom-topic-bar region.

              The same selector had been declared in multiple separate blocks:

              primary layout block
              overflow block
              dropdown stacking block

              Consolidated:

              position: relative;
              z-index: 2000;
              overflow: visible !important;

              into the primary declaration.

              Removed redundant standalone declarations.

              Result:

              75 bytes removed
              mobile behavior preserved
              print behavior preserved
              Watch dropdown behavior preserved
              dropdown-specific selector retained

              Installed validated checksum:

              f55381de942ae0f44de26c01b048746311e4b9cc720cf7921e46e37cf3de5b43

              Browser verification subsequently confirmed:

              desktop good
              mobile good
              4. Bottom-bar comments cleaned

              Removed redundant/repetitive section headings around the Watch/dropdown rules.

              Functional rules were deliberately left untouched.

              Result:

              400 bytes removed
              11 lines removed
              Watch behavior preserved
              mobile behavior preserved
              print behavior preserved

              Proposed checksum after comment cleanup:

              b15ac234f403030bfa7b6180372dabce71f8289dd32dbd3c48399d15b7d8e31b

              This was then the live theme state before the next cleanup.

              1. Legacy top-breadcrumb CSS removed

              Audited the top breadcrumb against the actual Harmony breadcrumb template.

              Found an obsolete desktop block:

              .mto-top-topic-breadcrumbs {
              min-width: 0;
              overflow: hidden;
              }

              .mto-top-topic-breadcrumbs .breadcrumb {
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              }

              The active MTO implementation instead deliberately provides the flat/SMF-style breadcrumb treatment and mobile hiding.

              Removed only the obsolete overflow/ellipsis block.

              Preserved:

              mobile hiding
              transparent background
              border removal
              inline-flex breadcrumb
              breadcrumb item styling
              MTO topic-title arrow separator

              Installed checksum:

              b93e8454f8b3cd19335976c3a4d7fc593072bababc29a2189ee65da0e538edee
              Final theme architecture confirmed

              MTO is now structured as a Harmony-derived theme rather than a pile of ACP overrides.

              Important ownership:

              Function MTO location
              Base theme Harmony
              MTO CSS theme.scss
              Header/brand templates/partials/header/brand.tpl
              Post presentation templates/partials/topic/post.tpl
              Topic layout templates/topic.tpl
              Top topic controls/breadcrumb templates/partials/post_bar.tpl
              Topic JS static/lib/mto-topic-actions.js
              Theme library library.js
              Theme metadata package.json, plugin.json, theme.json

              CSS import chain confirmed:

              @import "../nodebb-theme-harmony/theme.scss";

              and:

              @import "nodebb-theme-harmony/scss/overrides";

              The MTO scss/overrides.scss is only a Harmony compatibility import; it contains no MTO-specific customization.

              MTO JS confirmed

              static/lib/mto-topic-actions.js remains the active custom JavaScript.

              It handles MTO-specific post functionality including the author/post-count behavior.

              No mto-bottom-topic-bar JavaScript dependency was found.

              Final checksum:

              325fdf96f42edcf1acf3c9d38711c4706f3a2e457c47c1319a7e0980d994fe97
              Header confirmed

              MTO has its own:

              templates/partials/header/brand.tpl

              Final checksum:

              7bef5ae6134cfffd35e3f24832c676ff694198b1e0a78607aa4833b7eef98acf

              This is part of the theme and therefore does not depend on ACP custom header content.

              Topic template confirmed

              Final:

              templates/topic.tpl

              checksum:

              290e54181bfc95c58a020874fe512901af2d1474c5a8b0e00f17d414f476ba5d
              Current final checkpoints

              As of the end of today's work:

              theme.scss
              b93e8454f8b3cd19335976c3a4d7fc593072bababc29a2189ee65da0e538edee

              templates/partials/topic/post.tpl
              7f33bc6aaaf0abc33cbf096f0eb781d99488443dd60194796f6092fe0706d4e8

              static/lib/mto-topic-actions.js
              325fdf96f42edcf1acf3c9d38711c4706f3a2e457c47c1319a7e0980d994fe97

              templates/partials/header/brand.tpl
              7bef5ae6134cfffd35e3f24832c676ff694198b1e0a78607aa4833b7eef98acf

              templates/topic.tpl
              290e54181bfc95c58a020874fe512901af2d1474c5a8b0e00f17d414f476ba5d

              NodeBB: 4.15.1

              ACP handoff status

              This is the only significant unfinished item.

              We attempted to determine whether NodeBB's ACP Custom CSS / Custom JS / Custom HTML settings were still populated.

              ./nodebb config get returned empty results, but that was determined to be insufficient evidence.

              A direct meta.configs.get() attempt also failed to produce the expected config object and generated a Winston logging warning.

              config.json was inspected and confirmed to contain the Redis connection configuration, but does not contain the ACP customization values.

              Therefore:

              Do NOT disable or delete the ACP customization layer yet.

              The actual ACP settings appear to be stored in NodeBB's Redis-backed settings/configuration rather than config.json.

              Recommended next session

              The next instance should start here, not redo the CSS cleanup.

              Priority 1 β€” Locate actual persisted ACP settings

              Find the Redis-backed NodeBB settings corresponding to:

              useCustomCSS
              customCSS
              useCustomJS
              customJS
              useCustomHTML
              customHTML

              Read-only first.

              Priority 2 β€” Compare ACP contents against MTO ownership

              Classify every ACP customization:

              REMOVE β€” already implemented by MTO
              KEEP β€” still genuinely required
              MOVE β€” functionality not yet migrated
              OBSOLETE β€” experimental/dead code
              Priority 3 β€” Only then disable ACP customization

              Before changing anything:

              checkpoint current Redis values
              disable the redundant ACP layers
              rebuild/restart NodeBB if required
              verify desktop
              verify mobile
              verify dark mode
              verify topic posting/reply/watch/share/mark-unread
              verify post numbering
              verify header
              verify no missing custom behavior
              Important

              Do not start another broad theme.scss cleanup.

              The theme is in a good, working state. The remaining work is infrastructure/handoff, not cosmetic cleanup.

              End-of-day status

              MTO theme cleanup: βœ… Essentially complete
              Post numbering: βœ… Correct
              Bottom bar: βœ… Cleaned and verified
              Top breadcrumbs: βœ… Cleaned and verified
              Mobile: βœ… Verified
              Desktop: βœ… Verified
              Harmony integration: βœ… Confirmed
              MTO JS/header ownership: βœ… Confirmed
              ACP CSS/JS/header retirement: ⏳ Final remaining task
              Working rollback/checkpoints: βœ… Preserved

              Best stopping point: leave the current live theme untouched and resume with the Redis-backed ACP settings audit.


              1 Reply Last reply
              0
              • Grant LamontagneG
                Grant LamontagneG
                Grant Lamontagne
                administrators
                wrote on last edited by
                #37

                31-08-2026 Daily Log

                MultiTool.Org NodeBB Theme β€” Daily Log / Handoff

                Date: 2026-08-31
                Session: End of day
                Current status: 🟒 Good stopping point

                1. Where we started

                The project is a custom NodeBB theme for MultiTool.Org, with the goal of getting the UI closer to the site's preferred/older visual language while fixing several NodeBB/Harmony layout annoyances.

                The immediate work over the last stretch has concentrated on:

                • post/topic layout
                • the bottom topic navigation/footer
                • the standalone NodeBB Composer/reply page
                • dark mode
                • getting the theme controls into a globally consistent location
                • avoiding the giant blank-space problems we'd been seeing

                2. Major wins completed

                A. Fixed the topic-page bottom bar/footer

                We had been fighting a floating/badly positioned footer/bottom action area that could leave a ridiculous amount of empty space underneath it.

                The current implementation is working correctly.

                Browser testing showed:

                • footer is at the bottom where it belongs
                • no giant empty area beneath it
                • topic page looks substantially cleaner
                • the bottom topic controls remain usable

                This was explicitly tested visually and declared a win.

                The current live theme contains the post-footer styling around theme.scss line ~584 and the topic template still contains the normal widget footer area.

                Do not casually rewrite this tomorrow. It is currently working.


                B. Fixed / improved the standalone Composer/reply page

                We discovered that clicking Reply takes us to the native NodeBB Composer route rather than simply opening an inline editor.

                We deliberately styled that page rather than trying to force the ordinary topic Composer rules onto it.

                The current theme has a dedicated body.page-compose section covering:

                • overall compose-page layout
                • composer positioning
                • composer container
                • reply context
                • formatting bar
                • writing area
                • preview
                • action bar
                • sidebar
                • responsive/mobile behavior

                The CSS itself explicitly documents the distinction between the native Composer route and ordinary topic Composer instances.

                Browser testing produced a very good-looking reply page with:

                • proper header
                • clean "Post a Reply" presentation
                • properly contained editor
                • preview area
                • Community Links sidebar
                • no giant blank space underneath

                This was the second big win of the evening.

                Again: don't start ripping apart the Composer CSS tomorrow. It is currently a success.


                3. Dark Mode β€” major change completed

                Originally the light/dark switch existed only on topic pages.

                We decided that was wrong because theme selection is a global preference, not a topic-specific function.

                The control has now been moved into the global header.

                Current brand.tpl contains the global light/dark-mode import:

                <!-- Global light / dark mode -->
                <!-- IMPORT partials/topic/dark-mode.tpl -->
                

                The audit confirms this is currently in the global header.

                Result

                The screenshots show the switch now appearing in the top navigation on:

                • Home
                • Category pages
                • Topic pages
                • presumably the standalone Composer page as well, because it uses the global header

                And importantly, it looks good in both modes.

                Light mode

                The current light homepage has:

                • MultiTool logo
                • Home / Search / Profile / Notifications / Bookmarks / Members
                • dark-mode control at the right
                • category listing
                • Community Links
                • sane page height

                Dark mode

                The dark homepage now has:

                • dark global page background
                • dark header
                • dark content surfaces
                • readable green/blue/orange accents
                • theme control in the header
                • navigation remaining visible
                • Community Links correctly styled

                The category page and topic page were also visually checked in dark mode.

                This was the other major win.


                4. Dark-mode implementation details

                The actual theme switch implementation is still in:

                templates/partials/topic/dark-mode.tpl
                

                Despite the topic directory name, this is NOT dead code.

                It is now imported by the global header, so its filename is historical rather than indicative of its scope.

                The JavaScript in that template:

                • finds the toggle
                • reads/applies the selected theme
                • sets data-bs-theme
                • updates the checkbox state
                • updates the slider state

                The audit confirms those references.

                The current theme.scss contains the switch styling around lines 1340 onward and the actual [data-bs-theme="dark"] styling beginning around 1189.

                There are also later dark-mode finishing overrides dealing with Bootstrap/Harmony inheritance, post containers, navigation surfaces, the bottom topic bar, etc.

                Important design decision

                We decided the toggle belongs globally in the header/top menu, rather than keeping a special topic-page control.

                That should also make the behavior much more sensible on mobile.


                5. Header/navigation state

                The theme now owns the global MultiTool header presentation.

                Current header CSS begins around line 100 and defines:

                • #mtorg-header
                • logo
                • .mtorg-nav
                • icon-over-label navigation
                • hover/focus states
                • mobile stacking/wrapping

                The mobile breakpoint is already present at 767.98px.

                The current visual navigation is:

                Home | Search | Profile | Notifications | Bookmarks | Members | Dark Mode

                That is currently looking good.


                6. NodeBB/container state

                We restarted the container:

                docker restart app-nodebb-1
                

                It successfully restarted.

                The running process tree afterward was:

                node ./nodebb start
                /usr/local/bin/node /usr/src/app/loader.js
                /usr/local/bin/node /usr/src/app/app.js
                

                So NodeBB was up normally after the restart.

                The restart was therefore successful and the subsequent browser testing was against the running application.


                7. What we deliberately did NOT do

                This is important for tomorrow's instance.

                We have not done the advertising/layout pass yet.

                The decision at the end of the successful visual testing was essentially:

                We've got two good wins. Don't screw them up. Do the advertising/layout pass tomorrow.

                So tomorrow's work should begin from the assumption that:

                footer + Composer + global dark mode are working and should be preserved.

                Don't treat them as unfinished merely because the broader theme isn't finished.


                8. End-of-day cleanup audit

                We then ran a read-only cleanup audit.

                The audit explicitly made no changes.

                The live theme files are currently:

                library.js
                package.json
                plugin.json
                scss/overrides.scss
                static/lib/mto-topic-actions.js
                templates/partials/post_bar.tpl
                templates/topic.tpl
                templates/partials/header/brand.tpl
                templates/partials/topic/dark-mode.tpl
                theme.json
                theme.scss
                

                The audit's initial file listing showed the core set, with the template tree containing the other files referenced by the grep output.


                9. Cleanup opportunity identified

                We discovered that the theme directory has accumulated a pile of historical working copies/backups.

                Examples include:

                theme.scss.bottom-bar-working
                theme.scss.before-cleanup
                theme.scss.corrupt-backup
                theme.scss.before-quote-style
                theme.scss.before-header-css-migration-20260825
                theme.scss.before-user-panel
                theme.scss.before-avatar-size
                theme.scss.before-mobile-identity
                
                templates/topic.tpl.before-bookmark-removal-20260825
                templates/topic.tpl.bottom-bar-working
                templates/topic.tpl.before-bottom-bar
                
                templates/partials/topic/post.tpl.before-quote-reorder
                templates/partials/topic/post.tpl.before-avatar-size
                templates/partials/topic/post.tpl.before-author-panel
                templates/partials/topic/post.tpl.before-mobile-identity
                templates/partials/topic/post.tpl.checkpoint-author-layout
                
                static/lib/mto-topic-actions.js.before-bookmark-removal-20260825
                static/lib/mto-topic-actions.js.before-direct-bookmark-20260824
                static/lib/mto-topic-actions.js.bookmark-fix-final-20260824
                static/lib/mto-topic-actions.js.before-bookmark-fix-20260824
                static/lib/mto-topic-actions.js.before-post-counts-20260824
                

                The audit confirms these are old historical copies, with timestamps going back to August 12–26.

                Decision

                We have not deleted them yet.

                The proposed cleanup is:

                1. Make one known-good current checkpoint/archive.
                2. Delete the obsolete individual .before-*, .working, .corrupt-backup, etc. files.
                3. Keep the actual live files clean.
                4. Going forward, don't accumulate a new backup file for every experiment.

                That is housekeeping, not a code change.


                10. Things we specifically decided NOT to clean up tonight

                Don't refactor theme.scss yet

                theme.scss is now around 1,800 lines and contains a lot of accumulated CSS.

                There are almost certainly opportunities to consolidate duplicate selectors/overrides.

                But do not undertake that tonight/tomorrow morning blindly.

                The dark-mode CSS has several layers of intentional overrides because Bootstrap/Harmony is fighting us in places.

                A visual refactor should happen later, when we can test each change.

                Don't remove dark-mode.tpl

                Even though its directory name says topic, it is now globally imported and is doing useful work.

                Don't remove current footer code

                The current footer behavior is one of today's successes.

                Don't remove current Composer code

                The standalone Composer styling is also a success.

                Don't touch mto-topic-actions.js merely because old copies exist

                The current JS file is the live one:

                static/lib/mto-topic-actions.js
                

                The audit records its checksum as:

                325fdf96f42edcf1acf3c9d38711c4706f3a2e457c47c1319a7e0980d994fe97
                

                The old JS copies are what should eventually be cleaned out.


                11. Current known-good state

                As of the end of this session:

                🟒 Working

                • Global MultiTool header
                • Header navigation
                • Mobile header structure
                • Global dark-mode control
                • Light mode
                • Dark mode
                • Homepage/category dark-mode appearance
                • Topic dark-mode appearance
                • Topic bottom action/footer area
                • Standalone Reply/Composer page
                • Composer responsive layout
                • Community Links sidebar
                • No huge footer whitespace
                • No huge Composer whitespace
                • NodeBB running after restart

                🟑 Deliberately deferred

                • Advertising/layout pass
                • Broader visual polish
                • More extensive mobile testing
                • CSS consolidation/refactoring
                • Final cleanup of historical backup files
                • Any larger architectural cleanup

                πŸ”΄ Not currently a problem

                Nothing from today's browser testing suggests that we need to roll back the work.


                12. Recommended starting point tomorrow

                I'd start tomorrow in this order:

                Step 1 β€” Preserve tonight's win

                Make one checkpoint of the current working theme.

                Step 2 β€” Remove the archaeological layers

                Delete the obsolete backup/working files after the checkpoint.

                Step 3 β€” Do the advertising/layout pass

                This was explicitly deferred until tomorrow.

                Step 4 β€” Test the global theme control on the pages we care about

                At minimum:

                • Home
                • Category
                • Topic
                • Reply/Composer
                • mobile viewport

                Step 5 β€” Only then consider CSS cleanup

                Look for:

                • duplicate selectors
                • superseded overrides
                • comments referring to changes that no longer exist
                • rules that are no longer needed
                • old temporary experiments

                But one cleanup at a time, browser test after each meaningful group.


                13. One-sentence handoff

                If I had to give tomorrow's instance the whole state in one paragraph:

                MultiTool.Org's custom NodeBB theme had two major successful fixes today: the topic bottom/footer layout and standalone Reply/Composer page are now clean with no giant empty-space problems, and the dark-mode toggle was moved from the topic template into the global header so light/dark mode is available throughout the site; Home, Category, Topic and dark-mode views were visually tested and look good, NodeBB was restarted successfully, the advertising/layout pass is intentionally deferred to tomorrow, and the only immediate housekeeping task is to checkpoint the working theme and remove the pile of old .before-*/.working/backup files without touching the current working CSS or templates.


                1 Reply Last reply
                0
                • Grant LamontagneG
                  Grant LamontagneG
                  Grant Lamontagne
                  administrators
                  wrote on last edited by
                  #38

                  I have fixed the colors that no one but me seemed to like. I have made a secondary reply page, similar to SMF, which will eventually be populated with smileys. I have put the toggle for Dark Mode at the top so it's accessible and available on each page, rather than just at the bottom of threads, and I got rid of that sticky floating footer thing that was such a huge annoyance that I decided a separate page for replying was better than any continued smurfery.

                  Plus that's the way we do it here anyway, so I guess it would have been done sooner or later.

                  There should be more visible changes over the next few days now that the cleanup is (mostly) out of the way, so any additional fixes or issues that you see, please let me know.

                  Def


                  1 Reply Last reply
                  0
                  • Grant LamontagneG
                    Grant LamontagneG
                    Grant Lamontagne
                    administrators
                    wrote on last edited by
                    #39

                    Multitool.Org / NodeBB β€” Daily Handoff Log

                    Date: 2026-09-01
                    Project: Multitool.Org self-hosted NodeBB forum
                    Environment: Docker / Elestio
                    NodeBB: 4.15.1
                    Container: app-nodebb-1
                    Theme: /usr/src/app/nodebb-theme-mto
                    Primary stylesheet: /usr/src/app/nodebb-theme-mto/theme.scss

                    1. Today's objective

                    Continue moving the MTO NodeBB UI toward the visual/UX feel of the old SMF forum while:

                    preserving native NodeBB functionality;
                    maintaining responsive/mobile behavior;
                    consolidating styling into the custom child theme;
                    avoiding unnecessary ACP Custom CSS/JS;
                    making reversible, incremental changes;
                    keeping the codebase clean enough to maintain later.
                    2. Completed today
                    A. SMF-style quote treatment β€” DONE
                    Problem

                    NodeBB was presenting quoted material as a large secondary card/block, which looked visually heavy and consumed unnecessary vertical space.

                    The original MTO CSS treated:

                    [component="post/parent"]

                    as though it were the quote body.

                    Investigation showed that this element is actually NodeBB's small parent-post preview/button, not the actual quote.

                    The actual quoted material is rendered as:

                    <blockquote>
                    <p>...</p>
                    </blockquote>

                    inside:

                    [component="post/content"]
                    Solution

                    The MTO theme now:

                    hides Harmony's duplicate parent-post preview;
                    styles the actual <blockquote>;
                    removes the card/background treatment;
                    uses a thin vertical quote indicator;
                    reduces font size;
                    keeps quoted text muted;
                    preserves links;
                    has a smaller mobile treatment.

                    Current permanent CSS:

                    /* =========================================================
                    MTO quote treatment
                    Use the actual blockquote as the quoted context.
                    Hide Harmony's duplicate parent-post preview.
                    ========================================================= */

                    body.template-topic [component="post/parent"] {
                    display: none !important;
                    }

                    body.template-topic [component="post/content"] > blockquote {
                    margin: 0.35rem 0 0.8rem 0 !important;
                    padding: 0.2rem 0 0.2rem 0.7rem !important;
                    background: transparent !important;
                    border: 0 !important;
                    border-left: 2px solid var(--mto-border-dark) !important;
                    border-radius: 0 !important;
                    box-shadow: none !important;
                    color: var(--mto-muted) !important;
                    font-size: 0.8125rem !important;
                    line-height: 1.4 !important;
                    }

                    body.template-topic [component="post/content"] > blockquote p {
                    margin: 0 !important;
                    color: var(--mto-muted) !important;
                    font-size: 0.8125rem !important;
                    line-height: 1.4 !important;
                    }

                    body.template-topic [component="post/content"] > blockquote a {
                    color: var(--mto-green) !important;
                    }

                    body.template-topic [component="post/content"] > blockquote a:hover {
                    color: var(--mto-orange) !important;
                    }

                    @media (max-width: 991.98px) {
                    body.template-topic [component="post/content"] > blockquote {
                    margin: 0.25rem 0 0.65rem 0 !important;
                    padding: 0.15rem 0 0.15rem 0.55rem !important;
                    font-size: 0.78rem !important;
                    line-height: 1.35 !important;
                    }

                    body.template-topic [component="post/content"] > blockquote p {
                        font-size: 0.78rem !important;
                        line-height: 1.35 !important;
                    }
                    

                    }
                    Result

                    Visually successful.

                    The quote now reads as quoted context within the reply, rather than another post/card.

                    B. Removed redundant "1 Reply / Last reply..." box β€” DONE
                    Problem

                    Posts could display a box such as:

                    1 Reply Β· Last reply about 4 hours ago

                    Clicking it produced another rendering of a reply further down the thread.

                    This was:

                    redundant;
                    confusing;
                    taking up space;
                    contrary to the desired dense SMF-style presentation.
                    Investigation

                    The actual NodeBB element was identified as:

                    <a component="post/reply-count" ...>

                    rather than the initially guessed:

                    [component="post/summary"]
                    Working CSS

                    Temporary browser test confirmed this exact selector works:

                    body.template-topic [component="post/reply-count"] {
                    display: none !important;
                    }
                    Permanent version

                    This was added to theme.scss:

                    /* =========================================================
                    MTO topic cleanup
                    Hide Harmony's embedded reply-count summary.
                    The actual replies remain fully functional.
                    ========================================================= */

                    body.template-topic [component="post/reply-count"] {
                    display: none !important;
                    }
                    Important

                    This only hides the redundant reply-count UI.

                    It does not intentionally disable:

                    Reply;
                    Quote;
                    Post tools;
                    actual replies;
                    topic functionality.

                    The user subsequently confirmed that Reply/Quote were working.

                    1. Backups created today

                    Quote backup:

                    theme.scss.backup-quote-20260901-184928

                    Reply-count backup was created by the permanent-install command as:

                    theme.scss.backup-reply-count-YYYYMMDD-HHMMSS

                    Do not delete these yet.

                    Eventually the project should have a cleaner archival/checkpoint strategy rather than accumulating timestamped backup files in the theme source directory.

                    1. Git state

                    At the quote checkpoint:

                    M theme.scss
                    ?? theme.scss.backup-quote-20260901-184928

                    The quote diff was limited to the intended quote treatment.

                    After the reply-count change, theme.scss contains the additional post/reply-count rule.

                    Before the next major change, inspect:

                    cd /usr/src/app/nodebb-theme-mto
                    git status --short
                    git diff -- theme.scss

                    Do not assume the working tree is clean.

                    1. Important discovery from today's debugging

                    This is worth preserving for future work.

                    NodeBB quote structure

                    The relevant DOM structure is approximately:

                    <div component="post/parent" ...>
                    ...
                    <div component="post/parent/content">
                    <p>quoted preview...</p>
                    </div>
                    </div>

                    <div component="post/content">
                    <p>root <a>said</a>:</p>

                    <blockquote>
                        <p>actual quoted text...</p>
                    </blockquote>
                    
                    <p>actual reply...</p>
                    

                    </div>

                    Therefore:

                    Do not confuse post/parent with the actual quote body.

                    The actual quote is the <blockquote> inside post/content.

                    This distinction saved us from continuing to style the wrong element.

                    1. Current visual direction

                    The target remains an SMF-inspired NodeBB, not a literal SMF clone.

                    Desired characteristics:

                    compact;
                    information dense;
                    broad post content;
                    relatively narrow author column;
                    restrained borders;
                    less "card-based" Harmony appearance;
                    green/olive MTO branding;
                    light/dark themes that feel related;
                    useful sidebar/ad space;
                    native NodeBB responsiveness;
                    native NodeBB functionality wherever practical.

                    The user supplied SMF reference screenshots showing:

                    compact header/navigation;
                    dense category rows;
                    dense topic lists;
                    avatar/author column on topic posts;
                    broad post body;
                    embedded quote context;
                    sidebar space;
                    banner/ad areas.
                    7. Existing work from previous sessions

                    These are important because future changes should not accidentally undo them.

                    Header

                    Custom MTO global header exists, with:

                    logo;
                    Home;
                    Categories;
                    Members;
                    Bookmarks;
                    Search;
                    Login/Register;
                    global light/dark toggle.

                    The dark-mode toggle was moved from topic-only behavior to the global header and tested on forum index/category pages.

                    Topic layout

                    Topic/sidebar proportions have been adjusted toward approximately:

                    80% topic
                    20% sidebar

                    rather than Harmony's default 75/25.

                    There is also a deliberate ~3rem relationship/margin around topic action bars to align them visually with the post content width.

                    Post counts

                    MTO has work in place to display:

                    Posts: N

                    under the author name.

                    There was a known issue around dynamically loaded posts, and action:posts.loaded was being used to update counts.

                    Future work should verify that the handler uses the event's supplied post data where appropriate rather than relying only on initial ajaxify.data.posts.

                    Post numbering

                    Desired behavior:

                    main/original topic post: no #1
                    first reply: #1
                    second reply: #2
                    etc.

                    This was being handled at the template level.

                    Native post actions

                    Native:

                    Reply
                    Quote
                    Post tools
                    Watch/follow
                    Share
                    Print

                    should remain functional.

                    Do not replace native behavior unnecessarily.

                    1. Known unresolved items
                      A. Composer

                    The composer has been the most troublesome area.

                    NodeBB's default composer is fixed/full-viewport and is appended to document.body.

                    A CSS-only attempt to make it a normal inline element caused large blank-space/positioning problems.

                    NodeBB's composer resize code also manipulates inline positioning and content padding.

                    Do not casually revisit composer CSS without first inspecting its actual DOM/JS behavior.

                    The desired eventual result is more like a conventional SMF reply area:

                    normal-sized large textarea;
                    sensible positioning;
                    previous posts visible;
                    potentially ad space;
                    mobile friendly.

                    But this should be treated as a separate project.

                    B. Post action dropdown clipping

                    There has been a known issue where the native post-tools dropdown can be clipped on short posts.

                    Inspection previously found:

                    [component="post"]
                    .post-container

                    among ancestors with overflow: hidden.

                    Making overflow visible temporarily improved dropdown behavior.

                    However, this should be handled carefully so it doesn't destabilize post layout or editing.

                    C. Post editing

                    Editing a short post has occasionally caused the editor to appear under subsequent posts.

                    Likely related to positioning/overflow/composer behavior.

                    Not solved yet.

                    D. Dark-mode polish

                    Dark mode works globally, but there are still some palette/cascade issues to address eventually:

                    some outer/gutter areas have remained light;
                    some list backgrounds remain light;
                    dark-mode green links were initially too dark;
                    CSS variable overrides were being overridden by a later stylesheet.

                    Important discovery:

                    A computed-style inspection showed MTO dark variables were being overridden by a later stylesheet containing :root declarations.

                    Therefore future dark-mode fixes may need:

                    stronger specificity;
                    later placement;
                    or another deliberate cascade strategy.

                    Do not assume the current [data-bs-theme=dark] variables automatically win.

                    1. ACP cleanup still planned

                    There is a substantial legacy ACP Custom CSS and ACP Custom JS implementation.

                    They have been backed up.

                    Long-term goal:

                    Move required MTO functionality into the child theme and then remove/disable redundant ACP code.

                    Do not remove ACP CSS/JS casually yet.

                    First establish that the corresponding theme implementation fully replaces it.

                    Same applies to the custom global header currently injected through ACP Custom Header/Custom HTML.

                    Long-term desired location:

                    nodebb-theme-mto
                    └── templates
                    └── partials / brand.tpl

                    or the appropriate Harmony child-theme template override.

                    1. Future roadmap

                    Suggested order when work resumes:

                    Priority 1 β€” Preserve functionality

                    Before visual work:

                    verify Reply;
                    verify Quote;
                    verify editing;
                    verify post tools;
                    verify watching;
                    verify mobile.
                    Priority 2 β€” Category/topic density

                    Move the topic/category pages further toward SMF:

                    tighter row spacing;
                    cleaner metadata;
                    stronger topic/title hierarchy;
                    compact pagination;
                    less Harmony card feeling.
                    Priority 3 β€” Post layout

                    Continue refining:

                    author column;
                    post body width;
                    post spacing;
                    action bars;
                    post separators;
                    signatures.
                    Priority 4 β€” Sidebar

                    Eventually add:

                    Community Links;
                    Sponsors box;
                    banner/ad space;
                    appropriate responsive behavior.
                    Priority 5 β€” Header/footer

                    Further SMF-inspired polish:

                    compact navigation;
                    social icons;
                    footer structure;
                    banner/ad slot.
                    Priority 6 β€” Composer

                    Treat as its own controlled project.

                    Priority 7 β€” ACP cleanup

                    Once theme functionality is stable:

                    migrate remaining required code;
                    disable redundant ACP Custom CSS;
                    disable redundant ACP Custom JS;
                    migrate header;
                    archive old code cleanly.
                    11. Working philosophy

                    Do not optimize aesthetics at the expense of native NodeBB functionality.

                    Preferred workflow:

                    Identify actual DOM/template structure.
                    Test a change live in browser when practical.
                    If successful, put it in theme.scss/theme template.
                    Back up before permanent modification.
                    Build.
                    Restart only when necessary.
                    Hard refresh.
                    Test functionality.
                    Check Git diff.
                    Establish a checkpoint.

                    Avoid:

                    editing compiled build/public/client.css directly;
                    piling on ACP Custom CSS;
                    duplicate JS implementations;
                    speculative selectors;
                    changing several unrelated things at once.
                    12. Current stopping point

                    The forum is in a better state than at the start of the session.

                    The two visual changes completed today are:

                    Quote = compact embedded context

                    and

                    Reply summary box = hidden

                    Both have been browser-tested.

                    The user explicitly chose to stop here for the day.

                    Next session starting instruction

                    Do not immediately start changing things.


                    1 Reply Last reply
                    0
                    • Grant LamontagneG
                      Grant LamontagneG
                      Grant Lamontagne
                      administrators
                      wrote on last edited by
                      #40

                      I forgot yesterday's daily log. Sorry.

                      MTO β€” Daily Log / Handoff

                      Date: September 2, 2026
                      Project: Multitool.Org NodeBB rebuild/customization
                      NodeBB: 4.15.1
                      Theme: nodebb-theme-mto / Harmony-derived
                      Current test domain: https://multitool.ninja
                      Canonical NodeBB config URL: still https://nodebb-vklpj-u73921.vm.elestio.app β€” intentionally unchanged

                      🟒 COMPLETED / WORKING

                      1. Topic/sidebar width β†’ 85/15

                      We changed the desktop topic layout from the previous 80/20 target to:

                      Topic/post area: 85%
                      Sidebar: 15%

                      The additional 24px width on the topic's breadcrumb/action/reply bars was also made permanent.

                      Status: βœ… Done and approved by eyeball test.

                      There is a duplicate copy of the +24px alignment CSS in theme.scss. It is harmless, but should eventually be cleaned up.

                      1. Category/topic list density

                      We tightened the vertical spacing on topic/category rows.

                      Permanent change:

                      .topics-list category items reduced to 10px top/bottom padding.

                      Status: βœ… Done.

                      1. Category header tightened

                      Reduced the category header spacing/padding.

                      Status: βœ… Done.

                      1. Composer Submit button moved to bottom

                      This was one of the bigger little victories.

                      NodeBB's native composer originally had the Submit action up in the top action area. We moved the native submit container to the bottom of the composer using:

                      static/lib/mto-topic-actions.js

                      The JavaScript watches for the composer being loaded and handles the dynamically created composer.

                      CSS puts the button on the bottom/right.

                      Status: βœ… Permanent and tested.

                      The native button still has NodeBB's checkmark and current labeling behavior. We decided not to mess with changing its text because...

                      ⚠️ Important historical footnote

                      We tried a MutationObserver-based approach to change the button text.

                      It caused a site-wide hang because the observer effectively chased its own tail.

                      That code was removed.

                      DO NOT resurrect that approach.

                      Backups exist:

                      mto-topic-actions.js.backup-composer-20260902-115803
                      mto-topic-actions.js.backup-reply-label-20260902-121335
                      theme.scss.backup-composer-20260902-115803

                      The current simple composer-move code is the good stuff.

                      🟒 5. Quote styling

                      We changed NodeBB's topic quotes to look much more like the old MTO/SMF presentation:

                      Removed the large Harmony quote box treatment.
                      Removed the parent-post display.
                      Added a simple left border.
                      Smaller/muted text.
                      Tight spacing.
                      Green links, orange hover.
                      Mobile gets slightly smaller spacing/text.

                      Status: βœ… Permanent.

                      🟒 6. Harmony reply-count summary hidden

                      We hid:

                      [component="post/reply-count"]

                      because it was adding UI that wasn't useful for the MTO look.

                      Status: βœ… Done.

                      🟒 7. Post footer/signature compacted

                      We tightened:

                      post footer padding
                      signature spacing
                      signature paragraph margins
                      footer action spacing

                      This helped make the posts much denser and more SMF-like.

                      Status: βœ… Done.

                      🟒 8. Author panel rebuilt

                      This was another major visual change.

                      The post author column is now:

                      ~145px wide
                      light grey background
                      darker dividing border
                      centered content
                      128px avatar area
                      80px actual avatar
                      username emphasized
                      post count underneath

                      We also added the divider between the author panel and post body.

                      Status: βœ… Approved.

                      Deferred

                      We deliberately didn't hard-code SMF-style member ranks/groups yet.

                      Those should come from the eventual SMF data/import rather than us inventing them now.

                      Default-avatar work is also deferred.

                      🟒 9. Post action menus no longer get clipped

                      We found that the post action menu could be clipped by the post/container overflow rules.

                      Permanent fix:

                      body.template-topic [component="post"],
                      body.template-topic [component="post"] .post-container {
                      overflow: visible !important;
                      }

                      Tested against:

                      short posts
                      long posts

                      Status: βœ… Confirmed working.

                      🟒 10. Mobile blue navigator/progress bar β€” KILLED WITH EXTREME PREJUDICE

                      NodeBB was displaying the blue mobile navigator/progress thing β€” the one showing something like:

                      39 out of 40

                      We tracked it to:

                      .navigator-mobile

                      and hid it on mobile.

                      Desktop pagination navigator was also hidden.

                      The actual pagination controls remain available as desired.

                      Status: βœ… DONE.

                      You tested this on the actual phone, and the blue bar was gone.

                      This one is officially closed.

                      🟒 11. NodeBB pagination enabled

                      We went into:

                      ACP β†’ Settings β†’ Pagination

                      and enabled pagination.

                      Current settings:

                      Setting Value
                      Posts per Page 20
                      Maximum Posts per Page 20
                      Topics per Page 20
                      Maximum Topics per Page 20
                      Categories per Page 50

                      You said you're happy with 20 posts/page.

                      This is important because we had previously been considering the infinite-scroll behavior, and you made it clear that you do not want infinite scrolling, especially on giant threads.

                      Status: βœ… DONE.

                      If necessary later, 25 is an easy change, but there is currently no reason to touch it.

                      🟑 CURRENTLY UNDER INVESTIGATION: SMF-STYLE REPLY PAGE HISTORY

                      This is where we stopped.

                      The goal is to reproduce an important old SMF behavior.

                      When you're replying from, say, page 16 of a 112-page topic, the reply/composer page should show the posts surrounding the page you were readingβ€”not just some generic latest-post summary.

                      Your desired starting point is:

                      Show the 20 posts from the page the user was replying from, newest β†’ oldest, below the composer.

                      And:

                      works on desktop
                      works on mobile
                      respects the new 20-post pagination
                      ideally preserves the current page context
                      final topic page naturally shows the final/latest 20

                      You said we'd consider 10 or 15 if performance becomes an issue, but 20 is the starting target.

                      What we discovered
                      NodeBB already knows how to retrieve a post by topic index

                      We found this in NodeBB's socket post handling.

                      There is already:

                      SocketPosts.getPostSummaryByIndex

                      which ultimately gets a post based on:

                      topic ID
                      post index
                      sort order

                      That is exactly the sort of machinery we need.

                      So we're not trying to invent a way for NodeBB to understand topic position.

                      That's good news.

                      NodeBB's summary function isn't the problem

                      We inspected:

                      /usr/src/app/src/posts/summary.js

                      The important discovery is that:

                      Posts.getPostSummaryByPids(...)

                      doesn't decide which posts to show.

                      It receives the PIDs and then:

                      fetches them
                      parses them
                      enriches them
                      returns the summaries

                      So the real question is:

                      How do we give the composer the correct 20 PIDs/indexes?

                      That's much more manageable.

                      The current Reply link only carries the topic ID

                      Harmony's reply link currently looks essentially like:

                      <a href="{config.relative_path}/compose?tid={tid}" ...>

                      So when you click Reply, NodeBB knows:

                      "I'm replying to topic 9."

                      But it doesn't appear to know:

                      "I came here from page 16."

                      We confirmed the /compose URL

                      Browser testing showed:

                      /compose?tid=9&title=...

                      and the composer page's ajaxify.data had:

                      tid = 9
                      no useful pid
                      no page
                      no postcount
                      no sort information

                      So the originating page context is currently being lost when Reply is clicked.

                      That's probably the first piece we need to solve.

                      πŸ”Ž NEXT TECHNICAL STEP

                      We had just reached the point of inspecting NodeBB's reply handling in:

                      /usr/src/app/public/src/client/topic/postTools.js

                      Specifically:

                      docker exec app-nodebb-1 sh -lc 'sed -n "250,345p" /usr/src/app/public/src/client/topic/postTools.js'

                      The reason for this is simple:

                      We want to see what information NodeBB has at the exact moment the Reply button is clicked.

                      If the clicked post/page/index is accessible there, there's a very good chance we can do this with the existing MTO client JS rather than creating another plugin.

                      🟑 BBCode β€” DELIBERATELY PARKED

                      We also did a fair amount of investigation here, but we explicitly decided not to start implementing it yet.

                      Current SMF tags were catalogued.

                      Your important ones are:

                      
                      [b]
                      [i]
                      [u]
                      [s]
                      [spoiler]
                      [img]
                      [code]
                      
                      [quote]
                      [url]
                      
                      Potentially useful cheap additions:
                      
                      [pre]
                      
                      ---
                      
                      
                      
                      
                      
                      
                      
                      You don't particularly care about preserving old font-size/color formatting, provided the actual text survives.
                      
                      Important BBCode discovery
                      
                      NodeBB currently does not parse the old SMF  syntax.
                      
                      We confirmed this by seeing the literal:
                      
                      
                      
                      in a post.
                      
                      That's actually useful because it tells us the compatibility layer is genuinely needed.
                      
                      Plugin research
                      
                      We found an old nodebb-plugin-bbcodes, but it's roughly 11 years old and geared around an older WysiBB/composer ecosystem.
                      
                      Given we're on NodeBB 4.15.1:
                      
                      We do not want to throw that ancient plugin into production and see what catches fire.
                      
                      There were also old BBCode-to-Markdown/vBulletin migration plugins, but those aren't what we want either.
                      
                      The likely eventual approach is a small MTO-specific compatibility layer, probably extending the existing Markdown parsing pipeline rather than trying to bolt an archaeological NodeBB plugin onto 4.15.1.
                      
                      But:
                      
                      BBCode day is tomorrow.
                      
                      No BBCode implementation was made yesterday.
                      
                      &#128994; IMPORTANT: SMF ARCHIVE REMAINS SACRED
                      
                      We also established the migration philosophy.
                      
                      The SMF archive is roughly:
                      
                      2,475,188 posts.
                      
                      You consider that archive your life's work/legacy, and you are not personally doing the SMF import, even with assistance.
                      
                      That is now a hard project constraint.
                      
                      If/when migration happens:
                      
                      work from copies/snapshots
                      never experiment directly against the production archive
                      extensive sample validation
                      preserve original content
                      preferably render legacy BBCode on output rather than rewriting millions of stored posts
                      
                      In other words:
                      
                      We do not poke the dragon because we happen to own a very large stick.
                      
                      &#128994; DOMAIN / WARNING STATUS
                      
                      We deliberately did nothing about the various browser-console warnings.
                      
                      They are expected consequences of testing the site at:
                      
                      multitool.ninja
                      
                      while NodeBB's configured canonical URL remains:
                      
                      nodebb-vklpj-u73921.vm.elestio.app
                      
                      We've seen warnings involving things like:
                      
                      emoji assets
                      manifest/start URL
                      Harmony fonts
                      WebSockets
                      service-worker/web-push
                      origin mismatches
                      
                      DO NOT FIX THESE YET.
                      
                      When the real .org cutover happens, we'll deal with the canonical URL/proxy/origin alignment as one controlled operation.
                      
                      &#129529; BACKLOG / CLEANUP
                      
                      These aren't today's jobs.
                      
                      Theme cleanup
                      Remove duplicate +24px CSS block.
                      Eventually clean up old backup files once we're confident they're unnecessary.
                      Legacy ACP customization
                      
                      There is still a substantial amount of older:
                      
                      ACP Custom CSS
                      ACP Custom JS
                      Custom Header / Custom HTML
                      
                      Those are backed up.
                      
                      Long-term, we want to migrate the useful pieces into the MTO child theme and eventually retire the ACP hacks.
                      
                      But not while we're still actively discovering what we need.
                      
                      &#128204; CURRENT STATE β€” ONE GLANCE
                      Visual work
                      
                      &#128994; Good
                      
                      Desktop topic width
                      
                      &#128994; 85/15
                      
                      Mobile topic width
                      
                      &#128994; Fine
                      
                      Pagination
                      
                      &#128994; 20/page
                      
                      Infinite scroll
                      
                      &#128308; Not wanted
                      
                      Mobile blue navigator
                      
                      &#128308; Gone
                      
                      Composer Submit
                      
                      &#128994; Bottom
                      
                      Quotes
                      
                      &#128994; SMF-ish
                      
                      Author panel
                      
                      &#128994; SMF-ish
                      
                      Post action menus
                      
                      &#128994; Fixed
                      
                      Reply-page history
                      
                      &#128993; Next thing we're working on
                      
                      SMF BBCode compatibility
                      
                      &#128993; Investigated, intentionally postponed
                      
                      SMF import
                      
                      &#128308; Not happening yet / treat archive as read-only
                      
                      .org cutover
                      
                      &#128308; Later
                      
                      Def
                      
                      


                      1 Reply Last reply
                      0
                      • Grant LamontagneG
                        Grant LamontagneG
                        Grant Lamontagne
                        administrators
                        wrote on last edited by
                        #41

                        MTO NodeBB Daily Log β€” 2026-09-08
                        Completed / Significant Work

                        Topic layout and density

                        Established permanent 85/15 topic/sidebar layout on desktop.
                        Extended the topic action/reply bars by 24px so they align with the wider topic column.
                        Tightened category/topic row spacing for a denser, more SMF-like presentation.
                        Tightened category header spacing.
                        Confirmed the wider post column is visually preferable.

                        Composer / Reply behavior

                        Moved the native NodeBB Submit control from the composer action area to the bottom of the composer.
                        Preserved the native NodeBB button and submission behavior.
                        Confirmed:
                        Bottom Reply opens a blank composer.
                        Per-post Reply opens a blank composer.
                        Quote opens with the expected quoted material.
                        Fixed the normal per-post Reply behavior where NodeBB's compose route was populating the original post body.
                        Added a clickable topic-title return link to the Reply composer.
                        Deliberately retained the composer Preview behavior where the original post can initially appear until the member starts typing; this is considered a useful reminder rather than a bug.

                        Reply History

                        Implemented an MTO Reply History beneath the composer.
                        Reply History loads the latest 20 posts, independent of which post/page initiated the reply.
                        Uses NodeBB's native post rendering rather than recreating post content.
                        Added MTO author rail styling to Reply History.
                        Added compact quote/footer/signature styling.
                        Added mobile structural handling.
                        Fixed Quote actions within Reply History so they work despite the history being outside NodeBB's normal topic delegation.
                        Confirmed multiple quotes from Reply History work.
                        Confirmed normal post Reply/Quote behavior remains functional.

                        Post presentation

                        Implemented the MTO author panel/rail:
                        145px author column
                        128px avatar area
                        80px displayed avatar
                        grey MTO-style author background
                        post-count placement
                        author/content divider
                        Hid the native Harmony reply-count summary.
                        Tightened post footer/signature spacing.
                        Changed quotes to a compact SMF-inspired left-border treatment.
                        Hid the redundant native parent-post display.
                        Fixed post action-menu clipping on long/short posts.

                        Mobile

                        Removed the unwanted blue NodeBB mobile topic progress/navigation bar.
                        Confirmed the blue β€œ39 out of 40” style navigator is gone on the actual Android phone.
                        Desktop pagination remains enabled and functional at 20 posts per page.
                        Confirmed direct page-2 navigation returns the expected 20 posts.

                        Header / navigation

                        Added Login to the custom MTO header for logged-out visitors.
                        Login disappears for authenticated members.
                        Confirmed the Login link routes correctly to NodeBB's native login page.
                        Confirmed successful login through the new header link.
                        Preserved the existing MTO navigation and dark-mode control.

                        Logged-out experience

                        Reviewed the logged-out topic experience in Incognito.
                        Confirmed guests can browse/read/share/page through topics and receive clear Register/Login calls to action.
                        Per-post Reply controls are appropriately unavailable to guests.
                        Decided the existing guest experience is good enough and DONE.
                        Deferred rewriting the generic NodeBB guest CTA because it does not affect current members and is not worth spending migration-time effort on.
                        MTO-specific smileys, including the Multitool.Org smiley and Swiss Army Knight, remain deferred until the eventual smiley-set work.

                        Registration page

                        Redesigned the registration page as an MTO-specific experience rather than a generic NodeBB form.
                        Preserved native NodeBB registration functionality.
                        Established a wider registration area and approximately 600px form width on desktop.
                        Removed the unnecessary form-card treatment.
                        Preserved the dedicated Community Links component.
                        Added MTO-specific introductory copy explaining:
                        what Multitool.Org is
                        the community's focus
                        the relationship with EDC-TV, SAKWiki.com, and GearFeed
                        why prospective members should join
                        Added β€œCreate your account” as the form heading.
                        Tested the finished page in Incognito and judged it good enough to bank rather than over-polish.

                        Registration features intentionally deferred

                        Registration approval
                        Email verification
                        Registration email configuration
                        CAPTCHA/anti-spam registration policy
                        Registration agreements/rules
                        Welcome/activation email
                        Final username policy
                        Account/permission mapping

                        Reason: the permanent domain, email infrastructure, and SMF migration have not happened yet, and some settings may be affected by the eventual migration. These will be addressed later.

                        Maintenance / Safety
                        Created fresh LKG backups of mto-topic-actions.js and theme.scss.
                        Created additional registration-specific backups before permanent registration work.
                        Removed temporary Reply debugging code.
                        Removed duplicate 24px alignment CSS.
                        Verified mto-topic-actions.js with node --check.
                        Built NodeBB successfully after the registration changes.
                        Restarted the NodeBB container and confirmed the finished registration page.
                        No NodeBB core registration templates were modified.
                        No SMF archive/database work was performed.
                        Current State

                        Registration presentation: DONE / deferred functional settings.

                        Logged-out experience: DONE.

                        Reply/Quote/Reply History: DONE and tested.

                        Header/Login: DONE.

                        Topic/post presentation: substantially established.

                        SMF import: deliberately untouched.

                        Next work: prioritize something that benefits existing members or is independent of the eventual migration, rather than spending time configuring infrastructure that will need to be revisited later.


                        1 Reply Last reply
                        0
                        • Grant LamontagneG
                          Grant LamontagneG
                          Grant Lamontagne
                          administrators
                          wrote on last edited by
                          #42

                          MTO SMF β†’ NodeBB Migration β€” Daily Handoff Log

                          Date: 2026-09-09
                          Purpose: Preserve the full state of today's work so another ChatGPT session/model can continue without re-discovering the project.

                          1. Overall Project

                          We are migrating the MTO forum from SMF to NodeBB.

                          Production forum remains on SMF.

                          NodeBB is a test instance on Elestio.

                          We are deliberately building and testing the NodeBB implementation before touching production.

                          User is not a coder and prefers:

                          exact copy/paste commands

                          one small command block at a time

                          read-only inspection before changes where practical

                          explanations of what output means

                          avoiding unnecessary complexity

                          Do not "nuke" the NodeBB instance unless absolutely necessary.

                          1. Current NodeBB Environment

                          Container: app-nodebb-1

                          Redis container: app-redis-1

                          NodeBB image: elestio/nodebb:latest

                          NodeBB version confirmed in ACP: 4.15.2

                          NodeBB URL:
                          https://nodebb-vklpj-u73921.vm.elestio.app

                          Database: Redis

                          Health check previously returned HTTP 200.

                          NodeBB uploads volume:
                          /usr/src/app/public/uploads

                          Host bind mounts:

                          /opt/app/nodebb-theme-mto β†’ /usr/src/app/nodebb-theme-mto

                          /opt/app/nodebb-plugin-mto-awards β†’ /usr/src/app/nodebb-plugin-mto-awards

                          Compose backup:
                          /opt/app/docker-compose.yml.backup-before-mto-awards

                          No systemd NodeBB service.

                          Docker logging uses journald.

                          SMF server is NOT on this NodeBB host.

                          Badge artwork files are now available.

                          1. Installed NodeBB Plugins/Themes

                          Current installed/enabled list includes:

                          nodebb-plugin-2factor 8.0.8

                          nodebb-plugin-composer-default 11.0.14

                          nodebb-plugin-dbsearch 7.0.0

                          nodebb-plugin-emoji 6.0.16

                          nodebb-plugin-emoji-android 4.1.1

                          nodebb-plugin-link-preview 2.2.9

                          nodebb-plugin-markdown 13.2.10

                          nodebb-plugin-mentions 5.0.3

                          nodebb-plugin-spam-be-gone 2.3.7

                          nodebb-plugin-web-push 0.9.3

                          nodebb-rewards-essentials 1.0.3

                          nodebb-theme-harmony 3.2.16

                          nodebb-theme-lavender 8.1.0

                          nodebb-theme-mto 0.1.0

                          nodebb-theme-peace 3.1.3

                          nodebb-theme-persona 15.2.10

                          nodebb-widget-essentials 8.0.9

                          There is no dedicated awards plugin currently installed. nodebb-plugin-ns-awards was considered as an architectural reference only; it is old/unverified.

                          Rewards Essentials is NOT the intended workflow.

                          1. MTO Custom Theme

                          Theme:

                          nodebb-theme-mto

                          Child theme of Harmony.

                          Version 0.1.0.

                          Separate from the awards plugin.

                          Theme owns presentation.

                          Custom author rail and signature placement already exist.

                          Merit Badges should appear beneath each member's signature, NOT in the author rail.

                          Badge artwork:

                          full badge: 50 Γ— 60 PNG

                          mini badge: 25 Γ— 25 PNG

                          transparent corners

                          Badges should NOT display on mobile.

                          Current legacy SMF Awards "In Post" display limit: 21.

                          Architecture decision:

                          nodebb-plugin-mto-awards owns badge data/business rules; nodebb-theme-mto owns badge presentation beneath the signature.

                          1. Legacy SMF Awards Requirements

                          Legacy SMF catalogue has 194 badges:

                          Site: 18

                          Collector: 32

                          Modification: 5

                          User: 27

                          Challenge: 112

                          Staff manually award badges. Automatic triggers are NOT needed for Phase 1.

                          Members can request awards manually with evidence URLs. Moderators approve/reject.

                          No limit on how many badges a member can own.

                          Per-post display limit is 21.

                          Desired Phase 1

                          Badge catalogue

                          Five categories

                          Full + mini artwork

                          Manual staff awarding

                          Remove/revoke award

                          Member awards page

                          Display beneath signature

                          Display limit

                          Requestable awards

                          Historical migration

                          Phase 2

                          Request queue

                          Favorite badge

                          Automatic triggers

                          Old package "cleverness"/advanced automation

                          Guiding principle:

                          The computer handles the paperwork; humans make the award decision.

                          Legacy workflow

                          Member sees catalogue / available awards.

                          Member completes requirements.

                          Member copies evidence URL.

                          Profile β†’ Forum Profile β†’ Awards β†’ Show Available Awards.

                          Member requests award and pastes evidence.

                          Staff receive alert.

                          Staff verify and approve.

                          Award appears beneath signature.

                          User specifically wants a remove option because some badges will need pruning.

                          Important distinction:

                          Delete/remove badge definition = remove a badge from catalogue.

                          Revoke member award = remove a badge from one member while keeping the badge definition.

                          Both need deliberate management UI.

                          1. Legacy SMF Package Archaeology

                          The uploaded/analyzed legacy package was:

                          Package ID: spuds:member_awards

                          Version: 3.0

                          Target: SMF 2.0–2.0.99

                          Core data structures identified:

                          awards

                          Fields include:

                          id_award

                          award_name

                          description

                          id_category

                          time_added

                          filename

                          minifile

                          award_trigger

                          award_type

                          award_location

                          award_requestable

                          award_assignable

                          awards_members

                          Contains member/badge assignments including:

                          member

                          badge

                          date received

                          favorite

                          award type

                          active

                          comments

                          Request rows are inactive.

                          awards_categories

                          Stores categories.

                          Legacy award types

                          Manual

                          Post count

                          Top posters

                          Topic count

                          Top topic starters

                          Time online

                          Member since

                          Karma

                          Legacy display locations

                          Below avatar

                          Above avatar

                          Signature

                          Off

                          Legacy image formats

                          Full frame

                          Heading

                          No frame

                          Manual assignment supports member(s), award, and date received.

                          Unassign/removal is separate from badge definition deletion.

                          Request approval/rejection exists.

                          1. MTO Awards Plugin

                          Plugin directory:

                          /opt/app/nodebb-plugin-mto-awards

                          Inside container:

                          /usr/src/app/nodebb-plugin-mto-awards

                          Package:

                          {
                          "name": "nodebb-plugin-mto-awards",
                          "version": "0.1.0",
                          "description": "MTO Merit Badges prototype",
                          "main": "library.js",
                          "nbbpm": {
                          "compatibility": "^4.15.0"
                          }
                          }

                          Plugin manifest:

                          {
                          "id": "nodebb-plugin-mto-awards",
                          "templates": "templates",
                          "hooks": [
                          {
                          "hook": "static:app.load",
                          "method": "init"
                          }
                          ]
                          }

                          NodeBB CLI initially refused installation without a suggested package version, so the plugin was made available via symlink:

                          /usr/src/app/node_modules/nodebb-plugin-mto-awards -> /usr/src/app/nodebb-plugin-mto-awards

                          It was then activated successfully.

                          ./nodebb plugins | grep -i "mto-awards" showed it installed/enabled.

                          Important NodeBB convention discovered:

                          Installed plugins use:

                          const db = nodebb.require('./src/database');

                          and similar NodeBB context requires at module scope.

                          The earlier standalone require.main.require test was wrong and should NOT be repeated.

                          Data layer loaded successfully and a database test passed.

                          Temporary test data was removed.

                          1. Awards Data Layer

                          Current /lib/awards.js is the known-good working data layer.

                          Current content:

                          'use strict';

                          const db = nodebb.require('./src/database');

                          const PREFIX = 'mto:awards';

                          const keys = {
                          badges: ${PREFIX}:badges,
                          badge: id => ${PREFIX}:badge:${id},
                          member: uid => ${PREFIX}:member:${uid},
                          memberAward: (uid, badgeId) => ${PREFIX}:member:${uid}:${badgeId},
                          requests: ${PREFIX}:requests,
                          request: id => ${PREFIX}:request:${id},
                          };

                          const Awards = {};

                          Awards.keys = keys;

                          Awards.createBadge = async function (badge) {
                          await db.setObject(keys.badge(badge.id), badge);
                          const score = Number.isFinite(Number(badge.displayOrder)) ? Number(badge.displayOrder) : (Number(badge.timeAdded) || 0);
                          await db.sortedSetAdd(keys.badges, score, badge.id);
                          return badge;
                          };

                          Awards.getBadge = async function (id) {
                          return await db.getObject(keys.badge(id));
                          };

                          Awards.deleteBadge = async function (id) {
                          await db.delete(keys.badge(id));
                          await db.sortedSetRemove(keys.badges, id);
                          };

                          module.exports = Awards;

                          Awards.listBadges = async function () {
                          const ids = await db.getSortedSetRange(keys.badges, 0, -1);
                          return await Promise.all(ids.map(id => Awards.getBadge(id)));
                          };

                          Awards.awardMember = async function (award) {
                          const key = keys.memberAward(award.uid, award.badgeId);
                          const existing = await db.getObject(key);

                              if (existing && existing.active !== false) {
                                      throw new Error(`Member ${award.uid} already has badge ${award.badgeId}`);
                              }
                          
                              const dateAwarded = Number(award.dateAwarded) || Date.now();
                          
                              award.dateAwarded = dateAwarded;
                              award.active = true;
                          
                              await db.setObject(key, award);
                              await db.sortedSetAdd(keys.member(award.uid), dateAwarded, award.badgeId);
                              await db.sortedSetAdd(keys.badge(award.badgeId) + ':members', dateAwarded, award.uid);
                          
                              return award;
                          

                          };

                          Awards.getMemberAward = async function (uid, badgeId) {
                          return await db.getObject(keys.memberAward(uid, badgeId));
                          };

                          Awards.listMemberAwards = async function (uid) {
                          const badgeIds = await db.getSortedSetRange(keys.member(uid), 0, -1);
                          return await Promise.all(badgeIds.map(badgeId => Awards.getMemberAward(uid, badgeId)));
                          };

                          Awards.listBadgeMembers = async function (badgeId) {
                          return await db.getSortedSetRange(keys.badge(badgeId) + ':members', 0, -1);
                          };

                          Awards.revokeMember = async function (uid, badgeId) {
                          const award = await Awards.getMemberAward(uid, badgeId);

                              if (!award) {
                                      return null;
                              }
                          
                              award.active = false;
                              award.dateRevoked = Date.now();
                          
                              await db.setObject(keys.memberAward(uid, badgeId), award);
                              await db.sortedSetRemove(keys.member(uid), badgeId);
                              await db.sortedSetRemove(keys.badge(badgeId) + ':members', uid);
                          
                              return award;
                          

                          };

                          Awards.updateBadge = async function (badge) {
                          if (!badge || !badge.id) {
                          throw new Error('Badge id is required');
                          }

                              const existing = await Awards.getBadge(badge.id);
                          
                              if (!existing) {
                                      throw new Error(`Badge ${badge.id} does not exist`);
                              }
                          
                              const updated = Object.assign({}, existing, badge);
                          
                              await db.setObject(keys.badge(badge.id), updated);
                          
                              const score = Number.isFinite(Number(updated.displayOrder)) ? Number(updated.displayOrder) : (Number(updated.timeAdded) || 0);
                              await db.sortedSetAdd(keys.badges, score, updated.id);
                          
                              return updated;
                          

                          };

                          Backups:

                          /opt/app/nodebb-plugin-mto-awards/lib/awards.js.before-schema

                          /opt/app/nodebb-plugin-mto-awards/lib/awards.js.before-member-awards

                          /opt/app/nodebb-plugin-mto-awards/lib/awards.js.working-db-test

                          /opt/app/nodebb-plugin-mto-awards/lib/awards.js.known-good-data-layer

                          /opt/app/nodebb-plugin-mto-awards/library.js.known-good

                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-manage-page

                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-editor

                          /usr/src/app/nodebb-plugin-mto-awards/templates/mto-awards-manage.tpl.before-editor

                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-real-save

                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-real-save-2

                          /usr/src/app/nodebb-plugin-mto-awards/templates/mto-awards-edit.tpl.before-real-save

                          One backup command previously failed because /opt/app/... is a host path and isn't visible inside the container. Correct container path is /usr/src/app/....

                          One accidental node --check was run on the host due to missing docker exec; host reported node: command not found. Later in-container syntax check passed. Do not interpret the old host error as a NodeBB problem.

                          1. Current library.js Architecture

                          Current library.js begins with:

                          'use strict';

                          const user = nodebb.require('./src/user');
                          const Awards = require('./lib/awards');

                          const plugin = {};

                          async function canManageAwards(uid) {
                          const isAdministrator = await user.isAdministrator(uid);
                          if (isAdministrator) {
                          return true;
                          }

                              return await user.isModeratorOfAnyCategory(uid);
                          

                          }

                          Important policy:

                          ALL moderators have full Merit Badge management access across the entire forum, plus administrators.

                          Do NOT give moderators ACP access merely to manage badges.

                          plugin.init = async function (params) { ... }

                          The plugin currently has:

                          Catalogue route

                          router.get('/mto-awards', middleware.buildHeader, async function (req, res) {
                          try {
                          const badges = await Awards.listBadges();
                          console.log('[MTO Awards] Catalogue requested:', badges.map(badge => badge && badge.id));
                          res.render('mto-awards', { badges: badges || [] });
                          } catch (err) {
                          console.error('[MTO Awards] Catalogue error:', err);
                          res.status(500).send('Unable to load Merit Badges.');
                          }
                          });

                          Management route

                          router.get('/mto-awards/manage', middleware.buildHeader, async function (req, res) {
                          try {
                          if (!await canManageAwards(req.uid)) {
                          return res.status(403).send('[[error:no-privileges]]');
                          }

                                      const badges = await Awards.listBadges();
                          
                                      res.render('mto-awards-manage', {
                                              badges: badges || &#91;],
                                      });
                              } catch (err) {
                                      console.error('[MTO Awards] Management access error:', err);
                                      res.status(500).send('Unable to load Merit Badge Management.');
                              }
                          

                          });

                          Add badge GET

                          router.get('/mto-awards/manage/add', middleware.buildHeader, async function (req, res) {
                          try {
                          if (!await canManageAwards(req.uid)) {
                          return res.status(403).send('[[error:no-privileges]]');
                          }

                                      res.render('mto-awards-edit');
                              } catch (err) {
                                      console.error('[MTO Awards] Add badge page error:', err);
                                      res.status(500).send('Unable to load Merit Badge editor.');
                              }
                          

                          });

                          Current Add badge POST

                          The POST route currently ONLY proves that protected submission works:

                          router.post('/mto-awards/manage/add', middleware.applyCSRF, async function (req, res) {
                          try {
                          if (!await canManageAwards(req.uid)) {
                          return res.status(403).send('[[error:no-privileges]]');
                          }

                                      console.log('[MTO Awards] Add badge POST received.');
                                      res.status(200).send('Add badge POST received.');
                              } catch (err) {
                                      console.error('[MTO Awards] Add badge POST error:', err);
                                      res.status(500).send('Unable to process Merit Badge.');
                              }
                          

                          });

                          This is the ONLY unfinished part of today's Add Badge work.

                          1. Management Template

                          Current /templates/mto-awards-manage.tpl:

                          <div class="container">
                          <div class="row">
                          <div class="col-12">
                          <div class="d-flex justify-content-between align-items-center mb-3">
                          <div>
                          <h1>Merit Badge Management</h1>
                          <p class="text-muted mb-0">Manage the MTO Merit Badge catalogue.</p>
                          </div>
                          <button type="button" class="btn btn-primary" disabled>
                          Add Merit Badge
                          </button>
                          </div>

                                              {{{ if badges.length }}}
                                              <div class="table-responsive">
                                                      <table class="table table-bordered table-hover align-middle">
                                                              <thead>
                                                                      <tr>
                                                                              <th>Badge</th>
                                                                              <th>Category</th>
                                                                              <th>Requestable</th>
                                                                              <th>Assignable</th>
                                                                              <th>Action</th>
                                                                      </tr>
                                                              </thead>
                                                              <tbody>
                                                                      {{{ each badges }}}
                                                                      <tr>
                                                                              <td><strong>{badges.name}</strong></td>
                                                                              <td>{badges.category}</td>
                                                                              <td>
                                                                                      {{{ if badges.requestable }}}
                                                                                      Yes
                                                                                      {{{ else }}}
                                                                                      No
                                                                                      {{{ end }}}
                                                                              </td>
                                                                              <td>
                                                                                      {{{ if badges.assignable }}}
                                                                                      Yes
                                                                                      {{{ else }}}
                                                                                      No
                                                                                      {{{ end }}}
                                                                              </td>
                                                                              <td>
                                                                                      <button type="button" class="btn btn-sm btn-secondary" disabled>
                                                                                              Edit
                                                                                      </button>
                                                                              </td>
                                                                      </tr>
                                                                      {{{ end }}}
                                                              </tbody>
                                                      </table>
                                              </div>
                                              {{{ else }}}
                                              <div class="alert alert-info">
                                                      No Merit Badges have been added yet.
                                              </div>
                                              {{{ end }}}
                                      </div>
                              </div>
                          

                          </div>

                          The Add button is still disabled and should eventually become a link to:

                          /mto-awards/manage/add

                          The Edit button is also currently disabled and will be implemented later.

                          A Delete/Remove action will also be needed because the user expects badge pruning.

                          1. Add Badge Editor

                          Current /templates/mto-awards-edit.tpl has:

                          Badge name

                          Category

                          Description

                          Requestable checkbox

                          Assignable checkbox

                          Full badge upload placeholder

                          Mini badge upload placeholder

                          Save Badge

                          Cancel

                          The artwork file inputs remain disabled intentionally until editor/permissions are tested.

                          Important change made today

                          The form fields were just wired with name attributes:

                          name β†’ name="name"

                          category β†’ name="category"

                          description β†’ name="description"

                          requestable β†’ name="requestable" value="1"

                          assignable β†’ name="assignable" value="1"

                          Name/category/description are required.

                          This template change was successfully written before the last failed library replacement attempt.

                          1. Today's Successful Test

                          We tested the Add Badge form with harmless test data.

                          The browser returned:

                          Add badge POST received.

                          This confirmed:

                          Form submits correctly.

                          POST route is reachable.

                          CSRF protection works.

                          Moderator/admin authorization works.

                          NodeBB loaded the route correctly.

                          No Redis write happens yet.

                          The test did NOT create a badge.

                          1. Last Two Failed Replacement Attempts

                          Two attempts were made to replace the placeholder POST route with the real Redis-saving implementation.

                          First attempt

                          Failed because the replacement string did not match the route's exact indentation.

                          Error:

                          Error: Could not find the existing Add badge POST route.

                          No library change occurred.

                          Second attempt

                          Attempted to locate route boundaries using:

                          const start = l.indexOf("router.post('/mto-awards/manage/add'");
                          const end = l.indexOf("\n\t\trouter.get('/mto-awards/manage/add'", start);

                          It failed because the actual file uses spaces rather than the exact tab sequence assumed.

                          Error:

                          Error: Could not locate Add badge POST route boundaries.

                          Again, no library change occurred.

                          The syntax check after the attempt reported:

                          LIBRARY_SYNTAX_EXIT=0

                          This only confirms the existing library.js remains valid. It does NOT mean the real save route was installed.

                          1. Where We Intentionally Stopped

                          User said they may be running out of daytime and wants a sensible stopping point.

                          We agreed to STOP HERE.

                          Do not restart NodeBB tonight.

                          Do not run additional edits tonight unless absolutely necessary.

                          Current state is safe.

                          Next session should begin by inspecting or carefully editing the actual POST route rather than using brittle whitespace-dependent replacement.

                          1. Exact Next Step

                          The intended next implementation is:

                          Replace the placeholder POST handler with a real protected save handler that:

                          Checks canManageAwards(req.uid).

                          Reads:

                          req.body.name

                          req.body.category

                          req.body.description

                          req.body.requestable

                          req.body.assignable

                          Validates required fields.

                          Validates category against:

                          User

                          Site

                          Modification

                          Collector

                          Challenge

                          Generates a unique internal badge ID.

                          Creates a badge object with approximately:

                          id

                          name

                          category

                          description

                          requestable

                          assignable

                          timeAdded

                          displayOrder

                          Calls:
                          await Awards.createBadge(badge)

                          Redirects to:
                          /mto-awards/manage

                          Then:

                          syntax check

                          restart NodeBB

                          create one harmless test badge

                          verify it appears in management/catalogue

                          then move on to Edit/Delete

                          Do NOT implement artwork upload in the same step.

                          1. Planned Future Work

                          After real badge creation is verified:

                          A. Management UI

                          Enable Add button.

                          Add Edit.

                          Add Delete/Remove with confirmation.

                          Preserve moderator/admin permission check.

                          Possibly show artwork status.

                          B. Artwork Upload

                          Need protected upload handling using NodeBB's upload infrastructure.

                          Requirements:

                          full artwork exactly 50 Γ— 60 PNG

                          mini artwork exactly 25 Γ— 25 PNG

                          transparent corners

                          moderator/admin only

                          CSRF protection

                          files stored in NodeBB uploads volume

                          do NOT simply rely on normal post image upload permissions

                          C. Member Awarding

                          Staff can select member.

                          Staff can select badge.

                          Staff can award.

                          Date received should be supported for historical migration.

                          Revoke/remove member award.

                          Avoid duplicate active awards.

                          D. Member Awards Page

                          Show owned badges.

                          Eventually favorites.

                          Historical dates/comments as appropriate.

                          E. Requests

                          Phase 1 should support requestable awards.

                          Desired workflow:

                          Member submits evidence URL β†’ staff reviews β†’ approve/reject β†’ award.

                          Phase 2 can make this into a more polished request queue.

                          F. Theme Presentation

                          Theme should render mini badges beneath signatures.

                          Max 21 displayed in a post.

                          No mobile display.

                          Plugin supplies badge data.

                          Theme handles visual presentation.

                          G. Historical Migration

                          Eventually migrate:

                          194 legacy badge definitions

                          legacy categories

                          artwork

                          member award assignments

                          dates

                          active status

                          relevant comments/favorites where useful

                          Do this only after the new system is stable.

                          1. Useful Existing Backups

                          If something goes wrong, known backups include:

                          /opt/app/nodebb-plugin-mto-awards/lib/awards.js.known-good-data-layer
                          /opt/app/nodebb-plugin-mto-awards/library.js.known-good
                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-manage-page
                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-editor
                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-real-save
                          /usr/src/app/nodebb-plugin-mto-awards/library.js.before-real-save-2
                          /usr/src/app/nodebb-plugin-mto-awards/templates/mto-awards-manage.tpl.before-editor
                          /usr/src/app/nodebb-plugin-mto-awards/templates/mto-awards-edit.tpl.before-real-save

                          Remember:

                          /opt/app/... is the host-side path.

                          /usr/src/app/... is the container-side path.

                          1. User Preferences / Working Style

                          The user wants this project handled incrementally.

                          Preferred rhythm:

                          Give one small command block.

                          User runs it.

                          User pastes exact output.

                          Interpret it.

                          Only then give next command.

                          Avoid giving a huge sequence of commands.

                          The user appreciates practical reassurance when a failed edit is harmless.

                          When there is a natural stopping point, say so rather than pushing onward.

                          Current stopping point is intentional and safe.

                          1. Handoff Summary

                          The MTO Merit Badge system is not broken.

                          We have a working NodeBB plugin skeleton, working Redis data layer, working management route, working Add Badge page, working CSRF protection, and working moderator/admin authorization.

                          The remaining immediate task is simply:

                          Turn the already-tested Add Badge POST handler from a proof-of-concept response into a real Awards.createBadge() call.

                          Do that carefully next session, then restart NodeBB and test one badge.

                          Do not jump ahead to artwork uploads, migration, requests, or theme rendering until badge creation is verified.


                          1 Reply Last reply
                          0
                          • Grant LamontagneG
                            Grant LamontagneG
                            Grant Lamontagne
                            administrators
                            wrote on last edited by
                            #43

                            And to keep things straight, here is the list of rules I have developed:

                            The MTO project rules

                            1. The SMF database/data is the highest authority

                            This is the most important rule going forward.

                            We are migrating an existing community, not inventing a new one.

                            So when something already exists in SMFβ€”members, usernames, groups/ranks, posts, topics, awards, dates, historical relationships, etc.β€”we should treat the SMF data as the authoritative source and build NodeBB around it.

                            That means:

                            Don't invent data that should come from SMF.
                            Don't hard-code member ranks/groups when those should eventually be imported.
                            Don't make up award assignments.
                            Don't replace historical data with approximations merely because it's easier.
                            Don't design a new data model that loses information from SMF without a deliberate decision.
                            When we aren't sure how something worked historically, inspect the SMF data/package/code first.
                            UI decisions that depend on migration data should generally wait until we understand that data.

                            The awards work makes this especially explicit: the legacy system contains the badge definitions, categories, member assignments, dates, active status, etc., and the intention is to preserve those during historical migration.

                            In short:

                            SMF tells us what the community is. NodeBB provides the platform on which we reproduce it.

                            1. Prefer simplicity over cleverness

                            This has become one of our strongest recurring rules.

                            If a simple native NodeBB mechanism works, use it.

                            If a small CSS rule solves the problem, don't build JavaScript.

                            If a template can do something, don't build a DOM-rewriting system to accomplish the same thing.

                            If something is already "good enough," stop.

                            We've repeatedly backed away from increasingly clever implementations in favor of simpler onesβ€”for example, using native Harmony/NodeBB controls rather than recreating them, and replacing a complicated JavaScript bottom-bar approach with a normal server-rendered template.

                            The practical rule is:

                            The simplest solution that preserves the required behavior wins.

                            1. Preserve native NodeBB functionality wherever possible

                            The goal is SMF-inspired NodeBB, not a literal SMF clone.

                            We want the appearance and workflow to feel familiar, but underneath it should remain NodeBB.

                            So:

                            Use native Reply.
                            Use native Quote.
                            Use native Watch.
                            Use native Share.
                            Use native Print.
                            Use native pagination.
                            Use native login/registration.
                            Use native composer functionality.
                            Use native NodeBB events/hooks where available.

                            We shouldn't sacrifice a reliable NodeBB mechanism merely to reproduce a tiny visual difference from SMF.

                            This principle appears repeatedly in the logs: keep Harmony/NodeBB functionality, modify the MTO theme, and prefer existing functionality over custom implementations.

                            1. SMF-inspired, not pixel-perfect SMF

                            The visual target is very clear:

                            compact, dense, traditional forum, MTO-branded, less "Bootstrap card," broad posts, narrow author rail.

                            But we are not trying to reproduce every pixel of the old SMF installation.

                            The desired characteristics are explicitly described as:

                            compact
                            information-dense
                            broad post content
                            relatively narrow author column
                            restrained borders
                            less card-based
                            green/olive MTO branding
                            related light/dark themes
                            useful sidebar/ad space
                            native responsive behavior
                            native NodeBB functionality

                            And we've explicitly accepted small imperfections when they're not worth the effort.

                            For example, toolbar spacing and the sidebar gap were consciously left alone because the result was already good enough.

                            So:

                            Get the big SMF characteristics right. Don't spend an hour perfecting a minor detail while major discrepancies remain.

                            1. Functionality beats aesthetics

                            This is probably the second-most important rule after data preservation.

                            We do not make the site look more like SMF if doing so makes NodeBB less reliable.

                            The logs actually state this directly:

                            Do not optimize aesthetics at the expense of native NodeBB functionality.

                            That means, for example:

                            Don't replace native Watch just because SMF calls it "Notify."
                            Don't invent a poll system simply because SMF has one.
                            Don't use unsupported API shortcuts to make Bookmark behave differently.
                            Don't break editing to make post layout prettier.
                            Don't remove a NodeBB feature merely because it doesn't look exactly like SMF.
                            6. Inspect before changing

                            This is a major technical rule we've developed through experience.

                            Never guess what a NodeBB element is.

                            Before changing something:

                            Inspect the actual template.
                            Inspect the actual rendered DOM.
                            Identify the real selector/component.
                            Determine what owns the behavior.
                            Test the proposed change.
                            Only then make it permanent.

                            The quote problem is a perfect example: we initially treated post/parent as the quote, but inspection showed that the actual quoted content was the <blockquote> inside post/content.

                            Likewise, we learned not to assume an element such as post/summary was responsible when the actual component was post/reply-count.

                            So:

                            Inspect the real DOM/template. Don't work from assumptions.

                            1. One focused change at a time

                            Don't combine unrelated modifications.

                            The preferred editing sequence is:

                            inspect β†’ checkpoint β†’ one change β†’ verify β†’ build β†’ test β†’ checkpoint

                            The older handoff gives this almost verbatim as the editing safety procedure.

                            This makes it possible to answer:

                            "What did we just change, and did that cause the problem?"

                            rather than having ten simultaneous variables.

                            1. Read-only investigation first

                            Whenever practical, investigate without changing anything.

                            Especially for:

                            databases
                            Redis
                            ACP settings
                            NodeBB configuration
                            existing templates
                            installed plugins
                            legacy SMF structures

                            We've specifically adopted this for the ACP retirement work: locate the actual persisted configuration first, classify it, and only then change it.

                            That same philosophy should apply even more strongly to the SMF database.

                            1. Never blindly delete or overwrite something

                            This applies particularly to:

                            SMF data
                            Redis
                            ACP CSS/JS
                            theme files
                            NodeBB configuration
                            existing functionality

                            For example, the ACP CSS was not simply deleted wholesale. Each area was audited against the MTO theme and classified as:

                            REMOVE / KEEP / MOVE / OBSOLETE.

                            Only after that should the redundant layer be disabled.

                            The same principle should govern the migration database:

                            Understand ownership and dependencies before removing anything.

                            1. Back up before permanent changes

                            This has become standard operating procedure.

                            Before a significant modification:

                            make a known-good backup/checkpoint
                            make the change
                            verify it
                            record the resulting state/hash where useful

                            We've done this repeatedly for theme.scss, JavaScript, ACP CSS, templates, and the awards data layer.

                            The newer philosophy is also to eventually have a clean archival/checkpoint strategy, rather than accumulating random timestamped backup files forever.

                            1. Known-good beats theoretically cleaner

                            This is an important practical rule.

                            If something is working, don't rewrite it just because it could theoretically be cleaner.

                            We've explicitly recorded:

                            don't casually rewrite the working bottom footer;
                            don't rip apart the working Composer CSS;
                            don't revisit accepted imperfections;
                            don't perform another broad theme.scss cleanup merely because there are things that could be tidied.

                            The current theme was considered stable enough that the next work should focus elsewhere rather than cosmetic cleanup.

                            So:

                            A working ugly solution is preferable to a beautiful regression.

                            1. Prototype first; refactor later

                            We've recognized that incremental patching is useful during discoveryβ€”but it should not become the final architecture.

                            The intended lifecycle is:

                            prototype β†’ stabilize β†’ freeze baseline β†’ audit β†’ refactor

                            The logs explicitly say that the incremental changes are acceptable as prototyping but should not become the final architecture.

                            Once the UI/data model is stable:

                            inventory files
                            identify active code
                            remove dead code
                            consolidate CSS
                            remove duplicates
                            clarify Harmony ownership
                            keep only intentional MTO overrides
                            document why customizations exist
                            ideally put the cleaned project under Git/version control
                            13. One owner for each responsibility

                            We've also established a much cleaner architecture.

                            Harmony

                            Owns the underlying NodeBB theme/platform behavior.

                            MTO theme

                            Owns presentation:

                            MTO visual styling
                            templates
                            author rail
                            signatures
                            layout
                            presentation of badges
                            MTO plugin

                            Owns data and business rules.

                            The awards system makes this explicit:

                            nodebb-plugin-mto-awards owns badge data/business rules; nodebb-theme-mto owns badge presentation.

                            That separation should extend to the whole project.

                            1. Don't duplicate functionality

                            If NodeBB already provides something, don't create an MTO version of it unless there's a compelling reason.

                            This is why we're moving away from:

                            duplicate JavaScript
                            fake buttons
                            DOM cloning
                            timing hacks
                            direct API calls that bypass NodeBB's normal mechanisms
                            unnecessary ACP overrides

                            The Bookmark investigation is a good example: direct fetch() produced a 403, and the decision was to use NodeBB's proper internal mechanism if we ever revisit it.

                            1. Don't resurrect abandoned approaches

                            If an approach was found to be wrong or dangerous, it's part of the project's institutional knowledge.

                            Examples:

                            Don't resurrect the MutationObserver button-label experimentβ€”it caused a site-wide hang.
                            Don't revive the old JavaScript bottom-topic-bar implementation.
                            Don't use direct Bookmark API fetch().
                            Don't simply set entire post containers to overflow: visible.
                            Don't paste browser JavaScript into the Linux shell.
                            Don't return to old CSS hacks simply because they're still visible somewhere.

                            In other words:

                            A failed experiment becomes a constraint on future solutions.

                            1. Use the right layer for the job

                            We've gradually established:

                            Need Preferred location
                            Core NodeBB behavior NodeBB
                            Base visual framework Harmony
                            MTO presentation nodebb-theme-mto
                            MTO CSS theme.scss
                            MTO templates theme templates
                            MTO-specific client behavior MTO JS
                            MTO data/business rules MTO plugin
                            Historical community data SMF database/import
                            Temporary experimentation browser/dev tools
                            Legacy ACP customization eventually retired

                            The current theme architecture explicitly reflects this separation.

                            1. ACP Custom CSS/JS is not the permanent home

                            The long-term direction is to move MTO-specific functionality out of the ACP and into the actual theme/plugin.

                            But not blindly.

                            The rule is:

                            Determine what ACP code does.
                            Determine whether MTO already owns it.
                            If fully duplicated β†’ remove it.
                            If still needed β†’ keep it.
                            If functionality belongs in the theme β†’ move it.
                            Only disable the ACP layer once the replacement is proven.

                            That's why the ACP cleanup was deliberately treated as an ownership audit rather than a deletion exercise.

                            1. Test the actual user experience, not just the code

                            A successful build isn't enough.

                            We repeatedly use:

                            browser testing
                            actual rendered HTML
                            desktop checks
                            mobile checks
                            Incognito/logged-out checks
                            actual phone testing
                            functional interaction testing

                            For example, the mobile NodeBB navigator wasn't considered fixed until it was confirmed gone on the actual Android phone.

                            Likewise, registration wasn't simply considered done because the template rendered; it was tested in Incognito.

                            1. Mobile is not an afterthought

                            The target isn't just "desktop SMF-looking."

                            Every significant UI change should consider:

                            responsive layout
                            touch interaction
                            mobile spacing
                            mobile navigation
                            whether a desktop-only element should disappear
                            whether information density becomes oppressive on small screens

                            We've deliberately hidden things like the mobile progress navigator and badge display where appropriate, while preserving native responsive behavior.

                            1. Defer things that depend on the migration

                            This has become particularly important now.

                            If a decision depends on:

                            the permanent domain
                            email infrastructure
                            SMF member data
                            account mapping
                            groups/ranks
                            permissions
                            historical imports
                            legacy configuration

                            don't prematurely lock it in.

                            The registration settings are a good example: approval, email verification, username policy, account mapping, etc. were deliberately deferred because the SMF migration and permanent infrastructure hadn't happened yet.

                            1. Phase things instead of building everything at once

                            The Awards project demonstrates this especially well.

                            Phase 1

                            Build the core:

                            catalogue
                            categories
                            artwork
                            manual awarding
                            revoke/remove
                            member awards
                            display
                            requestable awards
                            historical migration
                            Phase 2

                            Add more sophisticated features:

                            request queue
                            favorite badge
                            automatic triggers
                            advanced legacy "cleverness"

                            The explicit philosophy is:

                            The computer handles the paperwork; humans make the award decision.

                            That's a good general model for the whole project.

                            1. Don't build Phase 2 complexity before Phase 1 works

                            This is particularly important for the database/plugin work we're entering now.

                            For example, the current Awards instruction is essentially:

                            Get the already-tested Add Badge POST handler to actually create a badge β†’ test one badge β†’ only then proceed to artwork, migration, requests, rendering, etc.

                            That's exactly how we should approach the SMF migration.

                            1. Get the big things right first

                            The project has a natural priority hierarchy:

                            Preserve data
                            Preserve functionality
                            Get major SMF workflows/UI right
                            Make the architecture clean
                            Polish
                            Tiny visual differences

                            The logs literally summarize the philosophy as:

                            "Get the big things right first."

                            1. When something is good enough, bank it

                            This is another surprisingly important rule.

                            Once something is:

                            working,
                            visually acceptable,
                            tested,
                            backed up,

                            stop touching it.

                            Examples include:

                            bottom topic footer
                            standalone Composer
                            global dark mode
                            logged-out experience
                            registration presentation
                            quote treatment
                            reply history
                            pagination

                            The logs repeatedly mark these as DONE and explicitly warn against reopening them unnecessarily.

                            1. The operational rule: small command blocks

                            Because you're not working as a full-time coder, we've also established a workflow rule for how I should guide you:

                            One small command block β†’ you run it β†’ you paste the exact output β†’ I interpret it β†’ next command.

                            Not a 40-command wall of shell commands.

                            And commands must be clearly separated by environment:

                            Linux/Docker commands β†’ SSH shell
                            browser JavaScript β†’ browser DevTools
                            SCSS/template content β†’ files

                            That distinction was explicitly documented after some painful shell/browser confusion.

                            The "constitution" I'd use from now on

                            If I boil everything down to the rules that matter most, I'd write them like this:

                            MTO/NodeBB Development Rules

                            SMF data is authoritative. Preserve historical truth; don't invent data.
                            NodeBB is the application platform; don't fight its native architecture unnecessarily.
                            Prefer the simplest solution that works.
                            Preserve native NodeBB functionality unless there is a compelling reason not to.
                            Make the result SMF-inspired, not obsessively pixel-perfect.
                            Functionality beats aesthetics.
                            Inspect the real DOM, templates, database structures, and code before changing anything.
                            Never guess at ownership or selectors.
                            Make one focused change at a time.
                            Read-only investigation before destructive changes.
                            Back up/checkpoint before permanent changes.
                            Never blindly delete, overwrite, or migrate data.
                            Don't disturb a known-good system just to make it theoretically cleaner.
                            Prototype incrementally; refactor only after the design is stable.
                            Keep responsibilities separated: NodeBB / Harmony / MTO theme / MTO plugin / SMF data.
                            Avoid duplicate implementations and unnecessary JavaScript.
                            Don't resurrect approaches we've already rejected because they caused problems.
                            Test the actual user experience on desktop, mobile, logged-in, and logged-out states where relevant.
                            Defer configuration that depends on the eventual SMF migration or production infrastructure.
                            Build in phases; prove the smallest working piece before adding complexity.
                            Get the major things right before polishing minor things.
                            When something is tested and good enough, freeze it and move on.
                            Keep the final system maintainable, documented, and free of dead/duplicate code.
                            When guiding implementation, use small, understandable command steps and explain what the result means.

                            And I think there is one new overarching rule that has become necessary now that we're moving deeper into the SMF migration:

                            Data first, UI second.

                            If a proposed NodeBB feature requires us to make assumptions about what the old forum's members, awards, permissions, ranks, groups, or historical records mean, we stop and inspect the SMF database/package first.

                            That is the natural evolution of everything we've learned so far. The UI we've been building is essentially a shell around the community's existing identity and history. The SMF migration needs to determine what goes inside that shellβ€”not the other way around


                            1 Reply Last reply
                            0
                            • Grant LamontagneG
                              Grant LamontagneG
                              Grant Lamontagne
                              administrators
                              wrote on last edited by
                              #44

                              Good news everyone!

                              While taking a short break from the task of creating the whole merit badge system, I have changed the Default Avatar on the new forum from a bland circle with a first initial in it to this one, which was inspired by a certain lobster who tried to use his (terrible) company's health plan to get a new shell.

                              Def

                              Default Avatar.jpg

                              images.jpg


                              1 Reply Last reply
                              0
                              • Grant LamontagneG
                                Grant LamontagneG
                                Grant Lamontagne
                                administrators
                                wrote on last edited by
                                #45

                                I didn't get as much as I wanted done today, but here is what I did get done:

                                MTO Merit Badges β€” Daily Handoff Log

                                Date: 2026-09-23
                                Project: Multitool.Org (MTO) NodeBB Merit Badge recreation
                                Status: Phase 1 prototype is working; historical migration not yet started.

                                Operating rules

                                • SMF is authoritative for historical data: badge definitions, IDs, names, categories, descriptions, artwork associations, member awards, dates, active/revoked state, historical comments/favorites/request information.

                                • Do not invent migration data or reconcile discrepancies by guessing.

                                • Ownership:

                                  • SMF = historical/source data
                                  • MTO Awards plugin = badge definitions, awards, requests, business rules, artwork serving
                                  • MTO theme = presentation
                                  • Harmony/NodeBB = native functionality where practical
                                • Inspect before changing.

                                • One focused change at a time.

                                • Back up before permanent changes.

                                • Test actual UX.

                                • Mobile matters.

                                • Known-good > theoretically cleaner.

                                • Prototype first, refactor later.

                                • Operational pattern: inspect β†’ checkpoint β†’ one change β†’ verify β†’ build/test β†’ checkpoint.

                                • User prefers one small command block at a time, then exact output pasted back.


                                Current environment

                                NodeBB

                                • Container: app-nodebb-1
                                • NodeBB: v4.16.0
                                • Image: elestio/nodebb:latest
                                • Container root: /usr/src/app
                                • Host plugin:
                                  /opt/app/nodebb-plugin-mto-awards
                                • Container plugin:
                                  /usr/src/app/nodebb-plugin-mto-awards
                                • Host theme:
                                  /opt/app/nodebb-theme-mto
                                • Container theme:
                                  /usr/src/app/nodebb-theme-mto
                                • NodeBB listens on 0.0.0.0:4567
                                • Public site: https://multitool.ninja
                                • Canonical URL currently seen in NodeBB logs is the Elestio URL.
                                • Public site/routes have returned HTTP 200.

                                Do not revisit Chrome QUIC/browser networking experiments. Those were investigated already and are not the MTO problem.


                                Phase 1 functionality now working

                                Catalogue

                                • Merit Badge catalogue route:
                                  /mto-awards

                                • Five categories:

                                  • Site
                                  • Collector
                                  • Modification
                                  • User
                                  • Challenge
                                • Demo badges currently seed if no badges exist.

                                • Requestable badges show request forms.

                                • Full/mini artwork infrastructure exists.

                                Manual awarding

                                Working:

                                • Staff can manually award a badge.
                                • Badge appears on member profile.
                                • Duplicate active award is prevented.
                                • Badge can be revoked/removed.
                                • Revoke was tested.

                                Profile integration

                                Native Harmony/NodeBB widget works:

                                Merit Badges widget appears in member profile.

                                MTO theme registered widget areas and the widget was successfully placed in:

                                About me (after)

                                Member request workflow

                                Fully tested end-to-end.

                                Flow:

                                Member submits request β†’ Pending Requests β†’ Staff reviews β†’ Approve OR Reject

                                Both branches have been tested.

                                Approve

                                • Request submitted by Fred.
                                • Admin saw it in Pending Requests.
                                • Approval worked.
                                • Badge was awarded.
                                • Badge appeared on Fred's profile.

                                Reject

                                • Fred's request was rejected.
                                • Confirmation was displayed.
                                • Request rejection appeared to work.
                                • Fred's profile was checked afterward.
                                • No new badge appeared.

                                Therefore:

                                • βœ… request submission
                                • βœ… pending queue
                                • βœ… approval
                                • βœ… award on approval
                                • βœ… rejection
                                • βœ… no award on rejection

                                Management navigation

                                Previously broken because NodeBB v4.16 Ajaxify was intercepting plugin links and attempting to load nonexistent client templates.

                                The final working solution was adding:

                                onclick="event.stopPropagation();"
                                target="_self"
                                

                                to MTO management links.

                                This has now been tested successfully.

                                Verified working:

                                • βœ… Pending Requests
                                • βœ… Award Merit Badge
                                • βœ… Add Merit Badge
                                • βœ… Back to Management
                                • βœ… Edit link was the remaining planned check; Pending/Award/Add were confirmed working after the fix. Back to Management was explicitly confirmed working.

                                Do not reopen this issue unless a new regression appears.

                                There is also a theme capture-phase navigation handler in:

                                /opt/app/nodebb-theme-mto/static/lib/mto-topic-actions.js

                                It was tried during diagnosis and may now be redundant, but it is currently known-good and should not be removed casually.


                                Current known caveat

                                Approve currently does:

                                1. Awards.awardMember()
                                2. Awards.updateRequest()

                                If step 1 succeeds and step 2 fails, theoretically the badge could be awarded while the request remains pending.

                                This is a robustness/transaction-ordering improvement for later.

                                Do not derail the working Phase 1 workflow for this unless we deliberately decide to harden it.


                                Current plugin architecture

                                Package:

                                nodebb-plugin-mto-awards

                                Version:

                                0.1.0

                                Compatibility:

                                ^4.15.0

                                Main:

                                library.js

                                Plugin hooks:

                                {
                                  "hook": "static:app.load",
                                  "method": "init"
                                },
                                {
                                  "hook": "filter:widget.render:mto-awards",
                                  "method": "renderMemberAwardsWidget"
                                },
                                {
                                  "hook": "filter:widgets.getWidgets",
                                  "method": "defineWidgets"
                                }
                                

                                Static images:

                                "staticDirs": {
                                  "images": "public/images"
                                }
                                

                                Core Redis data model

                                Prefix:

                                mto:awards

                                Keys include:

                                mto:awards:badges
                                mto:awards:badge:<id>
                                mto:awards:member:<uid>
                                mto:awards:member:<uid>:<badgeId>
                                mto:awards:requests
                                mto:awards:request:<id>
                                

                                Badge creation stores the badge object and sorted-set membership.

                                Member awards are stored separately and indexed by member and badge.

                                Requests have their own objects and sorted-set index.


                                Boolean normalization fix

                                Redis setObject stringifies booleans.

                                This caused requestable / assignable values to come back as strings.

                                Awards.getBadge() now normalizes them:

                                if (typeof badge.requestable === 'string') {
                                    badge.requestable = badge.requestable === 'true';
                                }
                                
                                if (typeof badge.assignable === 'string') {
                                    badge.assignable = badge.assignable === 'true';
                                }
                                

                                Backup:

                                /opt/app/nodebb-plugin-mto-awards/lib/awards.js.before-boolean-normalization

                                This is working.


                                Demo badges

                                Currently seeded:

                                ID Badge Category Requestable
                                demo-user Helpful Human User No
                                demo-site MTO Citizen Site No
                                demo-modification Mod Squad Modification Yes
                                demo-collector Collector Collector Yes
                                demo-challenge Challenge Accepted Challenge Yes

                                init also deletes:

                                __mto_test_badge__


                                Fred test data

                                Fred UID:

                                3

                                Currently known historical/demo awards include:

                                • demo-user β€” Helpful Human
                                • demo-site β€” MTO Citizen
                                • demo-modification β€” Mod Squad

                                These were manually awarded test/demo awards.

                                Do not delete yet.

                                They should eventually be deliberately cleaned up before/when the real SMF historical migration occurs.

                                Fred's request for Challenge Accepted was used to test the request workflow and was subsequently rejected.


                                Artwork archive

                                Uploaded archive:

                                awards.zip

                                Available at:

                                /mnt/data/mto-awards-inspect/awards.zip

                                Inspection found:

                                • 401 total archive entries

                                • 396 PNGs

                                • 205 distinct artwork IDs

                                • Full artwork: 50Γ—60

                                • Mini artwork: 25Γ—25 where present

                                • 191 minis

                                • 14 missing minis:

                                  • 15
                                  • 16
                                  • 91
                                  • 112
                                  • 207
                                  • 208
                                  • 209
                                  • 210
                                  • 211
                                  • 212
                                  • 214
                                  • 215
                                  • 217
                                  • 218

                                Important:

                                205 artwork IDs β‰  194 legacy badges.

                                Do not assume a one-to-one relationship.


                                Historical SMF data

                                This is the next major Phase 1 task, but migration has NOT started.

                                Legacy plugin:

                                spuds:member_awards

                                Version:

                                3.0

                                Target SMF:

                                2.0–2.0.99

                                Expected historical catalogue:

                                Category Count
                                Site 18
                                Collector 32
                                Modification 5
                                User 27
                                Challenge 112
                                Total 194

                                SMF awards fields requested:

                                id_award
                                award_name
                                description
                                id_category
                                time_added
                                filename
                                minifile
                                award_trigger
                                award_type
                                award_location
                                award_requestable
                                award_assignable
                                

                                Award types include:

                                • Manual
                                • Post count
                                • Top posters
                                • Topic count
                                • Top topic starters
                                • Time online
                                • Member since
                                • Karma

                                Display locations:

                                • Below avatar
                                • Above avatar
                                • Signature
                                • Off

                                Image formats:

                                • Full frame
                                • Heading
                                • No frame

                                Historical member-award data:

                                awards_members

                                Need:

                                • member/user ID
                                • award/badge ID
                                • date received
                                • favorite
                                • award type
                                • active
                                • comments
                                • any additional columns

                                Historical requests may be represented by inactive awards_members rows; preserve them exactly.

                                Need SMF member ID → username and existing SMF→NodeBB mapping.

                                Need original artwork archive including unused artwork.

                                Need schemas / SHOW CREATE TABLE for:

                                • awards
                                • awards_members
                                • categories
                                • requests

                                Also:

                                • SMF version
                                • plugin version/configuration

                                Requested sysadmin package:

                                smf-awards/
                                β”œβ”€β”€ awards.sql
                                β”œβ”€β”€ awards_members.sql
                                β”œβ”€β”€ categories.sql
                                β”œβ”€β”€ requests.sql
                                β”œβ”€β”€ members-award-map.csv
                                β”œβ”€β”€ artwork/
                                └── schema/
                                

                                Instruction to sysadmin:

                                Preserve historical/inactive/revoked records. Do not clean, dedupe, rename, reconcile, or import yet.


                                Checkpoint created tonight

                                This is important.

                                At:

                                2026-09-23 23:08:29

                                Full filesystem checkpoint was successfully created.

                                Plugin:

                                /opt/app/nodebb-plugin-mto-awards.checkpoint-20260923-230829
                                

                                Theme:

                                /opt/app/nodebb-theme-mto.checkpoint-20260923-230829
                                

                                Command completed with:

                                CHECKPOINT CREATED
                                Plugin: /opt/app/nodebb-plugin-mto-awards.checkpoint-20260923-230829
                                Theme:  /opt/app/nodebb-theme-mto.checkpoint-20260923-230829
                                

                                This is the known-good rollback point.


                                Important backups already made

                                Examples:

                                lib/awards.js.before-boolean-normalization
                                lib/awards.js.before-member-requests
                                lib/awards.js.before-request-review
                                
                                templates/mto-awards.tpl.before-catalogue-polish
                                templates/mto-awards.tpl.before-request-form
                                templates/mto-awards-requests.tpl.before-request-review
                                templates/mto-awards-manage.tpl.before-requests-queue
                                templates/mto-awards-award.tpl.before-inline-nav
                                templates/mto-awards-requests.tpl.before-inline-nav
                                templates/mto-awards-manage.tpl.before-inline-nav
                                
                                library.js.before-request-review
                                
                                theme/static/lib/mto-topic-actions.js.before-capture-nav-fix
                                theme/plugin.json.before-widget-areas
                                

                                What NOT to do tomorrow

                                1. Do not redo the navigation investigation.
                                2. Do not change working request approval/rejection merely for aesthetics.
                                3. Do not delete demo awards yet.
                                4. Do not start historical migration without the SMF export.
                                5. Do not guess which artwork corresponds to which historical badge.
                                6. Do not reconcile the 205 artwork IDs against the 194 badges without SMF evidence.
                                7. Do not introduce Phase 2 automation/triggers yet.
                                8. Do not chase unrelated service-worker/font warnings unless they become relevant.
                                9. Do not experiment with Chrome QUIC/network settings.

                                Tomorrow's recommended starting point

                                First question should be:

                                Has the SMF sysadmin export arrived?

                                If NO:

                                Do not manufacture work. We can inspect the current implementation and identify any remaining Phase 1 gaps, but historical migration waits for authoritative data.

                                If YES:

                                Do not import immediately.

                                First:

                                1. Inspect the export structure.
                                2. Verify counts.
                                3. Verify category IDs/names/order.
                                4. Verify badge IDs.
                                5. Verify member-award records.
                                6. Verify request/inactive records.
                                7. Verify member mapping.
                                8. Inspect artwork filenames against the actual SMF records.
                                9. Produce a migration mapping/dry run.
                                10. Only then discuss import.

                                Bottom line

                                Tonight we reached a solid checkpoint:

                                The MTO Merit Badge prototype is operational through the complete manual/request/review lifecycle, and the working plugin + theme have been checkpointed.

                                The project is now ready to move from building/testing the Phase 1 machinery toward authoritative SMF historical-data preparation.

                                Known-good checkpoint: 20260923-230829

                                If tomorrow's version of me reads only this handoff, it should not start over.


                                1 Reply Last reply
                                0
                                • Grant LamontagneG
                                  Grant LamontagneG
                                  Grant Lamontagne
                                  administrators
                                  wrote on last edited by
                                  #46

                                  Working on BBCode today- Merit Badges are largely done, just need to import them.

                                  Spoiler:
                                  This is how the spoiler works.

                                  Def


                                  1 Reply Last reply
                                  0
                                  • Grant LamontagneG
                                    Grant LamontagneG
                                    Grant Lamontagne
                                    administrators
                                    wrote on last edited by
                                    #47

                                    TL:DR

                                    Merit Badge system is done, still need to import the current badges, their info and what users have what badges.

                                    BBCode should work now, at least the main ones like Bold, Italics, Move, Spoiler URL links and so on.

                                    Absolutely. Here's a standalone handoff log you can paste into a new conversation if necessary. I've made it deliberately detailed enough that another instance should be able to pick up without reconstructing the whole session.

                                    MTO NodeBB β€” BBCode Compatibility Handoff Log

                                    Date: 2026-09-24
                                    Project: Multitool.Org NodeBB migration
                                    Current focus: Legacy SMF BBCode compatibility


                                    1. Overall objective

                                    NodeBB is replacing the historical SMF forum, but the existing posts must not be rewritten.

                                    Architecture:

                                    Historical SMF post source
                                            ↓
                                    MTO BBCode compatibility plugin
                                            ↓
                                    NodeBB Markdown
                                            ↓
                                    post-Markdown compatibility renderers
                                            ↓
                                    NodeBB sanitizer
                                            ↓
                                    Rendered HTML
                                    

                                    The original SMF BBCode remains stored in the post source.

                                    The compatibility plugin is:

                                    /opt/app/nodebb-plugin-mto-bbcode
                                    

                                    Mounted into the container at:

                                    /usr/src/app/nodebb-plugin-mto-bbcode
                                    

                                    Theme:

                                    /opt/app/nodebb-theme-mto
                                    

                                    mounted at:

                                    /usr/src/app/nodebb-theme-mto
                                    

                                    NodeBB version:

                                    4.16.0
                                    

                                    2. Legacy BBCode status

                                    Core legacy tags currently working:

                                    SMF tag Status
                                    **...** βœ… Working
                                    *...* βœ… Working
                                    <u>...</u> βœ… Working
                                    ~~...~~ βœ… Working
                                    `

                                    Spoiler:
                                    ...
                                    | βœ… Working | | `` | βœ… Working | |
                                    ...

                                    | βœ… Working | |

                                    ...
                                    

                                    | βœ… Working | |(http://...) | βœ… Working | |... | βœ… Working | |...` | βœ… Working |

                                    URL variants are considered one BBCode type.


                                    3. Important pipeline discovery

                                    NodeBB Markdown plugin runs at:

                                    filter:parse.post priority 5
                                    

                                    MTO BBCode parser runs at:

                                    priority 4
                                    

                                    Post-Markdown compatibility renderers run at:

                                    priority 6
                                    

                                    Emoji:

                                    priority 9
                                    

                                    Sanitizer:

                                    priority 10
                                    

                                    NodeBB Markdown has:

                                    html: false
                                    

                                    Therefore, most compatibility conversions need to produce Markdown first, rather than raw HTML at priority 4.

                                    This was an important discovery.


                                    4. Working BBCode plugin architecture

                                    Current plugin.json hooks:

                                    {
                                      "hooks": [
                                        {
                                          "hook": "filter:parse.post",
                                          "method": "parsePost",
                                          "priority": 4
                                        },
                                        {
                                          "hook": "filter:parse.post",
                                          "method": "renderUnderline",
                                          "priority": 6
                                        },
                                        {
                                          "hook": "filter:parse.post",
                                          "method": "renderSpoiler",
                                          "priority": 6
                                        },
                                        {
                                          "hook": "filter:parse.post",
                                          "method": "renderMove",
                                          "priority": 6
                                        }
                                      ]
                                    }
                                    

                                    Current module.exports includes:

                                    module.exports = {
                                        parsePost,
                                        renderUnderline,
                                        renderSpoiler,
                                        renderMove,
                                    };
                                    

                                    Important: renderMove initially failed because it was not exported even though the hook existed. This caused the temporary

                                    ...
                                    markers to appear literally. The export was subsequently fixed and verified.


                                    5. `

                                    Spoiler:
                                    ` implementation

                                    Legacy behavior desired:

                                    • closed by default
                                    • button says Show content
                                    • clicking opens content
                                    • button changes to Hide content
                                    • clicking again hides it
                                    • content appears inside a bordered/rounded box
                                    • no spoiler title
                                    • works logged-in and logged-out

                                    Server renderer now produces approximately:

                                    <div class="mto-spoiler">
                                        <button type="button"
                                                class="mto-spoiler-toggle"
                                                aria-expanded="false">
                                            Show content
                                        </button>
                                        <div class="mto-spoiler-content mto-spoiler-closed" hidden>
                                            ...
                                        </div>
                                    </div>
                                    

                                    The explicit class was added because the HTML hidden attribute alone was not reliably keeping the content hidden in the rendered NodeBB page.

                                    Theme CSS:

                                    /* MTO legacy SMF spoiler */
                                    .mto-spoiler-content.mto-spoiler-closed {
                                        display: none !important;
                                    }
                                    
                                    .mto-spoiler-content {
                                        margin-top: 0.5rem;
                                        padding: 0.75rem;
                                        border: 1px solid var(--bs-border-color, #dee2e6);
                                        border-radius: 0.375rem;
                                    }
                                    

                                    Theme JS toggles:

                                    content.classList.remove("mto-spoiler-closed");
                                    

                                    when opening, and:

                                    content.classList.add("mto-spoiler-closed");
                                    

                                    when closing.

                                    The JS also maintains:

                                    aria-expanded
                                    Show content
                                    Hide content
                                    hidden attribute
                                    

                                    The spoiler was tested in a logged-out browser as well as the normal logged-in environment.

                                    Result: confirmed working.


                                    6. `` implementation

                                    Confirmed desired MTO behavior:

                                    Text enters from the right side, travels left, disappears off the left, then continues by re-entering from the right forever.

                                    We deliberately did not use obsolete <marquee>.

                                    Current parser conversion:

                                    // ...
                                    content = content.replace(
                                        /\([\s\S]*?)\[\/move\]/gi,
                                        (_, body) => `
                                    ${body}
                                    ` );

                                    Post-Markdown renderer:

                                    function renderMove(data) {
                                        if (!data || !data.postData || typeof data.postData.content !== 'string') {
                                            return data;
                                        }
                                    
                                        data.postData.content = data.postData.content.replace(
                                            /\[\[MTO_MOVE_START\]\]([\s\S]*?)\[\[MTO_MOVE_END\]\]/g,
                                            (_, body) => (
                                                '<div class="mto-move">' +
                                                    '<div class="mto-move-track">' +
                                                        body +
                                                    '</div>' +
                                                '</div>'
                                            )
                                        );
                                    
                                        return data;
                                    }
                                    

                                    Theme CSS:

                                    /* MTO legacy SMF move */
                                    .mto-move {
                                        overflow: hidden;
                                        width: 100%;
                                    }
                                    
                                    .mto-move-track {
                                        display: inline-block;
                                        white-space: nowrap;
                                        padding-left: 100%;
                                        animation: mto-move-scroll 12s linear infinite;
                                    }
                                    
                                    @keyframes mto-move-scroll {
                                        from {
                                            transform: translateX(0);
                                        }
                                        to {
                                            transform: translateX(-100%);
                                        }
                                    }
                                    

                                    A real test post was created:

                                    This is moving text β€” MTO legacy move test
                                    

                                    Test post:

                                    #75
                                    

                                    After the export fix, build, restart, and refresh:

                                    • temporary markers disappeared
                                    • text rendered correctly
                                    • text visibly moved
                                    • continuous scrolling behavior confirmed visually

                                    User explicitly confirmed:

                                    "The Moving text is now moving. One more success for today- great job"

                                    So `` is now considered known-good.


                                    7. Failed `` attempts worth remembering

                                    There were several shell quoting problems during implementation.

                                    Failed sed edit

                                    A sed command mangled the `` block by interpreting backslashes.

                                    The bad file was immediately restored from the known-good checkpoint.

                                    Failed nested Python commands

                                    Several attempts to embed JavaScript template literals inside:

                                    docker exec ... sh -lc "python3 ..."
                                    

                                    failed because shell command substitution interpreted backticks.

                                    Lesson: for future source edits involving JS template literals, use a host-side Python script against:

                                    /opt/app/...
                                    

                                    rather than nesting Python inside docker exec sh -lc.

                                    The successful host-side edit pattern was:

                                    python3 - <<'PY'
                                    from pathlib import Path
                                    
                                    p = Path('/opt/app/nodebb-plugin-mto-bbcode/library.js')
                                    s = p.read_text()
                                    
                                    ...
                                    p.write_text(...)
                                    PY
                                    

                                    This worked cleanly.


                                    8. Important checkpoint

                                    A new checkpoint was created after `` was fully working:

                                    20260924-173751
                                    

                                    Paths:

                                    /usr/src/app/nodebb-plugin-mto-bbcode.checkpoint-20260924-173751
                                    /usr/src/app/nodebb-theme-mto.checkpoint-20260924-173751
                                    

                                    Equivalent host-mounted source:

                                    /opt/app/nodebb-plugin-mto-bbcode
                                    /opt/app/nodebb-theme-mto
                                    

                                    This is currently the best known-good restore point.

                                    It contains:

                                    • all working BBCode conversions
                                    • working spoiler
                                    • working move
                                    • working theme CSS
                                    • working theme JS

                                    Previous checkpoint immediately before move work:

                                    20260924-171753
                                    

                                    That checkpoint contains the working spoiler implementation but not the completed move implementation.


                                    9. Build/restart status

                                    Latest successful build:

                                    Asset compilation successful. Completed in 6.028sec.
                                    

                                    Latest successful restart was performed after that build.

                                    Plugin JavaScript syntax check:

                                    library.js OK
                                    

                                    Plugin JSON validation:

                                    plugin.json OK
                                    

                                    Theme JavaScript syntax was previously validated:

                                    Both JavaScript files OK.
                                    

                                    No current syntax errors are known.

                                    The following unrelated warnings continue to appear during NodeBB builds:

                                    "nodebb-plugin-blog-comments" is active but not installed.
                                    "nodebb-plugin-calendar" is active but not installed.
                                    "nodebb-plugin-mto-awards" is active but not installed.
                                    

                                    These did not prevent successful builds and are unrelated to this BBCode work.


                                    10. Existing theme JS location

                                    Main MTO theme client script:

                                    /opt/app/nodebb-theme-mto/static/lib/mto-topic-actions.js
                                    

                                    It already contains numerous MTO behaviors, including:

                                    • Merit Badge navigation capture
                                    • topic share/print
                                    • post counts
                                    • composer handling
                                    • reply history
                                    • quote actions
                                    • reply-body handling
                                    • registration page behavior
                                    • spoiler toggle

                                    The spoiler toggle was appended near the end of this file.


                                    11. Existing theme stylesheet

                                    Theme stylesheet:

                                    /opt/app/nodebb-theme-mto/theme.scss
                                    

                                    Both spoiler and move CSS were added here.

                                    There are no standalone stylesheet files under the theme's static tree.


                                    12. Historical source preservation

                                    A key project requirement remains:

                                    Do not modify historical stored post content.

                                    For example, the raw API previously confirmed that an old post still contained:

                                    
                                    

                                    even though NodeBB rendered it as an image.

                                    The same principle now applies to:

                                    [spoiler]...
                                    
                                    

                                    and:

                                    ...
                                    

                                    The compatibility layer dynamically converts them during rendering.


                                    13. Composer preview limitation

                                    One known limitation remains:

                                    The NodeBB composer preview is client-side and does not run the server-side:

                                    filter:parse.post
                                    

                                    pipeline.

                                    Therefore legacy SMF BBCode currently appears literally in composer preview.

                                    This was observed earlier and deliberately left as a future task.

                                    Do not assume that fixing the server-side renderer automatically fixes composer preview.


                                    14. Current next candidate work

                                    The original core list is now effectively complete.

                                    Potential future work:

                                    1. Composer preview compatibility

                                      • Make legacy BBCode display correctly in the composer preview.
                                      • This is separate from server-side rendering.
                                    2. Additional/less-common SMF BBCode

                                      • Only after identifying what actually exists in historical MTO data.
                                      • Do not invent tags.
                                    3. Historical SMF migration

                                      • Still waiting for the SMF sysadmin export.
                                      • Do not begin badge migration until the authoritative package arrives.

                                    15. Merit Badge project context

                                    Separate but ongoing project:

                                    MTO Awards plugin:

                                    nodebb-plugin-mto-awards
                                    

                                    Known-good Phase 1 functionality:

                                    • catalogue /mto-awards

                                    • five categories:

                                      • Site
                                      • Collector
                                      • Modification
                                      • User
                                      • Challenge
                                    • full/mini artwork

                                    • manual awarding

                                    • revoke/remove

                                    • profile widget

                                    • requestable badges

                                    • pending request queue

                                    • approve/reject

                                    • management pages

                                    • permissions

                                    • mobile-aware UI

                                    Historical migration is waiting for SMF export.

                                    Expected legacy counts:

                                    Site          18
                                    Collector     32
                                    Modification   5
                                    User          27
                                    Challenge    112
                                    ----------------
                                    Total        194
                                    

                                    Do not import until authoritative SMF export arrives.


                                    16. Global MTO navigation context

                                    Global MTO top menu is already operational:

                                    • Home
                                    • Search
                                    • Profile
                                    • Notifications
                                    • Bookmarks
                                    • Members
                                    • Merit Badges
                                    • etc.

                                    Header work is complete enough for now.

                                    Profile cover overlay issue was fixed with:

                                    .account {
                                        position: relative;
                                    }
                                    

                                    Global navigation checkpoint:

                                    /opt/app/nodebb-theme-mto.checkpoint-global-nav-working-20260924
                                    

                                    17. Operating rules for continuing the project

                                    Use this workflow:

                                    inspect
                                    ↓
                                    backup/checkpoint
                                    ↓
                                    one focused change
                                    ↓
                                    syntax/structure check
                                    ↓
                                    build
                                    ↓
                                    restart if needed
                                    ↓
                                    test actual UX
                                    ↓
                                    checkpoint known-good state
                                    

                                    User strongly prefers:

                                    • one small command block at a time
                                    • exact output returned
                                    • interpretation before next command
                                    • no unrelated rabbit holes
                                    • no repeated browser/network/QUIC experiments
                                    • inspect before changing
                                    • known-good over theoretically cleaner
                                    • mobile matters
                                    • test actual UX
                                    • don't guess historical data

                                    18. Current state in one sentence

                                    As of checkpoint 20260924-173751, MTO's NodeBB legacy SMF BBCode compatibility layer successfully renders the core historical BBCode set, including functional default-closed spoilers and continuously looping right-to-left `` text, while leaving stored historical post source untouched.


                                    1 Reply Last reply
                                    0
                                    • Grant LamontagneG
                                      Grant LamontagneG
                                      Grant Lamontagne
                                      administrators
                                      wrote on last edited by
                                      #48

                                      MTO β†’ NodeBB Migration Checklist
                                      πŸ”΄ Priority 1 β€” Core User Experience

                                      These are the things members will notice immediately.

                                      Navigation & basic usability
                                      Global MTO top navigation
                                      Profile/header positioning
                                      Notifications / bookmarks / members navigation
                                      Merit Badges accessible from global navigation
                                      Column width / forum layout
                                      Get the main forum/topic/post widths feeling right on desktop
                                      Check mobile at the same time
                                      Review major profile UX
                                      Make sure the profile feels like MTO rather than stock NodeBB
                                      Identify obvious missing/awkward SMF-era functionality
                                      Posting & reading
                                      Legacy SMF BBCode rendering
                                      Historical posts render correctly
                                      Spoilers
                                      Moving text
                                      Images/links/formatting
                                      New-user posting delay adjusted
                                      Composer UX
                                      Legacy BBCode preview is still a known difference
                                      Decide whether it needs fixing or whether it is acceptable
                                      Mobile posting/read experience
                                      Test the actual forum rather than just desktop
                                      🟠 Priority 2 β€” Private Communication

                                      This is the biggest obvious gap we've identified from the SMF experience.

                                      Private Messages / Chat
                                      Determine what NodeBB private chat already provides
                                      MTO Private Messages interface
                                      Private Message from member profile
                                      New PM
                                      To: member selection
                                      One-to-one conversations
                                      Small group conversations
                                      Approximately 3–6 participants
                                      Subject
                                      Normal message composer
                                      Persistent conversation history
                                      Replying
                                      Unread/notification behavior
                                      Decide how Chat should coexist with PMs
                                      Keep Chat as-is?
                                      Rename/rebrand it?
                                      Present private conversations as "Private Messages"?
                                      Avoid confusing members with two competing private-message systems
                                      New-member communication restrictions
                                      Define the MTO new-member policy
                                      Number of posts required before PM
                                      Number of posts required before Chat
                                      Any other new-member restrictions
                                      Implement PM/Chat restriction without bypasses
                                      Test with:
                                      brand-new member
                                      qualifying member
                                      staff member

                                      Important dependency: we should design PMs with this restriction in mind before finalizing the PM implementation.

                                      🟑 Priority 3 β€” Major MTO Functionality

                                      These aren't necessarily things every member sees every day, but they're important parts of the site's identity/function.

                                      Treasury
                                      Determine exactly what SMF Treasury functionality MTO currently uses
                                      Identify NodeBB replacement/implementation
                                      Determine whether historical Treasury data needs migration
                                      Build/test the replacement
                                      Test member-facing UX
                                      Test staff/admin functionality

                                      I deliberately haven't assumed what Treasury needs to do in NodeBB yet. We should compare the actual SMF functionality before deciding on an implementation.

                                      Merit Badges
                                      Badge system/plugin
                                      Catalogue
                                      Categories
                                      Artwork infrastructure
                                      Manual awarding
                                      Revocation
                                      Member profile display
                                      Requests
                                      Approval/rejection
                                      Management UI
                                      Permissions
                                      Mobile presentation
                                      Historical SMF badge migration
                                      Waiting for SMF export
                                      Definitions
                                      Categories
                                      Member awards
                                      Dates
                                      Active/revoked state
                                      Comments/favorites
                                      Requests
                                      Artwork associations
                                      SMF β†’ NodeBB member mapping
                                      🟒 Priority 4 β€” Migration Completeness / Polish

                                      This is where we'll make sure we're not quietly leaving important SMF functionality behind.

                                      SMF β†’ NodeBB functionality audit
                                      Systematically compare important SMF member functions against NodeBB
                                      Identify missing functionality
                                      Classify each item:
                                      native NodeBB
                                      theme customization
                                      plugin
                                      migration required
                                      not needed
                                      Work through remaining high-value gaps
                                      Don't attempt to reproduce SMF features that MTO doesn't actually use
                                      Final UX pass
                                      Desktop walkthrough
                                      Mobile walkthrough
                                      New-member walkthrough
                                      Established-member walkthrough
                                      Staff walkthrough
                                      Check navigation consistency
                                      Check notifications
                                      Check permissions
                                      Check obvious error messages
                                      Check major workflows end-to-end
                                      ⏸️ Waiting / External Dependencies

                                      These shouldn't block us from continuing with other work.

                                      SMF historical export
                                      Historical Merit Badge migration
                                      Any additional SMF data identified during the functionality audit
                                      Suggested working order

                                      If we're trying to cover as much ground as possible without getting bogged down, I'd work roughly like this:

                                      1. Column width / layout
                                        ↓
                                      2. Composer + mobile UX review
                                        ↓
                                      3. Investigate NodeBB private chat capabilities
                                        ↓
                                      4. Design MTO Private Messages around those capabilities
                                        ↓
                                      5. Define and implement new-member PM/Chat restrictions
                                        ↓
                                      6. Treasury investigation
                                        ↓
                                      7. Historical Merit Badge import when SMF export arrives
                                        ↓
                                      8. Systematic SMF functionality audit
                                        ↓
                                      9. Final desktop/mobile/member/staff UX pass


                                      1 Reply Last reply
                                      0
                                      • Grant LamontagneG
                                        Grant LamontagneG
                                        Grant Lamontagne
                                        administrators
                                        wrote on last edited by
                                        #49

                                        So far today:

                                        MTO / NodeBB Daily Handoff Log β€” 2026-09-25

                                        Overall status

                                        NodeBB migration/prototype work continues successfully. Today's work focused on the profile page/header presentation. The profile identity and spacing issues are now in a satisfactory state and are being parked until the SMF historical export arrives.

                                        The major outstanding project milestone remains:

                                        Receive SMF Merit Awards export β†’ inspect β†’ map β†’ prepare historical migration.

                                        No historical SMF data has been imported.


                                        1. Profile page β€” completed today

                                        Username visibility problem

                                        Problem: Harmony's profile template contained the username correctly, but the name was effectively invisible.

                                        Investigation established:

                                        • .account .fullname existed and contained the correct username.

                                        • Computed CSS showed:

                                          • display: block
                                          • visibility: visible
                                          • opacity: 1
                                        • Browser elementFromPoint() showed the Harmony .cover was physically sitting over the username.

                                        • Profile DOM structure:

                                        .account
                                        β”œβ”€β”€ .cover   position:absolute; z-index:0
                                        └── .row     position:static
                                        

                                        Fix

                                        Added:

                                        /* Keep Harmony profile content above the cover */
                                        .account > .row {
                                            position: relative;
                                            z-index: 1;
                                        }
                                        

                                        This successfully brought the profile content above the cover.

                                        Text contrast

                                        The username was still extremely difficult to see because the theme had been forcing the profile identity text to a dark charcoal colour.

                                        Changed to:

                                        .account .fullname,
                                        .account .username {
                                            color: #fff !important;
                                        }
                                        

                                        Result:

                                        • kirk13 clearly visible
                                        • @kirk13 clearly visible
                                        • Fred clearly visible
                                        • SteveC clearly visible
                                        • Works with cover photos
                                        • Works in dark/light presentation

                                        2. Profile vertical spacing β€” completed/parked

                                        Original problem

                                        Harmony had:

                                        .account {
                                            margin-top: 200px;
                                        
                                            @include media-breakpoint-up(md) {
                                                margin-top: 300px;
                                            }
                                        }
                                        

                                        This produced a very large blank area between the global MTO navigation and the profile.

                                        First adjustment

                                        Set:

                                        .account {
                                            margin-top: 0 !important;
                                        }
                                        

                                        This removed the giant gap but caused the avatar to climb into/overlap the global MTO logo.

                                        Final current adjustment

                                        Changed to:

                                        .account {
                                            margin-top: 150px !important;
                                        }
                                        

                                        Current result is acceptable:

                                        • Much smaller gap than original Harmony
                                        • Avatar clears the MTO logo
                                        • Profile header remains visually separated from global navigation
                                        • There is still some blank space above the profile
                                        • That space may potentially be useful later for advertising

                                        Decision: Leave it alone for now. Do not spend more time optimizing the spacing unless a later requirement makes it necessary.


                                        3. Profile screenshots / UX result

                                        Current profile presentation now has:

                                        • MTO global navigation
                                        • Avatar overlapping the profile cover naturally
                                        • Visible username
                                        • Visible @username
                                        • Group/title badge where applicable
                                        • Follow
                                        • Chat
                                        • Profile settings controls where applicable
                                        • Cover photo
                                        • Community Links
                                        • Profile statistics
                                        • Left-side profile navigation

                                        Tested visually with:

                                        • kirk13
                                        • Fred
                                        • SteveC

                                        Light and dark presentations both checked.

                                        Profile header/layout is now considered good enough and parked.


                                        4. Checkpoints

                                        Existing successful checkpoint from before the profile layout work:

                                        /usr/src/app/nodebb-theme-mto.checkpoint-profile-username-fixed-20260925
                                        

                                        This contains the successful username visibility/z-index work.

                                        A final profile-layout checkpoint was proposed but has NOT yet been confirmed as created:

                                        /usr/src/app/nodebb-theme-mto.checkpoint-profile-layout-final-20260925
                                        

                                        If continuing later, first verify whether that checkpoint exists rather than assuming it does.


                                        5. Current theme overrides

                                        The relevant MTO additions currently include:

                                        /* Keep Harmony profile identity above the cover */
                                        .account > .cover {
                                            z-index: 0;
                                        }
                                        
                                        .account > .d-flex.flex-column.flex-md-row {
                                            position: relative;
                                            z-index: 1;
                                        }
                                        

                                        and:

                                        .account .fullname,
                                        .account .username {
                                            color: #fff !important;
                                        }
                                        

                                        and:

                                        /* Keep Harmony profile content above the cover */
                                        .account > .row {
                                            position: relative;
                                            z-index: 1;
                                        }
                                        

                                        and the profile spacing override:

                                        .account {
                                            margin-top: 150px !important;
                                        }
                                        

                                        Note

                                        There are now some overlapping/earlier experimental profile CSS rules in the theme, particularly the earlier .account > .cover / .account > .d-flex... rules.

                                        They are currently harmless and the page is working.

                                        Do not refactor them casually. If we revisit profile CSS later, inspect the current file and clean it up deliberately rather than stacking more overrides.


                                        6. Build/restart

                                        Today's successful build:

                                        Asset compilation successful. Completed in 6.078sec.
                                        

                                        Important Docker detail established today:

                                        NodeBB container: app-nodebb-1
                                        

                                        Correct restart mechanism:

                                        docker restart app-nodebb-1
                                        

                                        ./nodebb restart inside the container reported:

                                        NodeBB could not be restarted, as a running instance could not be found.
                                        

                                        This is expected because Docker is managing the NodeBB process/container.

                                        Build command:

                                        docker exec -it app-nodebb-1 bash -lc 'cd /usr/src/app && ./nodebb build'
                                        

                                        7. Existing NodeBB warnings

                                        Build continues to report these warnings:

                                        "nodebb-plugin-blog-comments" is active but not installed.
                                        "nodebb-plugin-calendar" is active but not installed.
                                        "nodebb-plugin-mto-awards" is active but not installed.
                                        

                                        These are known existing warnings and were not investigated today.

                                        Do not chase them unless they become relevant.


                                        8. Merit Badges project status

                                        Still operational from previous work.

                                        Working

                                        • /mto-awards
                                        • Badge catalogue
                                        • Categories
                                        • Full/mini artwork
                                        • Manual awarding
                                        • Revoke/remove
                                        • Profile Merit Badges widget
                                        • Requestable badges
                                        • Staff request queue
                                        • Approve/reject
                                        • Duplicate pending-request protection
                                        • Permissions
                                        • Management pages
                                        • Add/edit/delete
                                        • Delete protection for awarded badges
                                        • Native Harmony/NodeBB integration
                                        • Mobile-aware presentation

                                        Important UX decision

                                        Do NOT put Merit Badges in the post author column.

                                        The desired placement is:

                                        At the bottom of each post, with the signature, matching the old SMF UX.


                                        9. Legacy SMF BBCode

                                        Working compatibility layer remains operational.

                                        Supported/tested:

                                        [b]
                                        [i]
                                        [u]
                                        [s]
                                        [spoiler]
                                        [img]
                                        
                                        
                                        

                                        [quote]
                                        [url]

                                        
                                        Architecture remains:
                                        
                                        ```text
                                        Stored SMF source
                                                ↓
                                        MTO BBCode compatibility parser
                                                ↓
                                        NodeBB Markdown
                                                ↓
                                        sanitizer
                                                ↓
                                        rendered HTML
                                        

                                        Historical stored post content remains untouched.

                                        Working tests

                                        • Old posts dynamically render legacy BBCode.
                                        • [img] renders.
                                        • [b], [i], [s], [u] render.
                                        • [quote] renders.
                                        • [code] renders.
                                        • Both URL forms render.
                                        • [spoiler] works with Show/Hide.
                                        • `` works with continuous right-to-left scrolling.
                                        • Raw API still shows original SMF BBCode source.

                                        Known limitation

                                        Composer preview does not currently render the legacy BBCode conversion.

                                        It shows the literal tags in preview.

                                        Decision:

                                        Defer composer-preview support until after historical migration.

                                        This is a QoL issue, not a migration blocker.


                                        10. New-user restrictions

                                        Previously identified and effectively crossed off.

                                        NodeBB had been enforcing:

                                        New user can only post once every 120 seconds
                                        until earning 3 reputation
                                        

                                        The forum does not use reputation as a meaningful user system.

                                        This was identified as a NodeBB New User Restrictions / Post Restrictions configuration issue rather than a code problem.

                                        User subsequently indicated this was addressed and no other obvious new-user restrictions had been observed.


                                        11. Main content width

                                        Completed previously and remains working:

                                        #content.container-lg {
                                            max-width: 1440px;
                                        }
                                        

                                        Checkpoint:

                                        /usr/src/app/nodebb-theme-mto.checkpoint-content-width-20260925
                                        

                                        User confirmed the wider layout works in both light and dark modes.


                                        12. Global MTO navigation

                                        Working globally:

                                        Home
                                        Search
                                        Profile
                                        Notifications
                                        Bookmarks
                                        Members
                                        Merit Badges
                                        

                                        Header/navigation work is considered stable.

                                        Profile cover/header positioning required the additional z-index work documented above.


                                        13. SMF historical migration β€” still waiting

                                        This remains the major next-stage task.

                                        Expected legacy badge counts:

                                        Site          18
                                        Collector     32
                                        Modification   5
                                        User          27
                                        Challenge    112
                                        -----------------
                                        Total        194
                                        

                                        Expected SMF data:

                                        awards
                                        awards_members
                                        categories
                                        requests
                                        member/user mapping
                                        artwork
                                        

                                        Important rule:

                                        SMF remains authoritative. Do not invent, deduplicate, rename, reconcile, or "clean up" historical data.

                                        Preserve:

                                        • historical awards
                                        • inactive/revoked records
                                        • dates
                                        • comments
                                        • favorites
                                        • request information
                                        • artwork associations
                                        • original badge metadata

                                        14. Artwork archive

                                        Previously inspected:

                                        /mnt/data/mto-awards-inspect/awards.zip
                                        

                                        Results:

                                        401 entries
                                        396 PNGs
                                        205 distinct artwork IDs
                                        205 full artwork IDs
                                        191 minis
                                        14 missing minis
                                        

                                        Missing mini artwork IDs:

                                        15,16,91,112,207,208,209,210,211,212,214,215,217,218
                                        

                                        There are 205 artwork IDs vs 194 expected legacy badges.

                                        Do not assume one-to-one mapping.


                                        15. Historical migration package expected from SMF

                                        Desired package:

                                        smf-awards/
                                        β”œβ”€β”€ awards.sql
                                        β”œβ”€β”€ awards_members.sql
                                        β”œβ”€β”€ categories.sql
                                        β”œβ”€β”€ requests.sql
                                        β”œβ”€β”€ members-award-map.csv
                                        β”œβ”€β”€ artwork/
                                        └── schema/
                                        

                                        Still waiting for the SMF sysadmin export.

                                        Do not import anything until the export is inspected.


                                        16. Next session β€” recommended starting point

                                        If returning to the project later, do not start with profile cosmetics.

                                        Start with:

                                        1. Verify current NodeBB/theme state.

                                        2. Verify the profile-layout checkpoint if needed.

                                        3. Check whether the SMF export has arrived.

                                        4. If it has arrived:

                                          • inspect files
                                          • inspect schema
                                          • establish actual counts
                                          • inspect member mapping
                                          • inspect artwork mapping
                                          • identify discrepancies without resolving them by guesswork
                                        5. Only then prepare migration.

                                        Current philosophy

                                        Known-good profile UI
                                                ↓
                                        PARK IT
                                                ↓
                                        SMF historical export
                                                ↓
                                        Inspect
                                                ↓
                                        Backup/checkpoint
                                                ↓
                                        Map
                                                ↓
                                        Dry-run
                                                ↓
                                        Verify
                                                ↓
                                        Import
                                        

                                        Bottom line for today: profile identity and layout are now good enough, the huge Harmony gap has been substantially reduced, the remaining space can stay for now, and the project is ready to return to the SMF Merit Badge migration when the source export arrives.

                                        Might be more later, I don't know. If I do more I will add to it, if not, well at least I have it logged.

                                        Def


                                        1 Reply Last reply
                                        0
                                        • Grant LamontagneG
                                          Grant LamontagneG
                                          Grant Lamontagne
                                          administrators
                                          wrote on last edited by
                                          #50

                                          Got the user end of Merit Badges figured out. You guys can add and assign badges if you like.

                                          Remember, they will all be wiped before we go live. Let me know if you find any issues- I am still working on it, and may get back to it later today.

                                          MTO / NodeBB β€” HAND-OFF LOG

                                          Date: 2026-09-27
                                          Current task: Move Merit Badges on member profiles below the Profile Views / Joined / Last Online / Email stats
                                          Status: SAFE STOP β€” NOT YET BUILT OR RESTARTED


                                          1. Immediate objective

                                          User wants the Merit Badges listing on member profiles moved below the profile-stat cards, specifically below:

                                          • Profile Views
                                          • Joined
                                          • Last Online
                                          • Email
                                          • and any subsequent profile-stat/custom-field cards

                                          Reason:

                                          1. Current badge text can disappear against profile cover imagery / background.
                                          2. Future badge artwork needs more vertical space.
                                          3. User wants the badges in a more conventional content area rather than over the cover/header region.

                                          Do not put badges in the post-author column. That is a separate later task.


                                          2. IMPORTANT CURRENT STATE

                                          We created a checkpoint before any profile-placement work:

                                          /usr/src/app/nodebb-theme-mto.checkpoint-before-profile-awards-placement-20260927
                                          

                                          Current live MTO theme has two uncommitted changes relative to that checkpoint:

                                          A. library.js

                                          Current:

                                          'use strict';
                                          
                                          const harmony = require('nodebb-theme-harmony/library');
                                          
                                          module.exports = harmony;
                                          
                                          module.exports.defineWidgetAreas = function (areas) {
                                          	areas = areas || &#91;];
                                          	areas.push({
                                          		name: 'Profile Merit Badges',
                                          		template: 'account/profile.tpl',
                                          		location: 'merit-badges',
                                          	});
                                          	return areas;
                                          };
                                          

                                          This adds the new NodeBB widget area:

                                          Profile Merit Badges
                                          template: account/profile.tpl
                                          location: merit-badges
                                          

                                          B. New template

                                          Created:

                                          /usr/src/app/nodebb-theme-mto/templates/account/profile.tpl
                                          

                                          It is an exact copy of the current Harmony profile template, except for this inserted block immediately before the account footer:

                                          <!-- MTO Merit Badges placement -->
                                          {{{ if widgets.merit-badges.length }}}
                                          <div data-widget-area="merit-badges">
                                          {{{each widgets.merit-badges}}}
                                          {{./html}}
                                          {{{end}}}
                                          </div>
                                          {{{ end }}}
                                          
                                          <!-- IMPORT partials/account/footer.tpl -->
                                          

                                          The diff against Harmony is ONLY this widget-area block.

                                          Do not build/restart yet.


                                          3. How we got here

                                          Initial attempted command had two shell/Python problems:

                                          • Bash history expansion interpreted ! in the Python/template content:

                                            bash: !-: event not found
                                            
                                          • Python then hit:

                                            TypeError: Path.write_text() missing 1 required positional argument: 'data'
                                            

                                          Result: only library.js changed at that point; profile template wasn't created.

                                          We then investigated template inheritance and found:

                                          /usr/src/app/nodebb-theme-mto/templates/
                                          

                                          contains no existing account/profile.tpl.

                                          Harmony profile source is:

                                          /usr/src/app/node_modules/nodebb-theme-harmony/templates/account/profile.tpl
                                          

                                          There were no examples of:

                                          nodebb-theme-harmony/templates/...
                                          

                                          imports in the installed NodeBB theme packages.

                                          Therefore we chose the safer approach: copy the actual Harmony profile template into MTO and make the smallest possible modification, rather than guessing at child-theme inheritance syntax.

                                          That copy has now been successfully created and verified.


                                          4. Actual Harmony profile layout

                                          Current Harmony profile template contains:

                                          <!-- IMPORT partials/account/header.tpl -->
                                          
                                          ... profile-aboutme-before ...
                                          
                                          ... aboutme ...
                                          
                                          ... profile-aboutme-after ...
                                          
                                          <div class="account-stats container">
                                              ...
                                          </div>
                                          
                                          <!-- IMPORT partials/account/footer.tpl -->
                                          

                                          The MTO copy is identical except the Merit Badge widget area sits between the stats block and footer.

                                          This means the desired visual placement is structurally correct.


                                          5. Widget-system investigation

                                          NodeBB's actual widget API was inspected at:

                                          /usr/src/app/src/widgets/index.js
                                          

                                          Relevant confirmed code:

                                          widgets.getArea = async function (template, location) {
                                          	const result = await db.getObjectField(`widgets:${template}`, location);
                                          	if (!result) {
                                          		return &#91;];
                                          	}
                                          	return parseWidgetData(result);
                                          };
                                          

                                          and:

                                          widgets.setArea = async function (area) {
                                          	if (!area.location || !area.template) {
                                          		throw new Error('Missing location and template data');
                                          	}
                                          
                                          	await db.setObjectField(`widgets:${area.template}`, area.location, JSON.stringify(area.widgets));
                                          };
                                          

                                          Available widget areas are generated through:

                                          widgets.getAvailableAreas = async function () {
                                          	const defaultAreas = [
                                          		...
                                          	];
                                          
                                          	return await plugins.hooks.fire('filter:widgets.getAreas', defaultAreas);
                                          };
                                          

                                          Therefore our MTO theme hook:

                                          filter:widgets.getAreas
                                          

                                          is the correct NodeBB mechanism for adding:

                                          account/profile.tpl / merit-badges
                                          

                                          6. MTO Awards widget definition

                                          Current MTO Awards plugin.json includes:

                                          {
                                            "hooks": [
                                              {"hook": "static:app.load", "method": "init"},
                                              {"hook": "filter:widget.render:mto-awards", "method": "renderMemberAwardsWidget"},
                                              {"hook": "filter:widgets.getWidgets", "method": "defineWidgets"}
                                            ]
                                          }
                                          

                                          The plugin defines:

                                          plugin.defineWidgets = async function (widgets) {
                                          	widgets = widgets || &#91;];
                                          
                                          	widgets.push({
                                          		widget: 'mto-awards',
                                          		name: 'MTO Merit Badges',
                                          		description: 'Displays the member\'s awarded Merit Badges.',
                                          		content: 'admin/partials/widgets/defaultwidget.tpl',
                                          	});
                                          
                                          	return widgets;
                                          };
                                          

                                          Renderer:

                                          plugin.renderMemberAwardsWidget = async function (widget) {
                                          	const uid = widget.templateData && widget.templateData.uid;
                                          
                                          	if (!uid) {
                                          		return null;
                                          	}
                                          
                                          	const awards = await Awards.listMemberAwards(uid);
                                          	const activeAwards = awards.filter(award => award && award.active !== false);
                                          	const badges = await Promise.all(activeAwards.map(award => Awards.getBadge(award.badgeId)));
                                          	const badgeItems = badges
                                          		.filter(Boolean)
                                          		.map(badge => `<li><strong>${badge.name}</strong> <span>(${badge.category})</span></li>`)
                                          		.join('');
                                          
                                          	widget.html = `<div class="mto-member-awards-widget"><strong>Merit Badges</strong><ul>${badgeItems}</ul></div>`;
                                          
                                          	return widget;
                                          };
                                          

                                          7. THE NEXT STEP β€” DO NOT SKIP

                                          We still need to determine where the existing mto-awards widget is currently configured.

                                          A previous attempt to inspect the database directly with:

                                          const db = require('/usr/src/app/src/database');
                                          await db.init();
                                          

                                          produced only:

                                          [winston] Attempt to write logs with no transports, which can increase memory usage:
                                          

                                          and no database output.

                                          So do not assume the current widget location.

                                          The next action should be a read-only inspection of:

                                          widgets:account/profile.tpl
                                          

                                          using NodeBB's own widget API/application context if possible.

                                          The goal is to identify the existing widget location and then move that widget configuration to:

                                          account/profile.tpl
                                          merit-badges
                                          

                                          Do not delete/recreate it blindly.


                                          8. Exact next command suggested

                                          When resuming, first investigate the actual widget storage/API.

                                          The last confirmed source showed:

                                          widgets.getArea(template, location)
                                          widgets.setArea(area)
                                          

                                          So the next command should be aimed at getting NodeBB's own runtime to call widgets.getArea('account/profile.tpl', location) or otherwise inspect the stored widgets:account/profile.tpl object.

                                          Do not build or restart until the existing widget configuration is known.


                                          9. Checkpoints / rollback

                                          Most relevant:

                                          /usr/src/app/nodebb-theme-mto.checkpoint-before-profile-awards-placement-20260927
                                          

                                          If necessary, restore only the two current profile-placement changes:

                                          library.js
                                          templates/account/profile.tpl
                                          

                                          The checkpoint predates both.

                                          Other recent useful checkpoints:

                                          /usr/src/app/nodebb-plugin-mto-awards.checkpoint-mini-artwork-20260927
                                          /usr/src/app/nodebb-theme-mto.checkpoint-mini-artwork-20260927
                                          
                                          /usr/src/app/nodebb-plugin-mto-awards.checkpoint-full-artwork-20260927
                                          /usr/src/app/nodebb-theme-mto.checkpoint-full-artwork-20260927
                                          
                                          /usr/src/app/nodebb-theme-mto.checkpoint-20260927-1015
                                          

                                          10. Merit Badge project overall status

                                          Phase 1 prototype is operational and heavily tested.

                                          Working:

                                          • /mto-awards catalogue
                                          • categories
                                          • full artwork
                                          • mini artwork
                                          • manual awarding
                                          • revoke/remove
                                          • profile Merit Badges widget
                                          • requestable badges
                                          • staff pending request queue
                                          • approve/reject
                                          • duplicate pending request protection
                                          • management pages
                                          • add/edit/delete
                                          • permissions
                                          • mobile-aware presentation
                                          • Harmony/NodeBB integration

                                          Recently verified

                                          Request approval:

                                          request β†’ staff queue β†’ approve β†’ award appears on Fred profile
                                          

                                          Request rejection:

                                          request β†’ staff queue β†’ reject β†’ no award
                                          

                                          Duplicate request protection:

                                          You already have a pending request for this Merit Badge
                                          

                                          Ordinary member management protection:

                                          [[error:no-privileges]]
                                          

                                          Badge deletion protection:

                                          Cannot delete badge demo-user: it has 1 member award(s)
                                          

                                          11. Artwork status

                                          Full artwork:

                                          • PNG
                                          • exactly 50Γ—60
                                          • uploaded through NodeBB image upload
                                          • validated with Sharp

                                          Mini artwork:

                                          • PNG
                                          • exactly 25Γ—25
                                          • uploaded through NodeBB image upload
                                          • validated with Sharp
                                          • displayed on Edit page
                                          • successfully tested

                                          Current test badge:

                                          Test Badge With Artwork
                                          

                                          It has full + mini artwork and was successfully awarded to Fred.


                                          12. Historical SMF migration β€” WAITING

                                          Still waiting for SMF sysadmin export.

                                          Expected legacy counts:

                                          Site          18
                                          Collector     32
                                          Modification   5
                                          User          27
                                          Challenge    112
                                          -----------------
                                          Total        194
                                          

                                          SMF is authoritative.

                                          Expected package:

                                          smf-awards/
                                          β”œβ”€β”€ awards.sql
                                          β”œβ”€β”€ awards_members.sql
                                          β”œβ”€β”€ categories.sql
                                          β”œβ”€β”€ requests.sql
                                          β”œβ”€β”€ members-award-map.csv
                                          β”œβ”€β”€ artwork/
                                          └── schema/
                                          

                                          Rules:

                                          • don't invent mappings
                                          • don't dedupe
                                          • don't rename to reconcile discrepancies
                                          • preserve inactive/revoked historical records
                                          • preserve dates/comments/favorites/etc.
                                          • preserve request history where represented
                                          • member ID mapping must come from actual export

                                          Artwork archive previously inspected:

                                          /mnt/data/mto-awards-inspect/awards.zip
                                          

                                          401 entries, 396 PNGs, 205 distinct artwork IDs.

                                          14 artwork IDs have no mini artwork:

                                          15,16,91,112,207,208,209,210,211,212,214,215,217,218
                                          

                                          Do not assume artwork IDs map one-to-one with the 194 badges.


                                          13. Other completed project work

                                          SMF BBCode compatibility

                                          Implemented MTO compatibility handling for:

                                          [b]
                                          [i]
                                          [u]
                                          [s]
                                          [spoiler]
                                          [img]
                                          
                                          
                                          

                                          [quote]
                                          [url]

                                          
                                          Stored posts untouched.
                                          
                                          Do not enable raw HTML.
                                          
                                          Composer preview still shows literal legacy SMF tags; deferred until after historical import.
                                          
                                          ### Global top menu
                                          
                                          Working globally:
                                          
                                          ```text
                                          Home
                                          Search
                                          Profile
                                          Notifications
                                          Bookmarks
                                          Members
                                          Merit Badges
                                          etc.
                                          

                                          Content width

                                          MTO uses:

                                          #content.container-lg {
                                          	max-width: 1440px;
                                          }
                                          

                                          User confirmed it looks good in dark/light modes.

                                          Profile header

                                          Username/cover positioning and visibility were fixed.

                                          Current profile stats intentionally retain:

                                          Email (hidden)
                                          

                                          Do not remove that unless user asks.


                                          14. Important operational notes

                                          Inside this NodeBB container:

                                          Do NOT use:

                                          ./nodebb start
                                          ./nodebb restart
                                          

                                          The process setup causes EADDRINUSE.

                                          Correct restart method:

                                          docker restart app-nodebb-1
                                          

                                          ./nodebb status can misleadingly report not running even while NodeBB is functional.

                                          After a restart, a transient 502 was previously observed, but NodeBB logs showed clean startup. Do not chase that unless it becomes recurring.

                                          Known unrelated startup warnings:

                                          blog-comments active but not installed
                                          calendar active but not installed
                                          emoji-android compatibility warning
                                          

                                          User explicitly does not want browser QUIC/network experiments repeated.


                                          15. Working style requested by user

                                          Very important:

                                          • One small command at a time.
                                          • User runs command.
                                          • User pastes exact output.
                                          • Interpret before next change.
                                          • Inspect β†’ checkpoint β†’ one change β†’ verify β†’ build/test β†’ checkpoint.
                                          • Avoid rabbit holes.
                                          • Prefer known-good implementation over theoretical elegance.
                                          • Mobile matters.
                                          • User has other work to do, so resume efficiently.

                                          Current stopping point:
                                          The profile placement implementation is prepared but not built, not restarted, and not yet tested. The only remaining pre-build task is to identify/move the existing mto-awards widget configuration into the newly created merit-badges widget area.


                                          1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better πŸ’—

                                          Register Login

                                          • Login

                                          • Don't have an account? Register

                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Popular
                                          • World