Giter VIP home page Giter VIP logo

Comments (7)

cenfun avatar cenfun commented on June 1, 2024 1

@edumserrano @Aroot42 Thank you for the suggestions about the title width.
Percentage width should not work, because it is not a simple table.
I agree that the default width of title should takes as much space as possible. This should be possible if do some calculations. let me do some research first.

from monocart-reporter.

cenfun avatar cenfun commented on June 1, 2024

the column width is customizable

// playwright.config.js
module.exports = {
    reporter: [
        ['monocart-reporter', {  
            name: "My Test Report",
            outputFile: './test-results/report.html',

            // custom columns
            columns: (defaultColumns) => {

                // find title column
                const titleColumn = defaultColumns.find((column) => column.id === 'title');
                titleColumn.width = 500;
                titleColumn.maxWidth = 2000;

            }
        }]
    ]
};

from monocart-reporter.

edumserrano avatar edumserrano commented on June 1, 2024

I saw that on the docs, you are right. My request was to try and make the default more user friendly.
Could the default try to be set using the above logic?

Because the problem is I don't know what fixed width to use. That would change depending on how the test titles change. I could just keep updating the fixed width, that's a solution indeed. I was trying to see if the report could have a better default for the title column.

from monocart-reporter.

cenfun avatar cenfun commented on June 1, 2024

The title width is 300 by default. What do you think the default width should be?
Maybe we can't find a most suitable default width, because users can view the report on their mobile phones.

from monocart-reporter.

Aroot42 avatar Aroot42 commented on June 1, 2024

Maybe you should think about stretching all the columns to 100% of the width of the screen, and setting the width of the columns to %?

from monocart-reporter.

edumserrano avatar edumserrano commented on June 1, 2024

My suggestion was:

if possible, make it so that the default width for the title column takes as much space as possible in attempt to display all titles without cropping. So in my test case it should look like this by default:

So the rules would be:

  1. find the max column width the title column could have. This might vary depending on screen resolution and number of columns in a report.
  2. find the test title with the longest width
  3. try to make the title column have enough width to display the largest title
  4. if the column with for the largest title is higher than the max column width then set the it to the max column width.

As @Aroot42 pointed out this might be something that can be achieved with some CSS instead of having to do any calculations. The above rules were just to explain my reasoning.

from monocart-reporter.

edumserrano avatar edumserrano commented on June 1, 2024

Tested on version 1.6.33 and it's working as expected.

Thank you @cenfun 🎉
Awesome work as always.

from monocart-reporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.