Repository navigation
feat(banner): bring back the license banner, asking regular users to buy one - #47
Merged
Merged
Conversation
…buy one
The banner went missing when the rebuild made it off by default and
production had never set BANNER_ENABLED. It is back on by default, with
copy that sells the license and names what it pays for: "Use TablePro
every day? A license adds the paid features and funds the next release."
(in English and Vietnamese), linking to Pricing.
Following what research on support asks and announcement bars found:
- off the Pricing page it leads to, in both languages (App\Support\Banner,
one rule for the prop and the pre-paint class);
- above the sticky header, scrolling away with the page;
- closing it snoozes that message for 30 days; "Have a license? Hide this"
(from 1280px) hides every message for a year, and so will the account
app's thank-you page after a purchase;
- license_banner_view, _click and _dismiss go to Google Analytics, under
the reader's consent choice.
The dismissal record is {version, until}; the head script mirrors
lib/banner.ts and tests/js/banner.test.ts runs it against the same cases.
The privacy policy describes the record's two durations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why it was gone
The rebuild changed
config/banner.phpfromenabled = trueto off by default. Production's.envhas never setBANNER_ENABLED, so the banner disappeared without anyone switching it off. The live HTML has nohas-banneron any page. The rebuild also changed its copy from a support ask ("Buy a license") to an informational line ("See pricing").What it does now
On by default, so it no longer depends on the server's
.env. Its copy sells the license and names what the money pays for:From research on support asks (Sidekiq, Porzio, Beekeeper Studio, Obsidian) and announcement bars (NN/g, GOV.UK, NextAfter, Wikimedia CentralNotice):
/pricingor/vi/pricing, the page it leads to.App\Support\Banneris one rule for the Inertia prop and the pre-painthas-bannerclass.scroll-padding-topis back to the header's 5rem.{version, until}is settled before first paint.lib/banner.tsholds the rule, andtests/js/banner.test.tsruns the head script against the same cases. The bare version string older releases stored now hides nothing, and version 3 shows the new copy to everyone.license_banner_view,license_banner_click(version) andlicense_banner_dismiss(version,reason) go to GA4 under Consent Mode. Registerversionandreasonas event-scoped custom dimensions in GA4 to see them in reports.docs/architecture.md, sitemap §B.5 and design-system §5.3.17 record the decision.Tests
TopBannerTest:licensedlink;PublicContractsTestregisters the three events.tests/js/banner.test.tscovers 10 storage cases in both the lib and the head script.npm run test:js: 185/185. Typecheck, build and Pint pass./pricingand/vi/pricinghave no banner;3for 30 days, and on reload the class is already gone at DOMContentLoaded (no flash);*for 365 days.Companion: the TableProApp/license PR that hides the banner after a purchase.