Comments (13)
@j-f1 Thanks
More info on the subject: https://gist.github.com/XVilka/8346728
I found a go implementation: https://github.com/xo/terminfo/blob/master/color.go#L49-L91
from git-bug.
My git-bug choose the same color for two labels on a total of three labels!
A silly idea: replace or add to colors a special character symbol.
Color blind people, and others could distinguish issues more easily...
from git-bug.
My thought on this:
- the good end game way to have properly defined colors for each label would be to have a git-bug config where admins could define various properties including what label exist and their colors, define what status exist for a bug and how you can transition from one status to another ... but we are not there yet
- there is already in the webUI some code to assign arbitrary colors to a label (https://github.com/MichaelMure/git-bug/blob/master/webui/src/Label.js#L10-L43)
My proposal:
- migrate the webui color code into the core. That way, a label will have the same color in all UIs, will get simpler and the core APIs will be ready for the end game
- when we have the code to define the config, we will just have to plug that in the core and we will have either automatic label colors or configured labels if users care enough to define them.
from git-bug.
For the termui, there needs to be a fallback for the colors since some terminals only support 16 or 256 colors.
from git-bug.
@j-f1 good point. That should be fairly easy to reduce the color precision to 16 or 8bits. I'm a bit confused as to how one is supposed to detect the terminal capabilities. I have the same question for how to detect the terminal size btw.
from git-bug.
Here’s a series of checks (in JavaScript, from the supports-color
module) that determine the level of color support. Please @mention me if you have any questions about what it’s doing:
if (env.COLORTERM === 'truecolor') {
return 3;
}
if ('TERM_PROGRAM' in env) {
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
return version >= 3 ? 3 : 2;
case 'Apple_Terminal':
return 2;
// No default
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ('COLORTERM' in env) {
return 1;
}
if (env.TERM === 'dumb') {
return min;
}
from git-bug.
Label's color are now defined directly in the core and used in the webUI through the graphQL API.
Next steps are:
- display the label's color in the termui
- make the colors configurable
from git-bug.
Code used by Github's hub command to display labels: https://github.com/github/hub/blob/master/utils/color.go
from git-bug.
Mind if I ask the current state of this issue?
from git-bug.
Labels should be displayed everywhere with the correct color, but you can't choose the color yourself. That would require a proper configuration data structured stored in git and shared.
from git-bug.
Alright, I understand. Do you planning to support colour selection in near future?
from git-bug.
Probably not as there is some significant development with higher priority (some being required to implement that feature).
from git-bug.
I second @vtexier. On the CLI and TUI, displaying a (coloured) character (e.g. the first letter of the label) would be much more useful than the current square.
I just created 2 labels on a repo and git-bug chose exactly the same colour for them.
from git-bug.
Related Issues (20)
- Import Jira through JQL query? HOT 1
- git bug rewrites .git/config and loses comments HOT 3
- Error: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified" on `git bug push` HOT 4
- Sourcehut Support HOT 6
- Error when querying bugs with 1+ parameters HOT 3
- Feature request: Import from JSON? HOT 5
- Best practices for referencing a `git-bug` issue in a commit? HOT 3
- Separate command (or option) to pull user identities from remote HOT 1
- CLI comment edit does not load original comment in text editor
- git bug push fails with SHA-1 key message HOT 3
- push fails on local origin
- Jira Bridge: Project doesn't exist
- util/text/validate.go: Safe is not safe
- Error: repository not found / Preferred way to deal with multiple git identities
- Add ability to add a label when creating a new bug HOT 1
- "Error: rename ... Access is denied" When Creating a Ticket
- bridge to https://github.com/charmbracelet/soft-serve HOT 2
- Search for git-bug ID in termui
- FTBFS: *GitRepo does not implement ClockedRepo (missing method AllClocks) HOT 2
- CLI usage possibilities were reduced?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-bug.