Repository navigation
feat(platform): show readers live automation navigation - #3779
Merged
Merged
Conversation
…is live Only Owners, Admins and Developers can author automations, yet every member saw the Automations tile and a list of the ten seeded packages, all "Not deployed", with an empty state that invited them to create what they cannot. Customers asked to hide the section from members; a per-org switch would have looked like access control while the routes stayed open, and left every other organization with the same clutter. The section now follows the viewer instead. Authors (the ability the server's author gate mirrors) always see it; everyone else sees it once the organization runs a deployed organization automation — one bound to no project, since project-bound automations show on their project's tab. The signal reads the listing the Inbox check already subscribes to, so the nav makes no new request. A non-author's list shows deployed automations only, with its own empty state; the author's empty state now names the Create automation button. Direct URLs keep working: this is presentation, not access control.
The reader empty state spelled the roles as common nouns (un propriétaire, un administrateur, un développeur) while English and German use the role labels. Use the French labels Propriétaire, Admin and Développeur, as the role picker and the French guides do.
Members and Editors see deployed automations only, but the project shell counted every bound automation when deciding whether to show its Automations tab. A project whose only bound automation was an undeployed draft therefore gave readers a tab that opened the empty "No live automations" list, which the shell exists to avoid. Move the reader rule into one predicate (reader-listing) and apply it in both the list and the project shell, so the tab counts exactly what the list will show this viewer. The manual box for the reader list now covers the project tab too.
The rail's availability check asked for a separate organization-only listing on the stated ground that the all-projects listing hides project IDs the viewer cannot read. It does not: the listing returns every binding unchanged, so a row with no project IDs is exactly an automation bound to no project. The second query only added a request per dashboard boot, and its regression test mocked a response nothing produces. Read the all-projects listing the Inbox check, the org list and its route loader already cache, count deployed rows with no project IDs, and skip the read entirely for authors, who see the section regardless. The fictional test is replaced by one that pins the query arguments and a mixed listing.
The Inbox setup notice offered every role a "Browse automations" link. The mail packages are seeded undeployed, and readers now see deployed automations only, so a Member or Editor who followed it landed on an empty list with no way forward; the compose notice also told them to install an automation they cannot install. Readers now get copy that names the Owner, Admin and Developer roles and no link, and a compose notice that says the email can be written once a mail automation is deployed. Authors keep the link. The strings ship in EN, DE and FR, the built-in automations guide describes both notices, and a new manual box covers the reader deep link.
…-for-readers # Conflicts: # services/platform/tests/manual/readme.md
…-for-readers # Conflicts: # services/platform/tests/manual/readme.md
…-for-readers # Conflicts: # services/platform/tests/manual/suites/automations.md
5 tasks done
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.
Summary
Members and Editors now see Automations in the desktop rail and phone navigation once an organization-wide automation is deployed. Owners, Admins and Developers always see it. Reader lists show deployed automations only, with their own empty state; authors keep the complete list and the creation actions. Direct URLs and backend permissions are unchanged. This comes from customer feedback.
One predicate (
app/features/automations/lib/reader-listing.ts) holds the reader rule. The org list, a project's list and the project shell all use it, so a project gives readers an Automations tab only when a bound automation is deployed. A project whose only binding is an undeployed draft has no tab for them, rather than a tab that opens an empty list.The rail's availability check reads the all-projects listing that the Inbox check, the org list and its route loader already cache. It counts deployed rows that have no project IDs. That listing returns every binding unfiltered (
listAutomationsForApp), so an emptyprojectIdsmeans the automation is bound to no project. Authors skip the read entirely. An earlier revision of this PR used a separate organization-only query. The reason it gave, that the app strips unreadable project IDs, was wrong, so that query and its fictional regression test are gone.The Inbox setup notice no longer sends readers to an empty list. Members and Editors are told that someone with the Owner, Admin or Developer role must deploy an email automation, and they get no Browse automations link. The compose notice is reworded for them in the same way. Authors see what they saw before. The French reader empty state now uses the role labels Propriétaire, Admin and Développeur.
EN/DE/FR messages and guides describe the same role and project scope. The built-in automations guide describes both Inbox notices.
Dependency. The org list asks for
includeProjectBound: true, and the server applies no project-visibility filter to it. This is true on main too. So a reader who opens the org list still sees deployed automations bound to projects they cannot open, each with a generic project-bound badge. Now that readers get a nav entry, they reach that list without typing a URL. #3772 adds the visibility filter and should land before this PR, or together with it. This PR does not change that behaviour, and no manual box asserts it until #3772 lands.Checklist
bun run checkpasses: N/A locally. I skipped the full run on this shared host and ran the scoped gates listed below. CI runs the full check.bun run lint:sastpasses: the scoped Opengrep pass ran on every staged TS/TSX file through the commit hook. No full run.messages/{en,de,fr}.yml:automations.list.emptyReader.*,conversations.activate.noAutomationReaderDescriptionandconversations.activate.composeNoticeReader. Node-CHoverride is needed (no ß).docs/{en,de,fr}/: the platform overview, member overview, automations catalog and built-in automations pages.README.md/README.de.md/README.fr.md: N/A, no README-level change.Test plan
Committed automated coverage (jsdom UI project):
reader-listing.test.tscovers the shared predicate.use-automations-availability.test.tschecks the query arguments (the all-projects listing), and that only deployed rows with no project IDs count, including in a mixed listing.use-navigation-items.test.tschecks tile visibility for authors and readers, that authors skip the availability read, and that readers ask about the active organization.automations-list.test.tsxandmobile-bottom-nav.test.tsxcover the reader list and phone navigation.$projectId.test.tsxchecks that readers get no tab when only a draft is bound, and get one once a bound automation is deployed.conversations.test.tsxchecks the reader setup notice and that it has no link, and the reader compose notice.The new project-tab and Inbox-reader tests failed against the previous head (3 failures) and pass now.
Commands run on the final head:
bunx vitest --run --config vitest.ui.config.tsoverapp/features/automations,app/components/layout,use-navigation-items, the project shell and conversations tests: 62 files, 502 tests passed.bunx vitest --run --project server lib/i18n: 185 passed, covering locale parity and used-but-undefined keys.bunx tsc --noEmitfor the platform: clean.oxlint --type-awareon the touched files: clean.bun run lint:manualandcheck-guide.tson the automations, conversations and navigation suites: OK.services/docs): 171 passed.Manual boxes:
NAV-F43covers the rail and tab bar.AUTO-F53covers the reader list and now the project tab. The newCONV-G4covers the reader Inbox notice.Not verified: an earlier revision was checked in native Chromium across EN/DE/FR, desktop and phone, in ad-hoc browser runs. Those runs are not committed and were not repeated on this head. No live two-session deployment and no screenshot pass were done. Follow-up: the built-in automations guide has no screenshot of the Inbox setup notice, so no screenshot needs refreshing.