Skip to content

[#206] Add opt-in checked ticket references - #207

Merged
sksingh2005 merged 1 commit into
mnemosyne-systems:mainfrom
PerchAnton:codex/refmint-ticket-references
Nov 7, 2026
Merged

sksingh2005 merged 1 commit into
mnemosyne-systems:mainfrom
PerchAnton:codex/refmint-ticket-references

Conversation

@PerchAnton

@PerchAnton PerchAnton commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds optional checked ticket references for the manual-entry case in #205. With VITE_TICKET_REFERENCES=true, a user can copy a reference from a ticket and use the header lookup to open the role's existing ticket page. Invalid references produce an error toast and preserve the input for correction.

Fixes #206.

The codec uses the existing positive ticket ID with the btk v1 uint64 format. It preserves exact decimal-string IDs through Java Long's maximum and refuses unsafe JSON numbers. The existing server permissions govern access. RefMint is pinned to 0.1.0-alpha.3.

Disabled production builds omit the RefMint codec. Enabled builds lazy-load the controls and codec. Copy feedback and lookup errors use Sonner, ticket URLs use PATHS, and the header retains its original layout. Contributor entries follow the existing format in AUTHORS and the manual.

Rebased into one commit on main cd805e2, including #209. Frontend checks use main's Node 26 setting from src/frontend/.nvmrc.

The final head 0fbdc73 additionally corrects the frontend README to Node 26, matching .nvmrc; no executable code changed after the checks below.

Validation on a3b054c with Node 26.13.0:

  • npm run check passed all 11 tests, ESLint, TypeScript and Prettier. Two production-bundle regressions fail on the previous implementation and pass with this change. They check that disabled builds omit the codec and enabled builds keep it out of the eagerly loaded chunks.
  • Production builds passed with the flag disabled and enabled.
  • Nine Chromium component checks passed, including clipboard success/denial, invalid-code feedback without navigation, correction, and navigation for each allowed role.
  • Backend/Keycloak/PostgreSQL integration is covered by the project's CI and was not run locally. New GitHub checks require maintainer approval.

The earlier before/after screenshots show the pre-review UI. This revision replaces the inline status messages with toasts.

I maintain RefMint. A single-participant transcription pilot used synthetic records and did not establish a benefit for Billetsys. References are longer than small ticket numbers. Enabling the optional feature needs the maintainers' decision.

@sksingh2005
sksingh2005 requested review from jesperpedersen and sksingh2005 and removed request for sksingh2005 October 29, 2026 22:11
@sksingh2005

sksingh2005 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

@PerchAnton Please rebase and PTAL me once done.

@sksingh2005 sksingh2005 added the enhancement Enhancement to an existing feature label Oct 29, 2026
@PerchAnton

Copy link
Copy Markdown
Contributor Author

Thanks @sksingh2005. At head c83a6a8, PR #207 still conflicts with main. Both GitHub CI workflows passed on that head. The rebase is still pending; I have not updated the branch or asked for another review yet.

@PerchAnton
PerchAnton force-pushed the codex/refmint-ticket-references branch from c83a6a8 to f56fb2d Compare October 31, 2026 15:44
@PerchAnton

Copy link
Copy Markdown
Contributor Author

@sksingh2005 Rebased on main at f56fb2d. Both CI and Frontend Checks passed on this head, and GitHub reports no conflicts. The feature remains opt-in and disabled by default. Could you take another look?

@jesperpedersen

Copy link
Copy Markdown
Contributor

@PerchAnton In cases like this it would be good to have a before and after screenshot of the changes so we know clearly what to look for

@PerchAnton

Copy link
Copy Markdown
Contributor Author

Thanks @jesperpedersen. Here are the same synthetic ticket and support role at 57b74c9, with the feature off and on (1280 × 720). These are screenshots of the actual frontend with mocked API/session data, not a real Keycloak/PostgreSQL installation.

Before — feature off (default). No reference controls; the existing ticket name and search remain.

Feature off: existing ticket screen

After — VITE_TICKET_REFERENCES=true. The ticket shows a copyable reference, and the header adds a separate field with Open. At this width, the header wraps onto two rows.

Feature on: copyable ticket reference and header lookup

Invalid code. Changing the last character from f to g shows an error and keeps the current ticket open.

Invalid checksum: error shown without navigation

While capturing these, I found that typed text inherited the header's white color on a white input. Commit 57b74c9 gives that field the theme foreground color. I checked light/dark themes, copying, and valid/invalid input. All 9 tests, lint, typecheck, formatting and both production builds passed locally. Maven and real backend permissions were not tested locally.

The two workflows passed on f56fb2d; the new runs on 57b74c9 await maintainer approval: Frontend Checks and CI.

@sksingh2005

sksingh2005 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

@PerchAnton please squash the commits. And rebase

@PerchAnton
PerchAnton force-pushed the codex/refmint-ticket-references branch from 57b74c9 to 7a4a49e Compare November 3, 2026 16:12
@PerchAnton

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I squashed the changes into one commit, 7a4a49e, on main 83b173e and kept both AUTHORS entries. All nine reference tests, lint, type checking, formatting and both frontend builds passed locally. CI and Frontend Checks are waiting for maintainer approval. Could you approve the runs and take another look?

@PerchAnton

Copy link
Copy Markdown
Contributor Author

@sksingh2005, could you take another look at 7a4a49e? The PR is now one commit on top of 83b173e. Both Frontend Checks and CI passed. Ticket references are off by default. The before and after screenshots show the optional controls and what happens when someone enters an invalid code.

@sksingh2005 sksingh2005 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work @PerchAnton

@jesperpedersen

Copy link
Copy Markdown
Contributor

We can move to a newer Node version - like 24 or 26

@sksingh2005 sksingh2005 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work @PerchAnton . Some updates required before making it ready

  • Keep Node 20 compatibility:
    Please preserve node-version: 20 in .github/workflows/lint.yml and adjust the tests/imports so npm run check passes on Node 20.
  • Lazy-load reference components:
    Ensure refmint is only loaded when VITE_TICKET_REFERENCES=true (e.g., via dynamic imports or React.lazy) so disabled builds incur zero bundle overhead.
  • Remove flex-wrap from AuthenticatedHeader.tsx:
    Preserve the single-row header layout so disabled installations remain visually untouched.
  • Adopt sonner toast notifications:
    Replace inline <p> error and status elements with toast.error(...) and toast.success(...):
    // TicketReferenceLookup.tsx
    const path = ticketReferencePath(value, role);
    if (!path) {
      toast.error("Invalid ticket reference. Check the code and try again.");
      return;
    }
    // TicketReference.tsx
    await navigator.clipboard.writeText(value);
    toast.success("Ticket reference copied.");
  • Use PATHS constants:
    Update ticketReferencePath to use definitions from src/frontend/src/routes/paths.ts:
    import { PATHS } from "../routes/paths";
    
    switch (role) {
      case "support":
        return `${PATHS.supportTickets}/${id}`;
      case "superuser":
        return `${PATHS.superuserTickets}/${id}`;
      case "tam":
      case "user":
        return `${PATHS.userTickets}/${id}`;
      default:
        return null;
    }
  • Normalize AUTHORS:
    Update your entry in AUTHORS to follow the existing Full Name <email@domain> format.
    And also you need to add yourself in doc/manual/en/97-acknowledgement.md
    Thank you again for your contribution, and let us know if you have any questions on these adjustments!

@sksingh2005

Copy link
Copy Markdown
Collaborator

We can move to a newer Node version - like 24 or 26

@jesperpedersen That should be in a seperate pr I guess ?

@jesperpedersen

Copy link
Copy Markdown
Contributor

@sksingh2005 Yes, before this one - I'm ok with the latest version that works with Quarkus and Quinoa

@jesperpedersen

Copy link
Copy Markdown
Contributor

Ideally 26.x

@sksingh2005

Copy link
Copy Markdown
Collaborator

@PerchAnton rebase is needed. I have updated the node version in another pr.

@PerchAnton
PerchAnton force-pushed the codex/refmint-ticket-references branch from 7a4a49e to a3b054c Compare November 6, 2026 16:33
@PerchAnton

PerchAnton commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review and the Node update. @sksingh2005 @jesperpedersen, updated to 0fbdc73, one commit on main cd805e2. It keeps Node 26 from #209. RefMint loads only when the feature is enabled, the added header wrapping is removed, messages use Sonner, and ticket URLs use PATHS. AUTHORS and the manual now have matching entries.

All 11 frontend tests, lint, types, formatting and both production builds passed locally with Node 26.13.0. Nine Chromium component checks passed. The two new bundle tests failed before the change and now pass.

These checks ran on a3b054c; the only subsequent change in 0fbdc73 corrects the frontend README to Node 26, matching .nvmrc.

Both new workflows need approval before they can run. Could you approve Frontend Checks and CI and review the update?

@PerchAnton
PerchAnton force-pushed the codex/refmint-ticket-references branch from a3b054c to 0fbdc73 Compare November 6, 2026 16:53
@sksingh2005

Copy link
Copy Markdown
Collaborator

Thanks for the amazing work @PerchAnton . LGTM
One thing @jesperpedersen Needs to confirm, this adds refmint@0.1.0-alpha.3 (an alpha dependency). It is pinned exactly and only loaded when the flag is enabled, but the v1 wire contract is not yet stable, so enabling it in production is a format-lifecycle decision.
Happy to merge once @jesperpedersen reviews the dependency.

@jesperpedersen

Copy link
Copy Markdown
Contributor

@sksingh2005 That is ok - we need 1.0+ once we are 1.0 as well

@jesperpedersen

Copy link
Copy Markdown
Contributor

@PerchAnton Just keep working on it, and look for the improvements we can make across the projects

@PerchAnton

Copy link
Copy Markdown
Contributor Author

Thanks @sksingh2005 and @jesperpedersen for the review and dependency approval. I’ve noted the requirement to use RefMint 1.0+ by the time Billetsys reaches 1.0. This PR still pins 0.1.0-alpha.3 and keeps the feature off by default. Thanks for encouraging further improvements across the projects; concrete integration feedback will help guide them.

@sksingh2005
sksingh2005 merged commit a2e7e3f into mnemosyne-systems:main Nov 7, 2026
2 checks passed
@sksingh2005

Copy link
Copy Markdown
Collaborator

Merged. Thanks for your contribution.

@PerchAnton

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging this PR. I appreciate your help with the dependency approval.

@sksingh2005

Copy link
Copy Markdown
Collaborator

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opt-in checked ticket references using existing numeric IDs

3 participants