View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009193 | mantisbt | other | public | 2008-05-22 13:48 | 2022-10-03 23:41 |
Reporter | timj | Assigned To | community | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | assigned | Resolution | open | ||
Summary | 0009193: "Selected project" state should be client-side not server-side | ||||
Description | The fact that Mantis keeps state server-side for the selected project is really limiting. Lots of people these days use tabs/multiple windows and I often want to be able to have one tab with one project open and another with another project open yet with Mantis as I move around in one window, as soon as I perform an action in the other window, it will jump to the most recently-selected project in the old. Keeping state server-side like this and the way it causes cross-window interactions is very confusing and user-unfriendly. It is the frequent cause of mis-filed bugs etc. in a multi-project system. Mantis should really pass the project ID around client-side (i.e. in GET/POST fields) to avoid this problem. | ||||
Tags | No tags attached. | ||||
I agree. This will also simplify features talked about in the forums such as being able to report to a sub-project directly. |
|
Yes, this would be great. Related to: 0023741, 0005790 and other. HTML5 introduced the local storage[1] which could be used for this purpose. You can even store JSON objects with a tiny hack[2]. [1] https://www.w3schools.com/html/html5_webstorage.asp |
|
@npeifer contributions are welcome. Send us a Pull Request on our Github repository https://github.com/mantisbt/mantisbt |
|
Another possible way of solving it would be using some query parameter - url generating functions like contribution welcome? |
|
Just a +1 from me. (Alas I'm not a web/PHP programmer) |
|
@atrol @dregad @vboctor @cproensa my employer is willing to pay someone to fix this issue. Do any of you, or anyone else, do such contract work? |
|
@atrol @dregad @vboctor @cproensa if I find and hire a PHP programer under contract to work on this issue, are some of you willing to discuss how to properly solve this issue, so that his work can be merged into mantis? I'm unlikely to find a PHP programer that already knows the mantis codebase/architecture, so he would need some guidance in order to produce something acceptable. |
|
Of course, but please bear in mind that I work on Mantis my spare time, so I cannot make any commitments on responding to your programmer's request (for the same reason, I wouldn't accept such a contract myself). |
|
# Hello, World! ... Parameterization ... I'm currently working on solving this. Funny enough: I stumbled upon everything that @nenadalm suggested on my own. I did have a difference from the proposal to use a query-string, however. Instead of query-string as the parameterization field, I wanted parts of the URL path to do that.
My initial peek around the system gave me the impression that a query-string parameter for What are the preferences, among those us here, between the solutions that have been conceptualized so far: subdir style, query-string style, or, even "why not both"? ... $g_project_override ... One thing I didn't yet trace was the full extent of the impact of touching Thoughts on this? |
|
@dregad so my employer has contracted @starlocke to take a look at fixing this issue. If you have a chance to help guide him, it would be much appreciated. Thanks! |
|
i give my +1 on this. Would be an improvement for the UX when using Mantis
|
|
@rogueresearch @starlocke |
|
@sintaq yes, we'll open source the result. But @starlocke's work is on hold pending a reply from @dregad, precisely because we want something that will be integrated into mantis. We ourselves don't want to run our own fork. |
|
Oops sorry I did not realize you guys were waiting for my input... Thanks for the heads up, I'll have a look later tonight or tomorrow. |
|
While the idea of passing the project id as part of URL path seems interesting, I'm a bit concerned about backwards-compatibility with URLs, i.e. making sure everything still works without the A query string seems more in line with how Mantis currently works, so maybe preferable. Using Are you planning to use sessionStorage to persist the data on client side as suggested in 0009193:0059539 ? Regarding $g_project_override, its purpose is to allow pages to override the current project settings, which typically applies to the view bug pages where the "current" project used by filters, etc does not match the bug being viewed. This is pretty much what we're attempting to achieve here so IMO it would make sense to try and use that instead of designing something else. I can't promise you it will work 100% of the time or that there would be no conflicts, but it's at least worth a try. Consider this potentially conflicting use case: https://example.com/project/1/view.php?id=2 where issue 2 belongs in another project |
|
@rogueresearch @starlocke @dregad |
|
@dregad - Okay. That's a lot of helpful feedback! RE: "sessionStorage plans?" -- No, that does not seem like a useful solution to me, since it would "lock in" any considerations to a singular browser/session. RE: queryString vs URL -- Originally, I wanted to use web-server magic to setup a URL-based solution, but, it's clear that query-string would be preferable for the project's sake in order to minimize dependencies. I'll endeavour to go that route. RE: conflict use case -- How about opting for a simple rule like "the more-specific identifier(s) will win" to resolve such conflicts? These conflicts can be detected, and, the clients can then be redirected to the canonically-resolved URL. When redirected like that, it would be nice to have a "notice" message at the top of the page if the concept of "flash messages" exists within MantisBT's framework already. |
|
That would work I guess... It is usually quite obvious which one is the "correct" project id from context, amongst user default, currently active one, or the displayed bug's.
Not really sure what you mean by that - like a pop-up message that user can dismiss ? |
|
https://github.com/starlocke/mantisbt-compose - Here's a work in progress. I'd like to assume that the watches of this issue are people who know how to use "Docker" and "Docker-Compose" in order to get a rapidly useable "sandbox" to test things out in. See its The TL;DR for the above is that you can "taste test" the query-string functionality: Reporting a bug
Viewing issues
My View
Known issue of the implementation, so far:
For the rest of the people who aren't using "Docker"... there's https://github.com/starlocke/mantisbt ( This is EXPERIMENTAL-quality work. It would not be wise to upgrade your production systems with these changes at this time. Requesting some initial comments/feedback on the rough patch, please. |
|
+1 from me |
|
@starlocke your current changes are based on outdated source code of version 2.9.1. The preferred for review is to send a pull request https://www.mantisbt.org/docs/master/en-US/Developers_Guide/html-desktop/#dev.contrib.submit.github |
|
Thanks @starlocke. I'll have a look, but being quite busy at the moment, I can't really commit on when I'll be able to provide feedback. In addition to what atrol just said about using an old version of MantisBT, I also noticed that your repo https://github.com/starlocke/mantisbt is actually not a fork of https://github.com/mantisbt/mantisbt, so you won't be able to submit pull requests... I would suggest you fix that (drop the Github repo, fork the official repo, then push your changes again). |
|
I probably won't be able to keep up rebasing 100% of the time with "fast" release schedules. Also, this isn't a pull request. This is more of a very rough proof-of-concept. That's why the request for an initial pass at reviewing it. I intend to sniff out edge cases, build tests, etc -- before it's really ready for "prime time" pull requests to be made -- unless you happen to already see huge value in this and actually want a formal PR right away. Personally speaking, I think it's scary to deploy this without a set of tests for the new, special functionality. |
|
I doubt you'd have any merge conflicts rebasing even daily, as you can see here: https://github.com/mantisbt/mantisbt/commits/master there are only a few commits a month. mantisbt is not a fast moving project. But why did you base your work on 2.9.1 and not at least the current release (2.25.2)? Forking the mantisbt repo and creating a PR would be easiest for me too. I already have a mantis test server running and testing your work would just be a matter of doing a git pull of your changes and restarting apache. Figuring out docker always takes me an afternoon. :) |
|
Ah. I see that 2.9.1 is quite ancient! I suppose it was a rather random "stumbled on that number" selection of starting point. I'll definitely rebase up to a current release and look forward to some good bug fixes and nice new features :) |
|
Hey, community! I rebased to release-2.25.2, and, advanced the prototype quite a fair bit.
As a temporary(?) measure, the system has a "make project_id affinity visibile" capability. I think it would be worthwhile to make that somewhat permanent, albeit with some toned-down styling instead of the "loud" styling currently employed. -- see screenshot, attached |
|
@starlocke your message came at the start of my vacation, but I'm now back, and caught up on all the usual post-vacation fires. :) I've created a test server and installed from your github fork. I see all the loud pink boxes. So is the idea that things with dotted boxes have yet to transition to getting the |
|
Also, @dregad, since the change is pretty big, am I right in assuming that it'll never go into 2.25.x? In other words, would it be better for @starlocke to rebase this on master? |
|
@dregad friendly ping. I hesitate to pay @starlocke for further work until we get some feedback... :) For example:
Thanks! |
|
@rogueresearch Thanks for the ping and apologies about the silence, I've been busy on other things and must admit that I forgot about this, sorry.
Correct. hotfix releases such as 2.25.x generally only receive bugfixes.
Yes please.
That would be best, as it makes the review process easier.
I had a quick look at it back in March and the approach seems OK overall, but I must admit that I have not fully tested it yet. |
|
@dregad, no worries, I know what it's like to be too busy! :) So @starlocke if you're still game, could you rebase your work on master and create the typical github fork + PR? Meanwhile, we have what you've done so far installed on a test server... my QA has some time now, what is it we should test or look for? |
|
@dregad @rogueresearch - Gotcha: aim for a PR against Re: Testing and bug hunting -- "dotted boxes" are one sign of things needing to be worked on. There will be too many to manually hunt them down at this stage, so I've created a web crawler to do that for me. It's rather risky to be playing with MantisBT's fundamental system like this without an automated safety net in place. I'm not yet certain about how to "share" the test suite -- it's based on schliflo/puppeteer-mocha-chai-docker. |
|
@starlocke I think the desire for the github PR is because that is how they are accustomed to reviewing code, not because anyone wants to merge this as-is or in the short term. |
|
Exactly. And you can mark the PR as draft until you feel it's ready |
|
@dregad - https://github.com/mantisbt/mantisbt/pull/1851 has been created to demonstrate the changes and get more feedback. I went with "merge from main" rather than "rebase atop" mainly due to conflicts that would arise involving URLs in edited lines of code; it was the simpler path. Exhaustive testing required a crawler (not published anywhere at this time) - it tested 1000's of pages from a very simplistic, fresh-install-with-2-projects starting point. |
|
Thank you. I'm quite busy at the moment, and don't have much time available for testing but I'll have a look as soon as possible. |
|