Skip to content

Inter-interface Navigation#390

Merged
cubap merged 16 commits intomainfrom
389-inter-interface
Jan 26, 2026
Merged

Inter-interface Navigation#390
cubap merged 16 commits intomainfrom
389-inter-interface

Conversation

@thehabes
Copy link
Member

@thehabes thehabes commented Jan 22, 2026

Closes #389.

Ignores #391, #392 , and #393

Changes and scope notes below.

Login and Logout

  • Confirmed to be achievable on any interface requiring authentication.

Home

  • Confirmed achievable on every interface

Transcription Workflow

  • Project management /project/manage/, line identification /annotator, and line-by-line transcription /transcribe should all link to each other.
  • /project/manage can go to /transcribe and /annotator via the project details component card.
  • /annotator can go to /transcribe via a link in the OSD tools area
  • /annotator can go to /manage/project via 'Go To Project Management' at the bottom right of the interface.
  • /transcribe can go to /manage/project via the via the middle contact.png icon in the tpen-project-header component.

This is already implemented and does not check permissions but it should to determine whether or not to show this icon.

  • /transcribe can go to /annotator via the via the middle parse-lines.svg icon in the tpen-project-header component.

I added this in to the tpen-project-header implementation. It does not check permissions but it should to determine whether or not to show this icon.

Project Management Workflow

  • /project can go to /manage/project via #goManage (cog button in top right)
  • /project/leave can go to /project via #noLeaveBtn. It goes to project details instead of project management.
  • /components/update-metadata/index.html has some complications and is being separated into its own task
  • /project/manage/layers has some complications and is being separated into its own task.
  • /role/manage can go to /manage/project via 'Go To Project Management' at the bottom left of the interface.
  • /project/options can go to /manage/project via 'Go To Project Management' at the bottom left of the interface.
  • /manage/quicktype can go to /manage/project via 'Go To Project Management' at the top left of the interface.

Note that /components/quicktype-manager/index.js does not check permission in the module but it should. However, permissions are checked on /interfaces/quicktype/index.html to determine whether or not to show the project management button.

About Us & Contact Us

  • About Us now has a link to its kin in three.t-pen.org. It also links to the TPEN3 tutorials.
  • Contact Us says "page not found" because we do not have one yet. There does appear to be a kin in three.t-pen.org either. This is being separated into its own task.

Shower Thoughts

These are for later.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

@thehabes thehabes changed the title Interface Inter-navigation Inter-interface Navigation Jan 22, 2026
@thehabes thehabes linked an issue Jan 22, 2026 that may be closed by this pull request
@thehabes
Copy link
Member Author

thehabes commented Jan 23, 2026

Future Improvement Suggestion

Consider creating a reusable navigation button component

The "Go to Project Management" button is now implemented across multiple interfaces with similar CSS and JavaScript patterns:

  • components/annotorious-annotator/line-parser.js
  • components/manage-role/index.js
  • interfaces/project/options.html
  • interfaces/quicktype/index.html

A shared <tpen-nav-button> or similar component could:

  • Reduce CSS duplication (~20 lines per instance)
  • Ensure consistent styling and behavior across interfaces
  • Centralize permission checking logic
  • Make it easier to add similar navigation buttons in the future

This isn't blocking for this PR, but worth discussing with the team for a future refactor. We might have something in /components/gui we can use. It is a little messy switching between using it in /components and using it on /interfaces it would be nice to use a consistent mechanic here.

This comment was marked as outdated.

This comment was marked as resolved.

@thehabes
Copy link
Member Author

📋 Technical Debt Note: CheckPermissions Dual Implementation

During review, I noticed the codebase has two CheckPermissions implementations with identical method names but different return types:

File Type Returns
/components/check-permissions/checkPermissions.js Synchronous boolean
/utilities/checkPermissions.js Asynchronous Promise<boolean>

Current State

  • Sync version: 28 calls across 16 component files (used without await)
  • Async version: 39 calls across 15+ interface/utility files (used with await)

All current usages are correct - the issue is naming confusion since both export CheckPermissions.

Why This Matters

  • Copilot review flagged the sync version as needing await, then later correctly identified it as synchronous
  • Easy to use the wrong version or wrong calling pattern when writing new code
  • await on a sync return works (returns the value), but .then() on a boolean fails

Recommended Future Action

Consider renaming exports for clarity in a future PR:

  • CheckPermissionsSync (component version)
  • CheckPermissionsAsync (utilities version)

This would prevent future confusion without changing functionality.


This note is for team awareness - no action needed for this PR.

@thehabes
Copy link
Member Author

I triggered the preview deploy action and I think https://6972de70dccab7f7f1d1d861--tpen-interfaces-preview.netlify.app/ includes all the code changes from review.

@thehabes thehabes marked this pull request as ready for review January 23, 2026 02:38
@thehabes thehabes requested a review from cubap January 23, 2026 02:38
@cubap
Copy link
Member

cubap commented Jan 23, 2026

line-parser.js:374  Uncaught TypeError: CheckPermissions.checkEditAccess(...).then is not a function
    at AnnotoriousAnnotator.render (line-parser.js:374:49)
    at EventDispatcher.<anonymous> (line-parser.js:60:65)
    at EventDispatcher.dispatch (events.js:23:14)
    at Project.js:71:37
    at async Project.fetch (Project.js:55:20)

https://6972de70dccab7f7f1d1d861--tpen-interfaces-preview.netlify.app/annotator?projectID=6967a514f7caf0d95c4252fb&pageID=6967a51bf7caf0d95c4252fd

Clicking the link in the header loads to this error. The same error shows if I click "Parse Lines" from the management interface.

The same project at https://app.t-pen.org/annotator?projectID=6967a514f7caf0d95c4252fb&pageID=6967a51bf7caf0d95c4252fd loads without error.

@thehabes
Copy link
Member Author

line-parser.js:374  Uncaught TypeError: CheckPermissions.checkEditAccess(...).then is not a function
    at AnnotoriousAnnotator.render (line-parser.js:374:49)
    at EventDispatcher.<anonymous> (line-parser.js:60:65)
    at EventDispatcher.dispatch (events.js:23:14)
    at Project.js:71:37
    at async Project.fetch (Project.js:55:20)

https://6972de70dccab7f7f1d1d861--tpen-interfaces-preview.netlify.app/annotator?projectID=6967a514f7caf0d95c4252fb&pageID=6967a51bf7caf0d95c4252fd

Clicking the link in the header loads to this error. The same error shows if I click "Parse Lines" from the management interface.

The same project at https://app.t-pen.org/annotator?projectID=6967a514f7caf0d95c4252fb&pageID=6967a51bf7caf0d95c4252fd loads without error.

But not on localhost. The dev preview deploy is not deploying the latest code. It seems to only deploy a snapshot of what the code was when the PR was created.

<a class="nav-icon" href="/index"><img draggable="false" src="../../assets/icons/home.png" alt="Home"></a>
<a class="nav-icon" href="/project/manage?projectID=${TPEN.screen.projectInQuery}"><img draggable="false" src="../../assets/icons/contact.png" alt="Manage Project"></a>
<a class="nav-icon" href="/profile"><img draggable="false" src="../../assets/icons/profile.png" alt="Profile"></a>
<a title="Home" class="nav-icon" href="/index"><img draggable="false" src="../../assets/icons/home.png" alt="Home"></a>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think "Identify Lines" belongs here. This space is for Project Header level actions.

  • Going home to switch projects or start over
  • Logging out to 'shut down' work
  • (peer-level concern) profile controls
  • Manage this project

Previously, lines were in the Page Tools pane and I don't see a good reason to change that.

Comment on lines 17 to 40
<style>
#projectManagementBtn {
position: absolute;
top: 4.85em;
display: none;
background-color: var(--primary-color);
padding: 10px 20px;
color: var(--white);
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}

#projectManagementBtn:hover {
background-color: var(--primary-light);
}

#projectManagementBtn span {
position: relative;
left: -10px;
display: inline-block;
transform: rotate(180deg);
}
</style>
Copy link
Member

Choose a reason for hiding this comment

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

I agree with this. Maybe @copilot can ticket it as an issue.

Copy link
Contributor

Copilot AI commented Jan 23, 2026

@cubap I've opened a new pull request, #394, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +44
<style>
#projectManagementBtn {
position: absolute;
top: 5.1em;
display: none;
background-color: var(--primary-color);
padding: 10px 20px;
color: var(--white);
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
border: none;
}

#projectManagementBtn:hover,
#projectManagementBtn:focus-visible {
background-color: var(--primary-light);
outline: 2px solid var(--primary-color);
outline-offset: 2px;
}

#projectManagementBtn span {
position: relative;
left: -10px;
display: inline-block;
transform: rotate(180deg);
}
</style>
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The #projectManagementBtn styling block is duplicated (with near-identical rules) in multiple places (interfaces/quicktype/index.html, interfaces/project/options.html, interfaces/manage-project/collaborators.html, and components/manage-role/index.js). Consider extracting this into a shared CSS class (e.g. .project-management-btn) in a common stylesheet or component-level style module and using class="project-management-btn" instead, to reduce duplication and keep future visual changes consistent.

Copilot uses AI. Check for mistakes.
@thehabes thehabes requested a review from cubap January 26, 2026 16:37
@thehabes thehabes self-assigned this Jan 26, 2026
Copy link
Member

@cubap cubap left a comment

Choose a reason for hiding this comment

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

YES! I love it and find no fault. There are good issues to move forward with.

@cubap cubap merged commit 1cd43bd into main Jan 26, 2026
9 checks passed
@cubap cubap deleted the 389-inter-interface branch January 26, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inter-interface Navigation

3 participants

Comments